Mark Rspec matcher tests that require JS support

This commit is contained in:
Thomas Walpole 2018-04-13 14:49:28 -07:00
parent f905af494f
commit 9be6293282
2 changed files with 8 additions and 7 deletions

View File

@ -7,7 +7,7 @@ module TestSessions
RackTest = Capybara::Session.new(:rack_test, TestApp)
end
Capybara::SpecHelper.run_specs TestSessions::RackTest, "RackTest", capybara_skip: %i[
skipped_tests = %i[
js
modals
screenshot
@ -18,8 +18,9 @@ Capybara::SpecHelper.run_specs TestSessions::RackTest, "RackTest", capybara_skip
hover
about_scheme
]
Capybara::SpecHelper.run_specs TestSessions::RackTest, "RackTest", capybara_skip: skipped_tests
RSpec.describe Capybara::Session do
RSpec.describe Capybara::Session, capybara_skip: skipped_tests do
include_examples Capybara::RSpecMatchers, TestSessions::RackTest, :rack_test
context 'with rack test driver' do

View File

@ -547,7 +547,7 @@ RSpec.shared_examples Capybara::RSpecMatchers do |session, _mode|
end.to raise_error('expected "with_js" to include "No such title"')
end
context 'with wait' do
context 'with wait', requires: [:js] do
before(:each) do
@session = session
@session.visit('/with_js')
@ -592,7 +592,7 @@ RSpec.shared_examples Capybara::RSpecMatchers do |session, _mode|
end.to raise_error('expected "/with_js" to equal "/not_with_js"')
end
context 'with wait' do
context 'with wait', requires: [:js] do
before(:each) do
@session = session
@session.visit('/with_js')
@ -840,7 +840,7 @@ RSpec.shared_examples Capybara::RSpecMatchers do |session, _mode|
end
end
context "compounding", requires: [:js] do
context "compounding timing", requires: [:js] do
before(:each) do
@session = session
@session.visit('/with_js')
@ -848,7 +848,7 @@ RSpec.shared_examples Capybara::RSpecMatchers do |session, _mode|
end
context "#and" do
it "should run 'concurrently'" do
it "should run 'concurrently'", requires: [:js] do
Capybara.using_wait_time(2) do
matcher = have_text('this is not there').and have_text('neither is this')
expect(Benchmark.realtime do
@ -859,7 +859,7 @@ RSpec.shared_examples Capybara::RSpecMatchers do |session, _mode|
end
end
it "should run 'concurrently' and retry" do
it "should run 'concurrently' and retry", requires: [:js] do
@session.click_link('reload-link')
@session.using_wait_time(2) do
expect(Benchmark.realtime do