
pages.herokuapp.BasicAuthentication Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of AUTOTESTIMATIC-JAVA Show documentation
Show all versions of AUTOTESTIMATIC-JAVA Show documentation
An open-source Selenium Java-based Test automation Framework that allows you to perform multiple actions
to test a web application's functionality, behaviour, which provides easy to use syntax,
and easy to set up environment according to the needed requirements for testing
package pages.herokuapp;
import driverfactory.webdriver.WebDriver;
import io.qameta.allure.Step;
import org.openqa.selenium.By;
import org.testng.Assert;
public class BasicAuthentication {
private final WebDriver driver;
By successMessage = By.cssSelector("p");
public BasicAuthentication(WebDriver driver) {
this.driver = driver;
}
@Step("Then an alert should be displayed")
public BasicAuthentication checkThatBasicAuthAlertShouldBeDisplayed()
{
String text = driver.element().getAlertText();
Assert.assertEquals(text, "Sign in to access this site");
return this;
}
@Step("Then Authentication should be successful")
public BasicAuthentication checkThatBasicAuthIsSuccessful()
{
driver.assertThat().element(successMessage).text()
.isEqualTo("Congratulations! You must have the proper credentials.");
return this;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy