From c10b983d20b97f2036dc5268cc096f11ec4ccfb3 Mon Sep 17 00:00:00 2001 From: Ivan Schneider Date: Fri, 20 Oct 2023 19:03:21 +0200 Subject: [PATCH] Stabilize Argos screenshots --- test/integration/setup_test.rb | 2 +- test/test_helper.rb | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/test/integration/setup_test.rb b/test/integration/setup_test.rb index d511bbb9..79ae3792 100644 --- a/test/integration/setup_test.rb +++ b/test/integration/setup_test.rb @@ -24,7 +24,7 @@ class SetupTest < ActionDispatch::IntegrationTest assert_text "User doesn't exist" fill_in 'Email', with: 'joe@mail.com' within('form') { click_on 'Sign in' } - assert_text 'Dashboard' + Capybara.using_wait_time(5) { assert_text 'Dashboard' } assert has_link?('documents') using_session 'bob' do add_virtual_authenticator diff --git a/test/test_helper.rb b/test/test_helper.rb index c835f9b1..25fa98cb 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -80,6 +80,10 @@ class ActionDispatch::IntegrationTest include Capybara::DSL include Capybara::Screenshot::MiniTestPlugin + setup do + FactoryBot.rewind_sequences # in order to have stable screenshots + end + def login collaborator = create :collaborator page.set_rack_session account_id: collaborator.account_id, collaborator_id: collaborator.id, user_id: collaborator.user_id