selenium-jupiter

How to use different webdrivers based on environment

╄→尐↘猪︶ㄣ 提交于 2019-12-13 03:53:46
问题 I use selenium-jupiter. I am getting a webdriver from method arguments like this: @Test public void testWithChrome(ChromeDriver chromeDriver) { chromeDriver.get("someUrlHere"); } Now I want to run tests on grid so I need to use webdriver based on environment. For example when developing tests on my PC I want to use (local) ChromeDriver, but when running tests on grid with Jenkins, I want to use RemoteDriver. So I need something like this: (That gives me local Chrome when env = 0 or gives me

How to programmatically configure WebDriver in base class in Selenium Jupiter?

心已入冬 提交于 2019-12-11 11:57:00
问题 I want to migrate existing Selenium-Tests based on JUnit 4 to JUnit 5. For this purpose, I want to make use of Selenium-Jupiter. One requirement, that the tests must fulfill is, to be able to switch the WebDriver implementation at runtime - based on the execution environment - using one common base class for all tests : When executed on a developer machine (Windows 10), a FirefoxDriver should be used, launching a locally installed Firefox. In the CI-environment (CentOS 7), a RemoteWebDriver

How to pass gradle systemProperties JUnit5 tests?

不羁岁月 提交于 2019-12-10 14:07:08
问题 I am using gradle 3.5 and Unit 5 (jupiter) . I wish to pass System property to my tests, in order to configure the test I am running the test using this command gradle test -Denv=envFile1 Here is my gradle file : buildscript { repositories { mavenCentral() } dependencies { classpath 'org.junit.platform:junit-platform-gradle-plugin:1.0.0-M4' //JUnit 5 } } repositories { mavenCentral() } ext.versionJunitPlatform = '1.0.0-M4' ext.versionJunitJupiter = '5.0.0-M4' ext.versionLog4j = '1.2.17' ext