Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package smoke_tests;
- import DescriptionOperator.MethodsOperator;
- import com.codeborne.selenide.Condition;
- import options.Common;
- import org.junit.jupiter.api.AfterEach;
- import org.junit.jupiter.api.BeforeEach;
- import org.junit.jupiter.api.Test;
- import org.openqa.selenium.By;
- import java.net.MalformedURLException;
- import java.sql.SQLException;
- import static com.codeborne.selenide.Condition.enabled;
- import static com.codeborne.selenide.Condition.visible;
- import static com.codeborne.selenide.Selenide.$;
- import static com.codeborne.selenide.Selenide.closeWebDriver;
- import static org.openqa.selenium.By.xpath;
- public class Example1 {
- @BeforeEach
- public void setUP() throws SQLException, InterruptedException, MalformedURLException {
- Common.setup();
- MethodsOperator.open(Common.settings.url);
- //Configuration.holdBrowserOpen = true;
- }
- @Test
- public void Test1() {
- MethodsOperator.typeLogin(Common.credSettings.login_o);
- MethodsOperator.typePassword(Common.credSettings.password_o);
- MethodsOperator.clickButtonFieldInLoginForm();
- $("[name=\"confirm-false\"]").shouldBe(Condition.enabled).click();
- }
- @Test
- public void Test2() {
- MethodsOperator.typeLogin("Common.credSettings.login_o");
- MethodsOperator.typePassword(Common.credSettings.password_o);
- MethodsOperator.clickButtonFieldInLoginForm();
- //$("[name=\"confirm-false\"]").shouldBe(Condition.enabled).click();
- $(By.xpath(".//*[contains(text(),'Неверный логин/пароль')]")).shouldBe(Condition.visible);
- }
- @Test
- public void Test3() {
- MethodsOperator.typeLogin(Common.credSettings.login_o);
- MethodsOperator.typePassword(Common.credSettings.password_o);
- MethodsOperator.clickButtonFieldInLoginForm();
- //$("[name=\"confirm-false\"]").shouldBe(Condition.enabled).click();
- $("[name=\"confirm-true\"]").shouldBe(visible);
- }
- @Test
- public void Test4() {
- MethodsOperator.typeLogin(Common.credSettings.login_o);
- MethodsOperator.typePassword(Common.credSettings.password_o);
- MethodsOperator.clickButtonFieldInLoginForm();
- //$("[name=\"confirm-false\"]").shouldBe(Condition.enabled).click();
- $("[name=\"confirm-true\"]").shouldBe(visible);
- $(xpath(".//*[contains(text(),'Данные корректны')]")).shouldBe(enabled);
- }
- @Test
- public void Test5() {
- MethodsOperator.typeLogin(Common.credSettings.login_o);
- MethodsOperator.typePassword("Common.credSettings.password_o");
- MethodsOperator.clickButtonFieldInLoginForm();
- //$("[name=\"confirm-false\"]").shouldBe(Condition.enabled).click();
- $(By.xpath(".//*[contains(text(),'Неверный логин/пароль')]")).shouldBe(Condition.visible);
- }
- @Test
- public void Test6() {
- MethodsOperator.typeLogin(Common.credSettings.login_o);
- MethodsOperator.typePassword("Common.credSettings.password_o");
- MethodsOperator.clickButtonFieldInLoginForm();
- //$("[name=\"confirm-false\"]").shouldBe(Condition.enabled).click();
- $(By.xpath(".//*[contains(text(),'Неверный логин/парль')]")).shouldBe(Condition.visible);
- }
- @AfterEach
- public void over(){
- //WebDriverRunner.getWebDriver().close();
- closeWebDriver();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement