- Notifications
You must be signed in to change notification settings - Fork 60
Expand file tree
/
Copy pathextra1Task.java
More file actions
Latest commit
64 lines (55 loc) · 2.29 KB
/
Copy pathextra1Task.java
File metadata and controls
64 lines (55 loc) · 2.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
packageselenium.sample.extra;
importorg.junit.After;
importorg.junit.Before;
importorg.junit.Test;
importorg.openqa.selenium.WebDriver;
importorg.openqa.selenium.chrome.ChromeDriver;
importjava.io.File;
publicclassextra1Task {
WebDriverdriver;
Stringbase_url = "https://kristinek.github.io/site/examples/act";
Stringnew_url = "https://kristinek.github.io/site/examples/link1";
// method which is being run before each test
@Before
publicvoidstartingTests() throwsException {
// from Sample 1:
StringlibWithDriversLocation = System.getProperty("user.dir") + File.separator + "lib" + File.separator;
System.setProperty("webdriver.chrome.driver", libWithDriversLocation + "chromedriver" + newselenium.ChangeToFileExtension().extension());
// declaration above:
driver = newChromeDriver();
//open page:
driver.get(base_url);
}
// method which is being run after each test
@After
publicvoidendingTests() throwsException {
driver.close();
}
@Test
publicvoidnavigateBack() throwsException {
// TODO
// open page with url "https://kristinek.github.io/site/examples/po"
// click "More > " for the top left element
// check that the url now "https://kristinek.github.io/site/examples/po1"
// using driver navigation go back to "https://kristinek.github.io/site/examples/po"
// check that the page now is "https://kristinek.github.io/site/examples/po"
}
@Test
publicvoidnavigateForward() throwsException {
// TODO
// open page with url "https://kristinek.github.io/site/examples/po"
// click "More > " for the top left element
// using driver navigation go back to "https://kristinek.github.io/site/examples/po"
// using driver navigation go forward to "https://kristinek.github.io/site/examples/po1"
// check that the page now is "https://kristinek.github.io/site/examples/po1"
}
@Test
publicvoidrefresh() throwsException {
// TODO
// open page "https://kristinek.github.io/site/examples/act"
// click on "Show" button in 'Button' section
// check that text "I am here!" is seen
// refresh page
// check that text "I am here!" is not seen
}
}