-
Notifications
You must be signed in to change notification settings - Fork 20
/
Sample9Task.java
80 lines (69 loc) · 2.79 KB
/
Sample9Task.java
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
package selenium.sample;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;
import java.io.File;
import java.util.concurrent.TimeUnit;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
public class Sample9Task {
WebDriver driver;
@Before
public void openPage() {
String libWithDriversLocation = System.getProperty("user.dir") + File.separator + "lib" + File.separator;
System.setProperty("webdriver.chrome.driver", libWithDriversLocation + "chromedriver" + new selenium.ChangeToFileExtension().extension());
driver = new ChromeDriver();
driver.get("https://kristinek.github.io/site/examples/loading_color");
}
@After
public void closeBrowser() {
driver.close();
}
@Test
public void loadGreenSleep() throws Exception {
// TODO:
// * 1) click on start loading green button
// * 2) check that button does not appear,
// * but loading text is seen instead "Loading green..."
// * 3) check that both button
// * and loading text is not seen,
// * success is seen instead "Green Loaded"
}
@Test
public void loadGreenImplicit() throws Exception {
// TODO:
// * 1) click on start loading green button
// * 2) check that button does not appear,
// * but loading text is seen instead "Loading green..."
// * 3) check that both button
// * and loading text is not seen,
// * success is seen instead "Green Loaded"
}
@Test
public void loadGreenExplicitWait() throws Exception {
// TODO:
// * 1) click on start loading green button
// * 2) check that button does not appear,
// * but loading text is seen instead "Loading green..."
// * 3) check that both button
// * and loading text is not seen,
// * success is seen instead "Green Loaded"
}
@Test
public void loadGreenAndBlueBonus() {
/* TODO:
* 0) wait until button to load green and blue appears
* 1) click on start loading green and blue button
* 2) check that button does not appear, but loading text is seen instead for green
* 3) check that button does not appear, but loading text is seen instead for green and blue
* 4) check that button and loading green does not appear,
* but loading text is seen instead for blue and success for green is seen
* 5) check that both button and loading text is not seen, success is seen instead
*/
}
}