All Downloads are FREE. Search and download functionalities are using the official Maven repository.

pages.herokuapp.BasicAuthentication Maven / Gradle / Ivy

Go to download

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

There is a newer version: 1.1.1
Show newest version
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