Created
May 10, 2015 07:59
-
-
Save jsdevel/c9936738506d22e03722 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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