From abe8c16fba77c19a2a60dbc465faccde511c6523 Mon Sep 17 00:00:00 2001 From: chao-xian Date: Thu, 26 Mar 2026 16:51:22 +0000 Subject: [PATCH 1/2] Update query to click first link to be more reliable --- spec/end_to_end/end_to_end_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/end_to_end/end_to_end_spec.rb b/spec/end_to_end/end_to_end_spec.rb index e1ba86c..1d81654 100644 --- a/spec/end_to_end/end_to_end_spec.rb +++ b/spec/end_to_end/end_to_end_spec.rb @@ -56,7 +56,7 @@ add_a_single_line_of_text_question(question_text) add_a_single_line_of_text_question(alternate_question_text) - first(:link, "your questions").click + click_link "your questions", match: :first add_a_route selection_question, if_the_answer_selected_is: "Yes", skip_the_person_to: alternate_question_text add_a_secondary_skip last_question_before_skip: question_text, question_to_skip_to: "Check your answers before submitting" From 8098433bfa5c6e69e769f9437799de81dfe2aa1d Mon Sep 17 00:00:00 2001 From: chao-xian Date: Fri, 27 Mar 2026 16:37:36 +0000 Subject: [PATCH 2/2] Add conditional step for CopyOfAnswers page --- spec/support/feature_helpers.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/spec/support/feature_helpers.rb b/spec/support/feature_helpers.rb index 41ce1a2..16cd540 100644 --- a/spec/support/feature_helpers.rb +++ b/spec/support/feature_helpers.rb @@ -359,6 +359,13 @@ def form_is_filled_in_by_form_filler(live_form_link, yes_branch: false, confirma end # rubocop:enable Style/IdenticalConditionalBranches + if filler_answer_email_enabled? + logger.info "And I am asked if I want a copy of my answers" + expect(page.find("h1")).to have_content "Do you want to get an email with a copy of your answers?" + choose "No", visible: false + click_button "Continue" + end + logger.info "Then I can check my answers before I submit them" expect(page).to have_content "Check your answers before submitting your form" expect(page).to have_content "What is your favourite colour?" @@ -580,6 +587,10 @@ def skip_file_upload? ENV.fetch("SKIP_FILE_UPLOAD", false) end + def filler_answer_email_enabled? + Settings.features.filler_answer_email_enabled + end + def visit_product_page logger.info "Visiting product pages at #{forms_product_page_url}" visit forms_product_page_url