diff --git a/modules/meeting/spec/features/structured_meetings/structured_meeting_update_flash_spec.rb b/modules/meeting/spec/features/structured_meetings/structured_meeting_update_flash_spec.rb index 31e225772f8f..3d58fe99b48e 100644 --- a/modules/meeting/spec/features/structured_meetings/structured_meeting_update_flash_spec.rb +++ b/modules/meeting/spec/features/structured_meetings/structured_meeting_update_flash_spec.rb @@ -33,7 +33,7 @@ RSpec.describe "Structured meetings CRUD", :js, - :with_cuprite do + with_cuprite: false do include Components::Autocompleter::NgSelectAutocompleteHelpers shared_let(:project) { create(:project, enabled_module_names: %w[meetings work_package_tracking]) } @@ -74,7 +74,7 @@ show_page.trigger_change_poll expect(page).to have_css(flash_component, wait: 5) expect(page).to have_text I18n.t(:notice_meeting_updated) - click_link_or_button "Reload" + page.within(".flash") { click_on "Reload" } end # Expect no notification in window2 @@ -103,7 +103,7 @@ expect(page).to have_css(flash_component, wait: 5) expect(page).to have_text I18n.t(:notice_meeting_updated) - click_link_or_button "Reload" + page.within(".flash") { click_on "Reload" } ## Add section show_page.add_section do @@ -119,7 +119,7 @@ show_page.trigger_change_poll expect(page).to have_css(flash_component, wait: 5) expect(page).to have_text I18n.t(:notice_meeting_updated) - click_link_or_button "Reload" + page.within(".flash") { click_on "Reload" } end # Expect no notification in window2 @@ -147,7 +147,7 @@ show_page.trigger_change_poll expect(page).to have_text I18n.t(:notice_meeting_updated) - click_link_or_button "Reload" + page.within(".flash") { click_on "Reload" } ## Close meeting find_test_selector("close-meeting-button").click @@ -158,7 +158,7 @@ show_page.trigger_change_poll expect(page).to have_css(flash_component, wait: 5) expect(page).to have_text I18n.t(:notice_meeting_updated) - click_link_or_button "Reload" + page.within(".flash") { click_on "Reload" } end # Expect no notification in window2 diff --git a/modules/meeting/spec/support/pages/structured_meeting/show.rb b/modules/meeting/spec/support/pages/structured_meeting/show.rb index 10a9367420d4..5d225826277d 100644 --- a/modules/meeting/spec/support/pages/structured_meeting/show.rb +++ b/modules/meeting/spec/support/pages/structured_meeting/show.rb @@ -43,6 +43,8 @@ def trigger_dropdown_menu_item(name) def trigger_change_poll script = <<~JS + // Remove flashes from the page to prevent race conditions + document.querySelectorAll('.op-toast--wrapper').forEach((el) => el.remove()); var target = document.querySelector('[data-test-selector="meeting-page-header"]'); var controller = window.Stimulus.getControllerForElementAndIdentifier(target, 'poll-for-changes') controller.triggerTurboStream();