Skip to content

updated to latest amazon results #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ public class AmazonHomePage {
@FindBy(name="field-keywords")
private WebElement keywordsField;

@FindBy(css="#navGoButton input")
//@FindBy(css="#navGoButton input")
@FindBy(className="nav-submit-input")
private WebElement goButton;

public AmazonHomePage(WebDriver driver) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ public class AmazonSearchResultsPage {

private WebDriver driver;

@FindBy(css="#result_0 .title a")
//@FindBy(css="#result_0 .title a")
@FindBy(css="#result_0 .newaps")
private WebElement topResultTitle;

public AmazonSearchResultsPage(WebDriver driver) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package uk.co.activelylazy.selenium;

import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.assertThat;

import org.junit.After;
Expand All @@ -27,6 +27,6 @@ public void closeSelenium() {
search_amazon() {
AmazonHomePage homePage = AmazonHomePage.navigateTo(driver);
AmazonSearchResultsPage resultsPage = homePage.searchFor("iain banks");
assertThat(resultsPage.getTopResultTitle(), is("Stonemouth"));
assertThat(resultsPage.getTopResultTitle(), containsString("Quarry"));
}
}