com.codacy.scoobydoo.web.BaseWebPage Maven / Gradle / Ivy
package com.codacy.scoobydoo.web;
import com.codacy.scoobydoo.configuration.Configuration;
import org.openqa.selenium.By;
import org.openqa.selenium.remote.RemoteWebDriver;
import org.openqa.selenium.support.ui.WebDriverWait;
public abstract class BaseWebPage extends WebFragment {
// TODO: check if this is really needed.
public WebDriverWait wait;
public BaseWebPage(RemoteWebDriver driver, Configuration configuration) {
super(driver, configuration);
this.wait = new WebDriverWait(driver, config.getTimeout().PAGE_LOAD_TIMEOUT);
}
// TODO: Rename method WebUtils.refreshBrowser to refreshPage and use it instead of this. Then delete this.
@Deprecated
public void refreshPage() {
getDriver().navigate().refresh();
}
public static By byDataTestId(String locator) {
return By.cssSelector(String.format("[data-testid=\"%s\"]", locator));
}
}