Skip to content

Instantly share code, notes, and snippets.

@jsdevel
Created May 10, 2015 07:59
Show Gist options
  • Save jsdevel/c9936738506d22e03722 to your computer and use it in GitHub Desktop.
Save jsdevel/c9936738506d22e03722 to your computer and use it in GitHub Desktop.
package com.github.jsdevel.testng.selenium.samples;
import com.github.jsdevel.testng.selenium.AbstractPage;
import java.net.URL;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
public class GoogleHomePage extends AbstractPage<GoogleHomePage, SamplePageFactory> {
@FindBy(css = "[name=q]")
public WebElement q;
public GoogleSearchResultsPage submitSearch(String query) {
q.sendKeys(query);
q.submit();
return getPageFactory().getSearchResultsPage();
}
@Override
public boolean isPageViewableFrom(URL proposedUrl) {
return proposedUrl.getPath().startsWith("/");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment