Skip to content

Commit

Permalink
Lets just use xpath while searching for text on the page
Browse files Browse the repository at this point in the history
  • Loading branch information
barzilay authored Feb 6, 2018
1 parent b322afd commit 072450e
Showing 1 changed file with 1 addition and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,9 @@
searchbox.send_keys(:enter)
end


Then(/^text "([^"]*)" should display somewhere on the page$/) do |string|
# Search for the text on the page
browser.wait(
:like => {
:element => :body,
:attribute => :text,
:include => string
}
)
browser.wait(:xpath => "//*[contains(text(),\"#{string}\")]")
end

When(/^the user clicks on link "(.*?)"$/) do |url|
Expand Down

0 comments on commit 072450e

Please sign in to comment.