-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMore_Examples
More file actions
51 lines (40 loc) · 1.26 KB
/
More_Examples
File metadata and controls
51 lines (40 loc) · 1.26 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
package TAU;
import org.junit.jupiter.api.*;
import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.*;
import org.openqa.selenium.WebDriver;
import org.testng.Assert;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;
import static org.junit.jupiter.api.TestInstance.Lifecycle.PER_CLASS;
@TestInstance(PER_CLASS)
public class Examples {
private WebDriver driver;
private WebDriverWait wait;
@BeforeAll
public void beforeAll() {
driver = new ChromeDriver();
}
@AfterAll
public void afterAll() {
driver.quit();
}
@Test
public void verifyLogo()
{
driver.get("https://duckduckgo.com/");
WebElement DuckLogo = driver.findElement(By.id("logo_homepage_link"));
Assert.assertEquals(true, DuckLogo.isDisplayed());
}
@Test
public void verifyCheckbox2()
{
driver.get("https://the-internet.herokuapp.com/");
WebElement link = driver.findElement(By.linkText("Checkboxes"));
link.click();
WebElement check2 = driver.findElement(By.cssSelector
("div.example>form :nth-child(3)"));
Assert.assertTrue(check2.isSelected());
}
}