File tree Expand file tree Collapse file tree 4 files changed +49
-4
lines changed
src/test/java/LocalBrowsers Expand file tree Collapse file tree 4 files changed +49
-4
lines changed Original file line number Diff line number Diff line change 8
8
9
9
script :
10
10
- ./mac_install_browsers.sh
11
- - mvn clean test
11
+ - mvn clean test -Dgroups=mac
12
12
13
13
cache :
14
14
directories :
Original file line number Diff line number Diff line change 1
- [](https://gitter.im/lazycoderio/sample-java-jenkins?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [](https://coveralls.io/github/lazycoderio/sample-java-jenkins?branch=master) [](https://codecov.io/gh/lazycoderio/sample-java-jenkins)[](https://www.codacy.com/app/andrew-m-krug/sample-java-jenkins?utm_source=github.com&utm_medium=referral&utm_content=lazycoderio/sample-java-jenkins&utm_campaign=Badge_Grade)[](https://codeclimate.com/github/lazycoderio/sample-java-jenkins)[](https://www.versioneye.com/user/projects/583b58fd4ef164003ff45522)[](https://travis-ci.org/lazycoderio/sample-java-jenkins)
1
+ [](https://gitter.im/lazycoderio/sample-java-jenkins?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [](https://coveralls.io/github/lazycoderio/sample-java-jenkins?branch=master) [](https://codecov.io/gh/lazycoderio/sample-java-jenkins) [](https://www.codacy.com/app/andrew-m-krug/sample-java-jenkins?utm_source=github.com&utm_medium=referral&utm_content=lazycoderio/sample-java-jenkins&utm_campaign=Badge_Grade) [](https://codeclimate.com/github/lazycoderio/sample-java-jenkins) [](https://www.versioneye.com/user/projects/583b58fd4ef164003ff45522) [](https://travis-ci.org/lazycoderio/sample-java-jenkins)
2
2
# Using this Project
3
3
4
4
This project is using the latest Selenium Bindings.
@@ -26,8 +26,22 @@ The following commands are instructions on how to run the tests
26
26
27
27
### From CLI
28
28
29
- ` mvn test `
29
+ ` mvn test -Dgroups=mac ` on a mac
30
30
31
31
### Intellij Idea
32
32
33
33
There is a shared run configuration that has the maven target setup and another with a sample built in NUnit test runner option.
34
+
35
+ #### Safari Test
36
+
37
+ Safari requires the following steps to enable Selenium Webdriver tests to run:
38
+
39
+ 1 . Open Safari Prefrences
40
+ 2 . Go to the Advanced Tab
41
+ 3 . Check the box at the bottom "Show Develop menu in menu bar"
42
+ 4 . Click on the Develop menu
43
+ 5 . Click on "Allow Remote Execution"
44
+
45
+ Now Safari tests will work.
46
+
47
+ If running tests only locally you can remove delete ` // ` from the ` @Test ` line of the Safari class.
Original file line number Diff line number Diff line change 1
1
package LocalBrowsers ;
2
2
3
+ import org .openqa .selenium .WebDriver ;
4
+ import org .openqa .selenium .chrome .ChromeDriver ;
5
+ import org .openqa .selenium .chrome .ChromeOptions ;
6
+ import org .openqa .selenium .edge .EdgeDriver ;
7
+ import org .openqa .selenium .edge .EdgeOptions ;
8
+ import org .openqa .selenium .remote .DesiredCapabilities ;
9
+ import org .testng .Assert ;
10
+ import org .testng .annotations .AfterTest ;
11
+ import org .testng .annotations .BeforeTest ;
12
+ import org .testng .annotations .Test ;
13
+
3
14
/**
4
15
* Created by andrew on 12/3/16.
5
16
*/
6
17
public class Edge {
18
+ WebDriver driver ;
19
+
20
+ @ BeforeTest
21
+ public void edgeSetup (){
22
+ DesiredCapabilities capabilities = DesiredCapabilities .edge ();
23
+ EdgeOptions options = new EdgeOptions ();
24
+ capabilities .setCapability (ChromeOptions .CAPABILITY , options );
25
+ driver = new EdgeDriver (capabilities );
26
+ }
27
+
28
+ @ Test (groups = {"windows" })
29
+ public void test (){
30
+ driver .get ("http://lazycoder.io/about.html" );
31
+ Assert .assertEquals (driver .getTitle (), "About" );
32
+ }
33
+
34
+ @ AfterTest
35
+ public void testTeardown (){
36
+ driver .quit ();
37
+ }
7
38
}
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ public void safariSetup(){
23
23
driver = new SafariDriver (capabilities );
24
24
}
25
25
26
- @ Test (groups = {"mac" })
26
+ @ Test // (groups = {"mac"})
27
27
public void test (){
28
28
driver .get ("http://lazycoder.io/about.html" );
29
29
Assert .assertEquals (driver .getTitle (), "About" );
You can’t perform that action at this time.
0 commit comments