Skip to content

Commit

Permalink
this isn't DRY but it demonstrates following links and also NOT follo…
Browse files Browse the repository at this point in the history
…wing links
  • Loading branch information
chrismcmahon committed Apr 5, 2012
1 parent 1b66236 commit ed9b494
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/pages/login_page.rb
Expand Up @@ -18,7 +18,7 @@ def login_with(username, password)

class BogusPage
include PageObject

#http://en.wikipedia.beta.wmflabs.org/wiki/Bogus_page
page_url 'https://en.wikipedia.org/wiki/Bogus_page'
link(:search, :link_text => 'search for Bogus page in Wikipedia')
link(:search2, :link_text => 'Search for "Bogus page"')
Expand Down
2 changes: 1 addition & 1 deletion spec/login/bogus_page_spec.rb
Expand Up @@ -10,7 +10,7 @@
end
end

context "follow Create New Article links" do
context "follow Create New Article search links" do
it "should follow all the defined links" do
visit_page(BogusPage)
@current_page.search.should be_empty
Expand Down
13 changes: 11 additions & 2 deletions spec/login/login_spec.rb
Expand Up @@ -20,13 +20,22 @@
end
end

context "check login page links" do
it "should demonstrate all the defined links exist" do
visit_page(LoginPage)
@current_page.phishing_element.should be_true
visit_page(LoginPage)
@current_page.password_strength_element.should be_true
end
end

context "visit login page links" do
it "should follow all the defined links" do
visit_page(LoginPage)
@current_page.phishing.should be_empty
@current_page.phishing.should be_true
@current_page.text.should include "Not to be confused with"
visit_page(LoginPage)
@current_page.password_strength.should be_empty
@current_page.password_strength.should be_true
@current_page.text.should include "measure of the effectiveness"
end
end
Expand Down

0 comments on commit ed9b494

Please sign in to comment.