Skip to content

Commit

Permalink
Fix for undefined / ambiguous steps, now we are using the exact selec…
Browse files Browse the repository at this point in the history
…tor logic previously monkeypatched out
  • Loading branch information
luke-hill committed Apr 10, 2018
1 parent 8a3cb48 commit 0eec966
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
4 changes: 4 additions & 0 deletions features/step_definitions/navigation_steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,7 @@
Then(/^I will be redirected to the page without a title$/) do
expect(@test_site.no_title).to be_displayed
end

When(/^I click the go button$/) do
@test_site.home.go_button.click
end
6 changes: 3 additions & 3 deletions features/waiting.feature
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ Feature: Waiting for Elements
Scenario: Wait for Element - Positive
When I navigate to the home page
And I wait for the element that takes a while to appear
Then the element will appear
Then the slow element appears

Scenario: Wait for Element - Negative
When I navigate to the home page
And I wait for a specifically short amount of time for an element to appear
And I wait for a short amount of time for an element to appear
Then the element I am waiting for doesn't appear in time

Scenario: Wait for Visibility of element - Default Timeout
Expand All @@ -29,7 +29,7 @@ Feature: Waiting for Elements

Scenario: Wait for Invisibility of element - Default Timeout
When I navigate to the home page
And I wait while for an element to become invisible
And I wait for an element to become invisible
Then the previously visible element is invisible

Scenario: Wait for Invisibility of element - Overriden Timeout
Expand Down
2 changes: 1 addition & 1 deletion test_site/pages/home_with_expected_elements.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class TestHomePageWithExpectedElements < SitePrism::Page
element :welcome_header, :xpath, '//h1'
element :welcome_message, :xpath, '//span'
element :go_button, :xpath, '//input'
element :link_to_search_page, :xpath, '//a'
element :link_to_search_page, :xpath, '//p[2]/a'
element :some_slow_element, :xpath, '//a[@class="slow"]'
element :invisible_element, 'input.invisible'
element :shy_element, 'input#will_become_visible'
Expand Down
1 change: 1 addition & 0 deletions test_site/pages/no_title.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

class TestNoTitle < SitePrism::Page
set_url '/no_title.htm'
set_url_matcher(/no_title\.htm$/)

element :element_without_selector
elements :elements_without_selector
Expand Down

0 comments on commit 0eec966

Please sign in to comment.