Skip to content

Commit

Permalink
Fix failing specs
Browse files Browse the repository at this point in the history
Capybara 2.15.0 added the word “visible” to some messages

Ref: teamcapybara/capybara#1892
  • Loading branch information
tagliala authored and mattheworiordan committed Apr 10, 2018
1 parent 8e36927 commit 502b539
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions spec/cucumber/cucumber_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def run_case(code, options = {})
end

it 'saves a screenshot on failure' do
run_failing_case %q{Unable to find link or button "you'll never find me"}, <<-CUCUMBER
run_failing_case %q{Unable to find visible link or button "you'll never find me"}, <<-CUCUMBER
Feature: Failure
Scenario: Failure
Given I visit "/"
Expand All @@ -52,7 +52,7 @@ def run_case(code, options = {})
end

it 'saves a screenshot for the correct session for failures using_session' do
run_failing_case(%q{Unable to find link or button "you'll never find me"}, <<-CUCUMBER)
run_failing_case(%q{Unable to find visible link or button "you'll never find me"}, <<-CUCUMBER)
Feature: Failure
Scenario: Failure in different session
Given I visit "/"
Expand All @@ -68,7 +68,7 @@ def run_case(code, options = {})
end

it 'on failure it prunes previous screenshots when strategy is set' do
run_failing_case %q{Unable to find link or button "you'll never find me"}, <<-CUCUMBER
run_failing_case %q{Unable to find visible link or button "you'll never find me"}, <<-CUCUMBER
Feature: Prune
Scenario: Screenshots are pruned if strategy is set
Given I visit "/"
Expand Down
2 changes: 1 addition & 1 deletion spec/feature/minitest_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def run_failing_case(code)

cmd = 'bundle exec ruby test_failure.rb'
run_simple_with_retry cmd, false
expect(last_command_started.output).to include %q{Unable to find link or button "you'll never find me"}
expect(last_command_started.output).to include %q{Unable to find visible link or button "you'll never find me"}
end

it 'saves a screenshot on failure' do
Expand Down
4 changes: 2 additions & 2 deletions spec/feature/testunit_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def run_failing_case(code, integration_path = '.')
#{setup_test_app}
Capybara::Screenshot.register_filename_prefix_formatter(:testunit) do | fault |
raise "expected fault" unless fault.exception.message.include? %q{Unable to find link or button "you'll never find me"}
raise "expected fault" unless fault.exception.message.include? %q{Unable to find visible link or button "you'll never find me"}
'my_screenshot'
end
Expand All @@ -29,7 +29,7 @@ def test_failure

cmd = "bundle exec ruby #{integration_path}/test_failure.rb"
run_simple_with_retry cmd, false
expect(last_command_started.output).to include %q{Unable to find link or button "you'll never find me"}
expect(last_command_started.output).to include %q{Unable to find visible link or button "you'll never find me"}
end

it "saves a screenshot on failure for any test in path 'test/integration'" do
Expand Down
4 changes: 2 additions & 2 deletions spec/rspec/rspec_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def cmd_with_format(format)
end

it 'saves a screenshot when browser action fails' do
run_failing_case <<-RUBY, %q{Unable to find link or button "you'll never find me"}
run_failing_case <<-RUBY, %q{Unable to find visible link or button "you'll never find me"}
feature 'screenshot with failure' do
scenario 'click on a missing link' do
visit '/'
Expand Down Expand Up @@ -103,7 +103,7 @@ def cmd_with_format(format)
end

it 'saves a screenshot for the correct session for failures using_session' do
run_failing_case <<-RUBY, %q{Unable to find link or button "you'll never find me"}
run_failing_case <<-RUBY, %q{Unable to find visible link or button "you'll never find me"}
feature 'screenshot with failure' do
scenario 'click on a missing link' do
visit '/'
Expand Down
6 changes: 3 additions & 3 deletions spec/spinach/spinach_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def run_failing_case(failure_message, code)
end

it "saves a screenshot on failure" do
run_failing_case(%q{Unable to find link or button "you'll never find me"}, <<-GHERKIN)
run_failing_case(%q{Unable to find visible link or button "you'll never find me"}, <<-GHERKIN)
Feature: Failure
Scenario: Failure
Given I visit "/"
Expand All @@ -37,7 +37,7 @@ def run_failing_case(failure_message, code)
end

it "saves a screenshot for the correct session for failures using_session" do
run_failing_case(%q{Unable to find link or button "you'll never find me"}, <<-GHERKIN)
run_failing_case(%q{Unable to find visible link or button "you'll never find me"}, <<-GHERKIN)
Feature: Failure
Scenario: Failure in different session
Given I visit "/"
Expand All @@ -49,7 +49,7 @@ def run_failing_case(failure_message, code)
it 'on failure it prunes previous screenshots when strategy is set' do
create_screenshot_for_pruning
configure_prune_strategy :last_run
run_failing_case(%q{Unable to find link or button "you'll never find me"}, <<-GHERKIN)
run_failing_case(%q{Unable to find visible link or button "you'll never find me"}, <<-GHERKIN)
Feature: Failure
Scenario: Failure
Given I visit "/"
Expand Down

0 comments on commit 502b539

Please sign in to comment.