Skip to content

Commit

Permalink
Altered styling of some elements, and amended some syntax - Non proce…
Browse files Browse the repository at this point in the history
…dural change
  • Loading branch information
luke-hill committed Mar 15, 2018
1 parent d8c2871 commit 39a58bd
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 8 deletions.
4 changes: 2 additions & 2 deletions features/page_element_interaction.feature
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ Feature: Page element interaction
Scenario: Get individual elements
When I navigate to the home page
Then I can see the welcome header
And I can see the welcome header with capybara query options
# And I can see the welcome header with capybara query options - This needs moving out
And I can see the welcome message
And I can see the welcome message with capybara query options
# And I can see the welcome message with capybara query options - Again this needs moving out into a plural test
And I can see the go button
And I can see the link to the search page
But I cannot see the missing squirrel
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@

Then(/^I can see the go button$/) do
expect(@test_site.home).to have_go_button

@test_site.home.go_button.click
end

Expand Down
2 changes: 1 addition & 1 deletion test_site/html/home.htm
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ <h1>Welcome</h1>
</table>

<article class='people'>
<h1>People</h1>
<h2>People</h2>
<span class='person'>person 1</span>
<span class='person'>person 2</span>
<span class='person'>person 3</span>
Expand Down
2 changes: 1 addition & 1 deletion test_site/html/page_with_people.htm
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
</head>
<body>
<article class='people-something'>
<h1>People</h1>
<h2>People</h2>
<span class='person'>person 1</span>
<span class='person'>person 2</span>
<span class='person'>person 3</span>
Expand Down
6 changes: 3 additions & 3 deletions test_site/pages/home.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ class TestHomePage < SitePrism::Page

# individual elements
element :welcome_header, :xpath, '//h1'
element :welcome_message, :xpath, '//span'
element :go_button, :xpath, '//input'
element :link_to_search_page, :xpath, '//a'
element :welcome_message, 'body > span'
element :go_button, '[value="Go!"]'
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
2 changes: 1 addition & 1 deletion test_site/sections/people.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# frozen_string_literal: true

class People < SitePrism::Section
element :headline, 'h1'
element :headline, 'h2'
element :dinosaur, '.dinosaur' # doesn't exist on the page

elements :individuals, '.person'
Expand Down

0 comments on commit 39a58bd

Please sign in to comment.