package PageComponents;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
import org.openqa.selenium.support.How;
import org.openqa.selenium.support.PageFactory;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;

public class RightSideBarPF {
    WebDriver driver;
    WebDriverWait wdw;

    @FindBy(how = How.ID, using = "sign-in-modal-link")
    WebElement revealLoginModalButton;

    public RightSideBarPF(WebDriver driver) {
        this.driver = driver;
        this.wdw = new WebDriverWait(this.driver, 1);
        PageFactory.initElements(driver, this);
    }

    public void revealLoginModal() {
        wdw.until(ExpectedConditions.elementToBeClickable(revealLoginModalButton));
        revealLoginModalButton.click();
    }

}
