-
Notifications
You must be signed in to change notification settings - Fork 572
Expand file tree
/
Copy pathSignInTest.java
More file actions
40 lines (27 loc) · 1.34 KB
/
SignInTest.java
File metadata and controls
40 lines (27 loc) · 1.34 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
import com.codoingRoiund.utils.WaitForElement;
import com.codoingRound.BasePage.BaseObject;
import com.sun.javafx.PlatformUtil;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import org.testng.Assert;
import org.testng.annotations.Test;
public class SignInTest extends BaseObject {
@Test
public void shouldThrowAnErrorIfSignInDetailsAreMissing() throws Exception {
WaitForElement wait = new WaitForElement();
driver.findElement(By.linkText("Your trips")).click();
driver.findElement(By.id("SignIn")).click();
int size = driver.findElements(By.tagName("iframe")).size();
wait.waitFor(5000);
WebElement fr=driver.findElement(By.xpath("//iframe[@class='spinnerMedium']"));
driver.switchTo().defaultContent();
driver.switchTo().frame(fr);
// wait.elementToAppear("//button[@id='signInButton']", 20);
driver.findElement(By.id("signInButton")).click();
String errors1 = driver.findElement(By.id("errors1")).getText();
System.out.println("Error : "+errors1);
Assert.assertEquals(errors1, "There were errors in your submission\nYour username is a required field\nYour account password is a required field");
}
}