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

pages.nopcommerce.EmailFriendPage 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.nopcommerce;

import driverfactory.webdriver.WebDriver;
import org.openqa.selenium.By;

public class EmailFriendPage{

    private final WebDriver driver;

    By friendEmailField = By.id("FriendEmail");
    By yourEmailField = By.id("YourEmailAddress");
    By messageField = By.id("PersonalMessage");
    By sendBtn = By.cssSelector("button.button-1.send-email-a-friend-button");
    By successMessage = By.cssSelector("div.result");

    public EmailFriendPage(WebDriver driver) {
        this.driver = driver;
    }

    public EmailFriendPage fillEmailFriendForm(String friendEmail, String message) {
        driver.element().fillField(friendEmailField, friendEmail);
        driver.element().fillField(messageField,message);
        return this;

    }

    public EmailFriendPage clickOnSendButton()
    {
        driver.element().click(sendBtn);
        return this;
    }

    public EmailFriendPage checkThatSuccessMessageShouldBeDisplayed(String message)
    {
        driver.element().waitForVisibility(successMessage);
        driver.assertThat().element(successMessage).text().isEqualTo(message);
        return this;
    }


}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy