Skip to content

Instantly share code, notes, and snippets.

@xsalefter
Created July 27, 2012 01:32
Show Gist options
  • Save xsalefter/3185664 to your computer and use it in GitHub Desktop.
Save xsalefter/3185664 to your computer and use it in GitHub Desktop.
public void should_resize_chrome_automatically() {
System.setProperty("webdriver.chrome.driver", "C:\\Users\\xsalefter\\AppData\\Local\\Google\\Chrome\\Application\\chromedriver.exe");
environmentVariables.setProperty("thucydides.browser.height", "200");
environmentVariables.setProperty("thucydides.browser.width", "400");
driver = factory.newInstanceOf(SupportedWebDriver.CHROME);
page = new StaticSitePage(driver, 1000);
page.open();
int width = ((Long)(((JavascriptExecutor)driver).executeScript("return window.innerWidth"))).intValue();
assertThat(width, allOf(lessThanOrEqualTo(1034), greaterThan(380)));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment