File tree Expand file tree Collapse file tree 8 files changed +16
-104
lines changed
selenium-webdriver-junit4/src/test/java/io/github/bonigarcia/webdriver/junit4/ch02/helloworld_selenium_manager
selenium-webdriver-junit5/src/test/java/io/github/bonigarcia/webdriver/jupiter/ch02/helloworld_selenium_manager
selenium-webdriver-testng/src/test/java/io/github/bonigarcia/webdriver/testng/ch02/helloworld_selenium_manager Expand file tree Collapse file tree 8 files changed +16
-104
lines changed Original file line number Diff line number Diff line change 16
16
*/
17
17
package io .github .bonigarcia .webdriver .junit4 .ch02 .helloworld_selenium_manager ;
18
18
19
- import static java .lang .invoke .MethodHandles .lookup ;
20
19
import static org .assertj .core .api .Assertions .assertThat ;
21
- import static org .slf4j .LoggerFactory .getLogger ;
22
20
23
21
import org .junit .After ;
24
22
import org .junit .Before ;
25
23
import org .junit .Test ;
26
24
import org .openqa .selenium .WebDriver ;
27
25
import org .openqa .selenium .chrome .ChromeDriver ;
28
- import org .slf4j .Logger ;
29
26
30
27
public class HelloWorldChromeJUnit4Test {
31
28
32
- static final Logger log = getLogger (lookup ().lookupClass ());
33
-
34
29
WebDriver driver ;
35
30
36
31
@ Before
@@ -45,14 +40,8 @@ public void teardown() {
45
40
46
41
@ Test
47
42
public void test () {
48
- // Exercise
49
- String sutUrl = "https://bonigarcia.dev/selenium-webdriver-java/" ;
50
- driver .get (sutUrl );
51
- String title = driver .getTitle ();
52
- log .debug ("The title of {} is {}" , sutUrl , title );
53
-
54
- // Verify
55
- assertThat (title ).isEqualTo ("Hands-On Selenium WebDriver with Java" );
43
+ driver .get ("https://bonigarcia.dev/selenium-webdriver-java/" );
44
+ assertThat (driver .getTitle ()).contains ("Selenium WebDriver" );
56
45
}
57
46
58
47
}
Original file line number Diff line number Diff line change 16
16
*/
17
17
package io .github .bonigarcia .webdriver .junit4 .ch02 .helloworld_selenium_manager ;
18
18
19
- import static java .lang .invoke .MethodHandles .lookup ;
20
19
import static org .assertj .core .api .Assertions .assertThat ;
21
- import static org .slf4j .LoggerFactory .getLogger ;
22
20
23
21
import org .junit .After ;
24
22
import org .junit .Before ;
25
23
import org .junit .Test ;
26
24
import org .openqa .selenium .WebDriver ;
27
25
import org .openqa .selenium .edge .EdgeDriver ;
28
- import org .slf4j .Logger ;
29
26
30
27
public class HelloWorldEdgeJUnit4Test {
31
28
32
- static final Logger log = getLogger (lookup ().lookupClass ());
33
-
34
29
WebDriver driver ;
35
30
36
31
@ Before
@@ -45,14 +40,8 @@ public void teardown() {
45
40
46
41
@ Test
47
42
public void test () {
48
- // Exercise
49
- String sutUrl = "https://bonigarcia.dev/selenium-webdriver-java/" ;
50
- driver .get (sutUrl );
51
- String title = driver .getTitle ();
52
- log .debug ("The title of {} is {}" , sutUrl , title );
53
-
54
- // Verify
55
- assertThat (title ).isEqualTo ("Hands-On Selenium WebDriver with Java" );
43
+ driver .get ("https://bonigarcia.dev/selenium-webdriver-java/" );
44
+ assertThat (driver .getTitle ()).contains ("Selenium WebDriver" );
56
45
}
57
46
58
47
}
Original file line number Diff line number Diff line change 16
16
*/
17
17
package io .github .bonigarcia .webdriver .junit4 .ch02 .helloworld_selenium_manager ;
18
18
19
- import static java .lang .invoke .MethodHandles .lookup ;
20
19
import static org .assertj .core .api .Assertions .assertThat ;
21
- import static org .slf4j .LoggerFactory .getLogger ;
22
20
23
21
import org .junit .After ;
24
22
import org .junit .Before ;
25
23
import org .junit .Test ;
26
24
import org .openqa .selenium .WebDriver ;
27
25
import org .openqa .selenium .firefox .FirefoxDriver ;
28
- import org .slf4j .Logger ;
29
26
30
27
public class HelloWorldFirefoxJUnit4Test {
31
28
32
- static final Logger log = getLogger (lookup ().lookupClass ());
33
-
34
29
WebDriver driver ;
35
30
36
31
@ Before
@@ -45,14 +40,8 @@ public void teardown() {
45
40
46
41
@ Test
47
42
public void test () {
48
- // Exercise
49
- String sutUrl = "https://bonigarcia.dev/selenium-webdriver-java/" ;
50
- driver .get (sutUrl );
51
- String title = driver .getTitle ();
52
- log .debug ("The title of {} is {}" , sutUrl , title );
53
-
54
- // Verify
55
- assertThat (title ).isEqualTo ("Hands-On Selenium WebDriver with Java" );
43
+ driver .get ("https://bonigarcia.dev/selenium-webdriver-java/" );
44
+ assertThat (driver .getTitle ()).contains ("Selenium WebDriver" );
56
45
}
57
46
58
47
}
Original file line number Diff line number Diff line change 16
16
*/
17
17
package io .github .bonigarcia .webdriver .jupiter .ch02 .helloworld_selenium_manager ;
18
18
19
- import static java .lang .invoke .MethodHandles .lookup ;
20
19
import static org .assertj .core .api .Assertions .assertThat ;
21
- import static org .slf4j .LoggerFactory .getLogger ;
22
20
23
21
import org .junit .jupiter .api .AfterEach ;
24
22
import org .junit .jupiter .api .BeforeEach ;
25
23
import org .junit .jupiter .api .Test ;
26
24
import org .openqa .selenium .WebDriver ;
27
25
import org .openqa .selenium .edge .EdgeDriver ;
28
- import org .slf4j .Logger ;
29
26
30
27
class HelloWorldEdgeJupiterTest {
31
28
32
- static final Logger log = getLogger (lookup ().lookupClass ());
33
-
34
29
WebDriver driver ;
35
30
36
31
@ BeforeEach
@@ -45,14 +40,8 @@ void teardown() {
45
40
46
41
@ Test
47
42
void test () {
48
- // Exercise
49
- String sutUrl = "https://bonigarcia.dev/selenium-webdriver-java/" ;
50
- driver .get (sutUrl );
51
- String title = driver .getTitle ();
52
- log .debug ("The title of {} is {}" , sutUrl , title );
53
-
54
- // Verify
55
- assertThat (title ).isEqualTo ("Hands-On Selenium WebDriver with Java" );
43
+ driver .get ("https://bonigarcia.dev/selenium-webdriver-java/" );
44
+ assertThat (driver .getTitle ()).contains ("Selenium WebDriver" );
56
45
}
57
46
58
47
}
Original file line number Diff line number Diff line change 16
16
*/
17
17
package io .github .bonigarcia .webdriver .jupiter .ch02 .helloworld_selenium_manager ;
18
18
19
- import static java .lang .invoke .MethodHandles .lookup ;
20
19
import static org .assertj .core .api .Assertions .assertThat ;
21
- import static org .slf4j .LoggerFactory .getLogger ;
22
20
23
21
import org .junit .jupiter .api .AfterEach ;
24
22
import org .junit .jupiter .api .BeforeEach ;
25
23
import org .junit .jupiter .api .Test ;
26
24
import org .openqa .selenium .WebDriver ;
27
25
import org .openqa .selenium .firefox .FirefoxDriver ;
28
- import org .slf4j .Logger ;
29
26
30
27
class HelloWorldFirefoxJupiterTest {
31
28
32
- static final Logger log = getLogger (lookup ().lookupClass ());
33
-
34
29
WebDriver driver ;
35
30
36
31
@ BeforeEach
@@ -45,14 +40,8 @@ void teardown() {
45
40
46
41
@ Test
47
42
void test () {
48
- // Exercise
49
- String sutUrl = "https://bonigarcia.dev/selenium-webdriver-java/" ;
50
- driver .get (sutUrl );
51
- String title = driver .getTitle ();
52
- log .debug ("The title of {} is {}" , sutUrl , title );
53
-
54
- // Verify
55
- assertThat (title ).isEqualTo ("Hands-On Selenium WebDriver with Java" );
43
+ driver .get ("https://bonigarcia.dev/selenium-webdriver-java/" );
44
+ assertThat (driver .getTitle ()).contains ("Selenium WebDriver" );
56
45
}
57
46
58
47
}
Original file line number Diff line number Diff line change 16
16
*/
17
17
package io .github .bonigarcia .webdriver .testng .ch02 .helloworld_selenium_manager ;
18
18
19
- import static java .lang .invoke .MethodHandles .lookup ;
20
19
import static org .assertj .core .api .Assertions .assertThat ;
21
- import static org .slf4j .LoggerFactory .getLogger ;
22
20
23
21
import org .openqa .selenium .WebDriver ;
24
22
import org .openqa .selenium .chrome .ChromeDriver ;
25
- import org .slf4j .Logger ;
26
23
import org .testng .annotations .AfterMethod ;
27
24
import org .testng .annotations .BeforeMethod ;
28
25
import org .testng .annotations .Test ;
29
26
30
27
public class HelloWorldChromeNGTest {
31
28
32
- static final Logger log = getLogger (lookup ().lookupClass ());
33
-
34
29
WebDriver driver ;
35
30
36
31
@ BeforeMethod
@@ -45,14 +40,8 @@ public void teardown() {
45
40
46
41
@ Test
47
42
public void test () {
48
- // Exercise
49
- String sutUrl = "https://bonigarcia.dev/selenium-webdriver-java/" ;
50
- driver .get (sutUrl );
51
- String title = driver .getTitle ();
52
- log .debug ("The title of {} is {}" , sutUrl , title );
53
-
54
- // Verify
55
- assertThat (title ).isEqualTo ("Hands-On Selenium WebDriver with Java" );
43
+ driver .get ("https://bonigarcia.dev/selenium-webdriver-java/" );
44
+ assertThat (driver .getTitle ()).contains ("Selenium WebDriver" );
56
45
}
57
46
58
47
}
Original file line number Diff line number Diff line change 16
16
*/
17
17
package io .github .bonigarcia .webdriver .testng .ch02 .helloworld_selenium_manager ;
18
18
19
- import static java .lang .invoke .MethodHandles .lookup ;
20
19
import static org .assertj .core .api .Assertions .assertThat ;
21
- import static org .slf4j .LoggerFactory .getLogger ;
22
20
23
21
import org .openqa .selenium .WebDriver ;
24
22
import org .openqa .selenium .edge .EdgeDriver ;
25
- import org .slf4j .Logger ;
26
23
import org .testng .annotations .AfterMethod ;
27
24
import org .testng .annotations .BeforeMethod ;
28
25
import org .testng .annotations .Test ;
29
26
30
27
public class HelloWorldEdgeNGTest {
31
28
32
- static final Logger log = getLogger (lookup ().lookupClass ());
33
-
34
29
WebDriver driver ;
35
30
36
31
@ BeforeMethod
@@ -45,14 +40,8 @@ public void teardown() {
45
40
46
41
@ Test
47
42
public void test () {
48
- // Exercise
49
- String sutUrl = "https://bonigarcia.dev/selenium-webdriver-java/" ;
50
- driver .get (sutUrl );
51
- String title = driver .getTitle ();
52
- log .debug ("The title of {} is {}" , sutUrl , title );
53
-
54
- // Verify
55
- assertThat (title ).isEqualTo ("Hands-On Selenium WebDriver with Java" );
43
+ driver .get ("https://bonigarcia.dev/selenium-webdriver-java/" );
44
+ assertThat (driver .getTitle ()).contains ("Selenium WebDriver" );
56
45
}
57
46
58
47
}
Original file line number Diff line number Diff line change 16
16
*/
17
17
package io .github .bonigarcia .webdriver .testng .ch02 .helloworld_selenium_manager ;
18
18
19
- import static java .lang .invoke .MethodHandles .lookup ;
20
19
import static org .assertj .core .api .Assertions .assertThat ;
21
- import static org .slf4j .LoggerFactory .getLogger ;
22
20
23
21
import org .openqa .selenium .WebDriver ;
24
22
import org .openqa .selenium .firefox .FirefoxDriver ;
25
- import org .slf4j .Logger ;
26
23
import org .testng .annotations .AfterMethod ;
27
24
import org .testng .annotations .BeforeMethod ;
28
25
import org .testng .annotations .Test ;
29
26
30
27
public class HelloWorldFirefoxNGTest {
31
28
32
- static final Logger log = getLogger (lookup ().lookupClass ());
33
-
34
29
WebDriver driver ;
35
30
36
31
@ BeforeMethod
@@ -45,14 +40,8 @@ public void teardown() {
45
40
46
41
@ Test
47
42
public void test () {
48
- // Exercise
49
- String sutUrl = "https://bonigarcia.dev/selenium-webdriver-java/" ;
50
- driver .get (sutUrl );
51
- String title = driver .getTitle ();
52
- log .debug ("The title of {} is {}" , sutUrl , title );
53
-
54
- // Verify
55
- assertThat (title ).isEqualTo ("Hands-On Selenium WebDriver with Java" );
43
+ driver .get ("https://bonigarcia.dev/selenium-webdriver-java/" );
44
+ assertThat (driver .getTitle ()).contains ("Selenium WebDriver" );
56
45
}
57
46
58
47
}
You can’t perform that action at this time.
0 commit comments