From d4ab941115d854796c9867b228573c361a41e0ef Mon Sep 17 00:00:00 2001 From: Kevin Date: Mon, 10 Jul 2023 19:42:02 +0100 Subject: [PATCH] Fix: Flaky add submission test (round 2) Because: * Capybara is trying to open the form before the project submissions turbo frame is finished loading. This commit: * Wait until the turbo frame is finished loading and then open the submission modal. --- .../v2_lesson_project_submissions/add_submission_spec.rb | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/spec/system/v2_lesson_project_submissions/add_submission_spec.rb b/spec/system/v2_lesson_project_submissions/add_submission_spec.rb index 9370dea9b3..01d14b99b2 100644 --- a/spec/system/v2_lesson_project_submissions/add_submission_spec.rb +++ b/spec/system/v2_lesson_project_submissions/add_submission_spec.rb @@ -32,10 +32,11 @@ context 'when setting a submission as private' do it 'will display the submission for the submission owner but not for other users' do - form = Pages::ProjectSubmissions::Form.new.open.fill_in - - form.v2_make_private - form.submit + wait_for_turbo_frame("project-submissions_lesson_#{lesson.id}") do + form = Pages::ProjectSubmissions::Form.new.open.fill_in + form.v2_make_private + form.submit + end within(:test_id, 'submissions-list') do page.driver.refresh