Rspec System Test passes when run individually, fails when run with entire suite

Rspec System Test passes when run individually, fails when run with entire suite

I have the following test that passes when I run it in isolation:

I have the following test that passes when I run it in isolation:

require 'rails_helper'

RSpec.describe 'deleting a non-recurring user event', js: true do

let(:user) { create(:proofreader_user) } let(:date) { Date.current.strftime('%Y-%m-%d') } let(:date_time) { date + ' 00:00'}

it 'deletes the event' do visit root_path click_on "Login" fill_in "Email", with: user.email fill_in "Password", with: user.password click_on "Sign In" visit calendar_path expect(current_path).to eq(calendar_path) expect(page).to have_css("#complete_registration:disabled") expect(page).to_not have_css("td.fc-event-container") find("td.fc-day[data-date='#{date}']").click expect(page).to have_css("div#user-event-modal") expect(page).to have_select('user_event[title]', :options => UserEvent.titles.keys) expect(find('input', id: 'user_event_starting').value).to eq date_time expect(find('input', id: 'user_event_ending').value).to eq date_time page.execute_script("$('input#user_event_starting').val('#{date} 09:00')") expect(find('input', id: 'user_event_starting').value).to eq date + ' 09:00' page.execute_script("$('input#user_event_ending').val('#{date} 12:00')") expect(find('input', id: 'user_event_ending').value).to eq date + ' 12:00' click_on 'Save' expect(page).to have_css("td.fc-event-container a.fc-day-grid-event") expect(page).to have_css("span.fc-time", text: '9a - 12p') expect(page).to have_css("span.fc-title", text: 'work') find("span.fc-time", text: '9a - 12p').click expect(page).to have_css("div#user-event-modal") find("#del_one_event").click within('.swal2-actions') { click_button('Yes') } wait_for { page }.to_not have_css("div#user-event-modal") expect(page).to_not have_css("td.fc-event-container") expect(page).to_not have_css("span.fc-time", text: '10a - 14p') end end

However, when I run all of the tests I get the following error:

Failure/Error: within('.swal2-actions') { click_button('Yes') }

 Capybara::ElementNotFound:
   Unable to find visible css ".swal2-actions"

Why does this test fail when I run it with the other test and how can I fix it so it passes when I run all tests?

ruby-on-rails

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

Hire Ruby on Rails Developer | Hire RoR Developer

#1 Ruby on Rails development company. Hire Ruby on rails developer or a team to build secure, scalable and complex web solutions with a quick turnaround time.

Explain Ruby on rails MVC

Our Ruby on Rails Training will provide you to learn about Rails and web applications development with realty. Our Ruby on Rails Course also includes live sessions.

"Rewrite your Software," says Creator of Ruby on Rails

David Heinemeier Hansson is the creator of Ruby on Rails, co-founder & CTO of Basecamp, best-selling author, Le Mans class-winning race car driver, family man, frequent podcast guest, and inspirational conference speaker.

Pros & Cons you must know before using Ruby on Rails for your startup

Click here, free ruby on rails course videos for you. It shows you best way to complete Ruby certification. OnlineITGuru guides you towards easy Web script

Ruby on Rails Performance Tuning

Synchronises Assets between Rails and S3. Contribute to AssetSync/asset_sync development by creating an account on GitHub.