use of com.github.sergueik.jprotractor.NgWebDriver in project selenium_java by sergueik.
the class NgScrollableTableTest method setUp.
@Before
public void setUp() throws Exception {
// change according to platform
System.setProperty("webdriver.chrome.driver", osName.toLowerCase().startsWith("windows") ? new File("c:/java/selenium/chromedriver.exe").getAbsolutePath() : resolveEnvVars(chromeDriverPath));
DesiredCapabilities capabilities = DesiredCapabilities.chrome();
if (isMobile) {
Map<String, String> mobileEmulation = new HashMap<>();
mobileEmulation.put("deviceName", "Google Nexus 5");
Map<String, Object> chromeOptions = new HashMap<>();
chromeOptions.put("mobileEmulation", mobileEmulation);
capabilities.setCapability(ChromeOptions.CAPABILITY, chromeOptions);
seleniumDriver = new ChromeDriver(capabilities);
// set ignoreSynchronization to true to handle page sync ourselves
// instead of using waitForAngular call in JProtractor
ngDriver = new NgWebDriver(seleniumDriver, true);
} else {
seleniumDriver = new ChromeDriver(capabilities);
ngDriver = new NgWebDriver(seleniumDriver, true);
}
ngDriver.get(baseUrl);
ngDriver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
page = new NgScrollableTablePage();
page.setDriver(ngDriver);
JPageFactory.initElements(ngDriver, channel, page);
}
use of com.github.sergueik.jprotractor.NgWebDriver in project selenium_java by sergueik.
the class NgMultiSelectTest method setUp.
@Before
public void setUp() throws Exception {
// change according to platform
// NOTE:
// java.lang.IllegalStateException: The driver executable does not exist: /var/run/chromedriver
// java.lang.IllegalStateException: The driver is not executable: /var/run/chromedriver
System.setProperty("webdriver.chrome.driver", osName.toLowerCase().startsWith("windows") ? new File("c:/java/selenium/chromedriver.exe").getAbsolutePath() : resolveEnvVars(chromeDriverPath));
DesiredCapabilities capabilities = DesiredCapabilities.chrome();
if (isMobile) {
Map<String, String> mobileEmulation = new HashMap<>();
mobileEmulation.put("deviceName", "Google Nexus 5");
Map<String, Object> chromeOptions = new HashMap<>();
chromeOptions.put("mobileEmulation", mobileEmulation);
capabilities.setCapability(ChromeOptions.CAPABILITY, chromeOptions);
seleniumDriver = new ChromeDriver(capabilities);
// set ignoreSynchronization to true to handle page sync ourselves
// instead of using waitForAngular call in JProtractor
ngDriver = new NgWebDriver(seleniumDriver, true);
} else {
seleniumDriver = new ChromeDriver(capabilities);
ngDriver = new NgWebDriver(seleniumDriver);
}
ngDriver.get(baseUrl);
ngDriver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
page = new NgMultiSelectPage();
page.setDriver(ngDriver);
JPageFactory.initElements(ngDriver, channel, page);
}
use of com.github.sergueik.jprotractor.NgWebDriver in project selenium_java by sergueik.
the class NgQualityShepherdTest method setUp.
@Before
public void setUp() throws Exception {
// change according to platformm
System.setProperty("webdriver.chrome.driver", osName.toLowerCase().startsWith("windows") ? new File("c:/java/selenium/chromedriver.exe").getAbsolutePath() : resolveEnvVars(chromeDriverPath));
DesiredCapabilities capabilities = DesiredCapabilities.chrome();
if (isMobile) {
Map<String, String> mobileEmulation = new HashMap<>();
mobileEmulation.put("deviceName", "Google Nexus 5");
Map<String, Object> chromeOptions = new HashMap<>();
chromeOptions.put("mobileEmulation", mobileEmulation);
capabilities.setCapability(ChromeOptions.CAPABILITY, chromeOptions);
seleniumDriver = new ChromeDriver(capabilities);
// set ignoreSynchronization to true to handle page sync ourselves
// instead of using waitForAngular call in JProtractor
ngDriver = new NgWebDriver(seleniumDriver, true);
} else {
seleniumDriver = new ChromeDriver(capabilities);
ngDriver = new NgWebDriver(seleniumDriver);
}
ngDriver.get(baseUrl);
ngDriver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
page = new NgQualityShepherdPage();
page.setDriver(ngDriver);
JPageFactory.initElements(ngDriver, channel, page);
}
use of com.github.sergueik.jprotractor.NgWebDriver in project selenium_java by sergueik.
the class SuperCalculatorTest method setUp.
@Before
public void setUp() throws Exception {
// change according to platformm
System.setProperty("webdriver.chrome.driver", osName.toLowerCase().startsWith("windows") ? new File("c:/java/selenium/chromedriver.exe").getAbsolutePath() : resolveEnvVars(chromeDriverPath));
DesiredCapabilities capabilities = DesiredCapabilities.chrome();
if (isMobile) {
Map<String, String> mobileEmulation = new HashMap<>();
mobileEmulation.put("deviceName", "Google Nexus 5");
Map<String, Object> chromeOptions = new HashMap<>();
chromeOptions.put("mobileEmulation", mobileEmulation);
capabilities.setCapability(ChromeOptions.CAPABILITY, chromeOptions);
seleniumDriver = new ChromeDriver(capabilities);
// set ignoreSynchronization to true to handle page sync ourselves
// instead of using waitForAngular call in JProtractor
ngDriver = new NgWebDriver(seleniumDriver, true);
} else {
/*
* DesiredCapabilities capabilities = new
* DesiredCapabilities("firefox", "", Platform.ANY); FirefoxProfile
* profile = new ProfilesIni().getProfile("default");
* profile.setEnableNativeEvents(false);
* capabilities.setCapability("firefox_profile", profile);
* seleniumDriver = new FirefoxDriver(capabilities);
*/
seleniumDriver = new ChromeDriver(capabilities);
ngDriver = new NgWebDriver(seleniumDriver);
}
ngDriver.get(baseUrl);
ngDriver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
superCalculatorPage = new SuperCalculatorPage();
JPageFactory.initElements(ngDriver, channel, superCalculatorPage);
}
use of com.github.sergueik.jprotractor.NgWebDriver in project selenium_java by sergueik.
the class TodoListTest method setUp.
@Before
public void setUp() throws Exception {
// change according to platformm
System.setProperty("webdriver.chrome.driver", osName.toLowerCase().startsWith("windows") ? new File("c:/java/selenium/chromedriver.exe").getAbsolutePath() : resolveEnvVars(chromeDriverPath));
DesiredCapabilities capabilities = DesiredCapabilities.chrome();
if (isMobile) {
Map<String, String> mobileEmulation = new HashMap<>();
mobileEmulation.put("deviceName", "Google Nexus 5");
Map<String, Object> chromeOptions = new HashMap<>();
chromeOptions.put("mobileEmulation", mobileEmulation);
capabilities.setCapability(ChromeOptions.CAPABILITY, chromeOptions);
seleniumDriver = new ChromeDriver(capabilities);
// set ignoreSynchronization to true to handle page sync ourselves
// instead of using waitForAngular call in JProtractor
ngDriver = new NgWebDriver(seleniumDriver, true);
} else {
/*
* DesiredCapabilities capabilities = new
* DesiredCapabilities("firefox", "", Platform.ANY); FirefoxProfile
* profile = new ProfilesIni().getProfile("default");
* profile.setEnableNativeEvents(false);
* capabilities.setCapability("firefox_profile", profile);
* seleniumDriver = new FirefoxDriver(capabilities);
*/
seleniumDriver = new ChromeDriver(capabilities);
ngDriver = new NgWebDriver(seleniumDriver);
}
ngDriver.get(baseUrl);
ngDriver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
page = new TodoListPage();
page.setDriver(ngDriver);
JPageFactory.initElements(ngDriver, channel, page);
}
Aggregations