66 lines
1.7 KiB
Java
66 lines
1.7 KiB
Java
package tests;
|
|
|
|
import helpers.ChromeContext;
|
|
import helpers.Context;
|
|
import org.junit.jupiter.api.Assertions;
|
|
import org.openqa.selenium.support.PageFactory;
|
|
import pages.Email;
|
|
|
|
import org.junit.*;
|
|
import org.junit.jupiter.api.BeforeAll;
|
|
import org.junit.jupiter.api.Test;
|
|
|
|
import org.openqa.selenium.WebDriver;
|
|
|
|
|
|
public class EmailTests {
|
|
|
|
private static Email email;
|
|
private static Context context;
|
|
private final static String URL = "https://ostin.com/";
|
|
|
|
@BeforeAll
|
|
public static void setUp() {
|
|
|
|
context = new ChromeContext();
|
|
context.start();
|
|
|
|
context.getDriver().manage().window().maximize();
|
|
context.getDriver().get(URL);
|
|
email = new Email((WebDriver) context);
|
|
}
|
|
|
|
@Test
|
|
public void checkForFollow() throws InterruptedException {
|
|
Thread.sleep(3000);
|
|
email.emailService();
|
|
email.submitButtonClick();
|
|
Email email = PageFactory.initElements(context.getDriver(), Email.class);
|
|
Assertions.assertTrue(email.setSuccsessAlert());
|
|
}
|
|
|
|
@Test
|
|
public void checkForLogIn() {
|
|
email.logInLinkCLick();
|
|
email.fillFields("lkdlfr@mail.ru", "jhbhjbjbj");
|
|
email.logInButtonClick();
|
|
PageFactory.initElements(context.getDriver(), Email.class);
|
|
Assertions.assertTrue(email.canClickLogInButton());
|
|
}
|
|
|
|
@Test
|
|
public void checkForLogOut() {
|
|
email.logInLinkCLick();
|
|
email.fillFields("asda@dasd.asd", "12312eqs");
|
|
email.logInButtonClick();
|
|
PageFactory.initElements(context.getDriver(), Email.class);
|
|
Assertions.assertTrue(email.logInButtonDisplayed());
|
|
}
|
|
|
|
@After
|
|
public void quit() {
|
|
context.getDriver().quit();
|
|
}
|
|
|
|
}
|