124 lines
4.0 KiB
Java
124 lines
4.0 KiB
Java
import context.ChromeContext;
|
|
import context.Context;
|
|
import org.junit.jupiter.api.AfterAll;
|
|
import org.junit.jupiter.api.Assertions;
|
|
import org.junit.jupiter.api.BeforeAll;
|
|
import org.junit.jupiter.api.Test;
|
|
import org.openqa.selenium.Dimension;
|
|
import org.openqa.selenium.support.PageFactory;
|
|
import page.*;
|
|
|
|
public class NavigationMenu {
|
|
private final static String APP_URL = "http://www.sberbank-ast.ru/";
|
|
private static Context context;
|
|
|
|
@BeforeAll
|
|
public static void setup() {
|
|
context = new ChromeContext();
|
|
context.start();
|
|
context.getDriver().manage().window().setSize(new Dimension(1600, 900));
|
|
}
|
|
|
|
@AfterAll
|
|
public static void quit() {
|
|
context.close();
|
|
}
|
|
@Test
|
|
public void logotypeNavigationTest() {
|
|
context.getDriver().get(APP_URL);
|
|
MainPage page = PageFactory.initElements(context.getDriver(), MainPage.class);
|
|
page.clickMoreInformation();
|
|
SubMenuPage subPage = PageFactory.initElements(context.getDriver(), SubMenuPage.class);
|
|
subPage.clickLogoElement();
|
|
Assertions.assertTrue(page.isPageDisplayMain());
|
|
|
|
}
|
|
@Test
|
|
public void menuMainNavigationTest() {
|
|
context.getDriver().get(APP_URL);
|
|
MainPage page = PageFactory.initElements(context.getDriver(), MainPage.class);
|
|
page.clickMenu();
|
|
Assertions.assertTrue(page.isPageDisplayMenu());
|
|
}
|
|
@Test
|
|
public void RegistrationTest() {
|
|
context.getDriver().get(APP_URL);
|
|
MainPage page = PageFactory.initElements(context.getDriver(), MainPage.class);
|
|
page.clickRegistration();
|
|
SubMenuPage subPage = PageFactory.initElements(context.getDriver(), SubMenuPage.class);
|
|
Assertions.assertTrue(subPage.isPageDisplayRegistration());
|
|
|
|
}
|
|
@Test
|
|
public void FeedbackTest() {
|
|
context.getDriver().get(APP_URL);
|
|
MainPage page = PageFactory.initElements(context.getDriver(), MainPage.class);
|
|
page.clickFeedbackElement();
|
|
FeedbackPage feedPage = PageFactory.initElements(context.getDriver(), FeedbackPage.class);
|
|
Assertions.assertTrue(page.isPageDisplayFeedback());
|
|
}
|
|
|
|
|
|
@Test
|
|
public void ReestrTest(){
|
|
context.getDriver().get(APP_URL);
|
|
MainPage page = PageFactory.initElements(context.getDriver(), MainPage.class);
|
|
page.clickMoreInformation();
|
|
SearchPage searchPage = PageFactory.initElements(context.getDriver(), SearchPage.class);
|
|
searchPage.isPageDisplayReestr();
|
|
|
|
}
|
|
|
|
@Test
|
|
public void AccrediationTest(){
|
|
context.getDriver().get(APP_URL);
|
|
MainPage page = PageFactory.initElements(context.getDriver(), MainPage.class);
|
|
page.clickAccreditationElement();
|
|
Assertions.assertTrue(page.isPageDisplayAccreditation());
|
|
|
|
}
|
|
|
|
@Test
|
|
public void CheckNewsTest()
|
|
{
|
|
context.getDriver().get(APP_URL);
|
|
MainPage page = PageFactory.initElements(context.getDriver(), MainPage.class);
|
|
page.clickHeadlineElement();
|
|
page.isPageDisplayArticle();
|
|
|
|
}
|
|
|
|
@Test
|
|
public void checkSearchButton()
|
|
{
|
|
context.getDriver().get(APP_URL);
|
|
MainPage page = PageFactory.initElements(context.getDriver(), MainPage.class);
|
|
page.clickGreenSearchButton();
|
|
SubMenuPage subPage = PageFactory.initElements(context.getDriver(), SubMenuPage.class);
|
|
Assertions.assertTrue(subPage.isRageDisplaySearch());
|
|
}
|
|
|
|
@Test
|
|
public void openTenderTest()
|
|
{
|
|
context.getDriver().get(APP_URL);
|
|
MainPage page = PageFactory.initElements(context.getDriver(), MainPage.class);
|
|
page.clickFzElement();
|
|
page.isPageDisplayTender();
|
|
|
|
}
|
|
|
|
@Test
|
|
public void InfoQualityTest() {
|
|
context.getDriver().get(APP_URL);
|
|
MainPage page = PageFactory.initElements(context.getDriver(), MainPage.class);
|
|
page.clickQuality();
|
|
AboutCompanyPage aboutPage = PageFactory.initElements(context.getDriver(), AboutCompanyPage.class);
|
|
Assertions.assertTrue(aboutPage.isPageDisplayQuality());
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|