File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Java CI with Maven
2+
3+ on : [push, pull_request]
4+
5+ jobs :
6+ build :
7+ runs-on : ubuntu-latest
8+
9+ steps :
10+ - uses : actions/checkout@v3
11+ - name : Set up JDK 11
12+ uses : actions/setup-java@v3
13+ with :
14+ java-version : ' 11'
15+ distribution : ' temurin' # Use Temurin distribution (formerly AdoptOpenJDK)
16+ - name : Cache Maven packages
17+ uses : actions/cache@v3
18+ with :
19+ path : ~/.m2
20+ key : ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
21+ restore-keys : |
22+ ${{ runner.os }}-m2
23+ - name : Build with Maven
24+ run : mvn -B clean test -P single
Original file line number Diff line number Diff line change @@ -24,4 +24,5 @@ local.log
2424* .rar
2525
2626# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
27- hs_err_pid *
27+ hs_err_pid *
28+ ** /.DS_Store
Load diff This file was deleted.
Original file line number Diff line number Diff line change 1- [ ![ Build Status] ( https://travis-ci.org/testingbot/java-junit-example.svg?branch=master )] ( https://travis-ci.org/testingbot/java-junit-example )
2-
31## TestingBot - Java & JUnit
42
53TestingBot provides an online grid of browsers and mobile devices to run Automated tests on via Selenium WebDriver.
@@ -27,4 +25,4 @@ You will see the test result in the [TestingBot Dashboard](https://testingbot.co
2725### Resources
2826##### [TestingBot Documentation](https://testingbot.com/support/getting-started/junit.html)
2927
30- ##### [SeleniumHQ Documentation](http ://www.seleniumhq.org/docs /)
28+ ##### [SeleniumHQ Documentation](https ://www.selenium.dev/documentation /)
Original file line number Diff line number Diff line change 1616
1717 <test .file></test .file>
1818 <config .file>default</config .file>
19- <maven .compiler.source>1.6 </maven .compiler.source>
20- <maven .compiler.target>1.6 </maven .compiler.target>
19+ <maven .compiler.source>1.7 </maven .compiler.source>
20+ <maven .compiler.target>1.7 </maven .compiler.target>
2121 </properties >
2222
2323 <dependencies >
2424 <dependency >
2525 <groupId >junit</groupId >
2626 <artifactId >junit</artifactId >
27- <version >4.12 </version >
27+ <version >4.13.2 </version >
2828 </dependency >
2929 <dependency >
3030 <groupId >commons-io</groupId >
3131 <artifactId >commons-io</artifactId >
32- <version >1.3.2 </version >
32+ <version >2.15.1 </version >
3333 </dependency >
3434 <dependency >
3535 <groupId >org.seleniumhq.selenium</groupId >
3636 <artifactId >selenium-java</artifactId >
37- <version >3.141.59 </version >
37+ <version >4.18.1 </version >
3838 </dependency >
3939 <dependency >
4040 <groupId >com.googlecode.json-simple</groupId >
Original file line number Diff line number Diff line change @@ -10,12 +10,7 @@ public class SingleTest extends TestingBotJUnitTest {
1010
1111 @ Test
1212 public void test () throws Exception {
13- driver .get ("https://www.google.com/ncr" );
14- WebElement element = driver .findElement (By .name ("q" ));
15- element .sendKeys ("TestingBot" );
16- element .submit ();
17- Thread .sleep (5000 );
18-
19- assertEquals ("TestingBot - Google Search" , driver .getTitle ());
13+ driver .get ("https://testingbot.com" );
14+ assertTrue (driver .getTitle ().contains ("TestingBot" ));
2015 }
2116}
Original file line number Diff line number Diff line change @@ -61,15 +61,15 @@ public void setUp() throws Exception {
6161 Iterator it = envCapabilities .entrySet ().iterator ();
6262 while (it .hasNext ()) {
6363 Map .Entry pair = (Map .Entry )it .next ();
64- capabilities .setCapability (pair .getKey ().toString (), pair .getValue (). toString () );
64+ capabilities .setCapability (pair .getKey ().toString (), pair .getValue ());
6565 }
6666
6767 Map <String , String > commonCapabilities = (Map <String , String >) config .get ("capabilities" );
6868 it = commonCapabilities .entrySet ().iterator ();
6969 while (it .hasNext ()) {
7070 Map .Entry pair = (Map .Entry )it .next ();
7171 if (capabilities .getCapability (pair .getKey ().toString ()) == null ){
72- capabilities .setCapability (pair .getKey ().toString (), pair .getValue (). toString () );
72+ capabilities .setCapability (pair .getKey ().toString (), pair .getValue ());
7373 }
7474 }
7575
@@ -83,7 +83,7 @@ public void setUp() throws Exception {
8383 secret = (String ) config .get ("secret" );
8484 }
8585
86- driver = new RemoteWebDriver (new URL ("http ://" +key +":" +secret +"@" +config .get ("server" )+"/wd/hub" ), capabilities );
86+ driver = new RemoteWebDriver (new URL ("https ://" +key +":" +secret +"@" +config .get ("server" )+"/wd/hub" ), capabilities );
8787 }
8888
8989 @ After
Original file line number Diff line number Diff line change 11{
22 "server" : " hub.testingbot.com" ,
3- "key" : " TESTINGBOT_KEY " ,
4- "secret" : " TESTINGBOT_SECRET " ,
3+ "key" : " TB_KEY " ,
4+ "secret" : " TB_SECRET " ,
55
66 "capabilities" : {
7- "build" : " junit-testingbot" ,
8- "name" : " single_test"
7+ "tb:options" : {
8+ "build" : " junit-testingbot" ,
9+ "name" : " parallel_test"
10+ }
911 },
1012
1113 "environments" : [{
12- "app" : " tb ://f0862ada623e611f530a65f5 " ,
13- "deviceName" : " Pixel 2" ,
14- "version" : " 7.1" ,
15- "platformName" : " Android"
14+ "appium: app" : " https ://testingbot.com/appium/sample.apk " ,
15+ "appium: deviceName" : " Pixel 2" ,
16+ "appium: version" : " 7.1" ,
17+ "appium: platformName" : " Android"
1618 }]
1719}
Original file line number Diff line number Diff line change 11{
22 "server" : " hub.testingbot.com" ,
3- "key" : " TESTINGBOT_KEY " ,
4- "secret" : " TESTINGBOT_SECRET " ,
3+ "key" : " TB_KEY " ,
4+ "secret" : " TB_SECRET " ,
55
66 "capabilities" : {
7- "build" : " junit-testingbot" ,
8- "name" : " parallel_test"
7+ "tb:options" : {
8+ "build" : " junit-testingbot" ,
9+ "name" : " parallel_test"
10+ }
911 },
1012
1113 "environments" : [{
12- "browser " : " chrome" ,
13- "platform " : " WIN10" ,
14- "version " : " latest"
14+ "browserName " : " chrome" ,
15+ "platformName " : " WIN10" ,
16+ "browserVersion " : " latest"
1517 },{
16- "browser " : " firefox" ,
17- "platform " : " WIN10 " ,
18- "version " : " latest"
18+ "browserName " : " firefox" ,
19+ "platformName " : " SONOMA " ,
20+ "browserVersion " : " latest"
1921 }]
2022}
Original file line number Diff line number Diff line change 11{
22 "server" : " hub.testingbot.com" ,
3- "key" : " TESTINGBOT_KEY " ,
4- "secret" : " TESTINGBOT_SECRET " ,
3+ "key" : " TB_KEY " ,
4+ "secret" : " TB_SECRET " ,
55
66 "capabilities" : {
7- "build" : " junit-testingbot" ,
8- "name" : " single_test"
7+ "tb:options" : {
8+ "build" : " junit-testingbot" ,
9+ "name" : " single_test"
10+ }
911 },
1012
1113 "environments" : [{
12- "browser " : " chrome" ,
13- "platform " : " WIN10" ,
14- "version " : " latest"
14+ "browserName " : " chrome" ,
15+ "platformName " : " WIN10" ,
16+ "browserVersion " : " latest"
1517 }]
1618}
You can’t perform that action at this time.
0 commit comments