From 6cae9f48cb7bf3f9a223e086618593eb58d7bfab Mon Sep 17 00:00:00 2001 From: Mitchell Henke Date: Tue, 14 May 2024 14:09:38 -0500 Subject: [PATCH 1/6] Update to Ruby 3.3.1 changelog: Internal, Maintenance, Update to Ruby 3.3.1 --- .gitlab-ci.yml | 2 +- .ruby-version | 2 +- Gemfile.lock | 2 +- dockerfiles/idp_review_app.Dockerfile | 2 +- spec/support/capybara.rb | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 58b76da6753..dba17ec41ac 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -8,7 +8,7 @@ variables: FF_SCRIPT_SECTIONS: 'true' JUNIT_OUTPUT: 'true' ECR_REGISTRY: '${AWS_ACCOUNT_ID}.dkr.ecr.${AWS_REGION}.amazonaws.com' - IDP_CI_SHA: 'sha256:756a1d450b422720dee36cb9a6217687bcad1e40b780219d360989861ce94212' + IDP_CI_SHA: 'sha256:0cea6ebf8fa4d693177f46ae9a8c24e6030245f3c795753269b7910178d5cfdd' PKI_IMAGE_TAG: 'main' DASHBOARD_IMAGE_TAG: 'main' diff --git a/.ruby-version b/.ruby-version index 15a27998172..bea438e9ade 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -3.3.0 +3.3.1 diff --git a/Gemfile.lock b/Gemfile.lock index f1038380a47..1341dd4b2cb 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -865,7 +865,7 @@ DEPENDENCIES zxcvbn (= 0.1.9) RUBY VERSION - ruby 3.3.0p0 + ruby 3.3.1p55 BUNDLED WITH 2.5.6 diff --git a/dockerfiles/idp_review_app.Dockerfile b/dockerfiles/idp_review_app.Dockerfile index 18ff905b4c4..0c5a392cba0 100644 --- a/dockerfiles/idp_review_app.Dockerfile +++ b/dockerfiles/idp_review_app.Dockerfile @@ -1,4 +1,4 @@ -FROM ruby:3.3.0-slim +FROM ruby:3.3.1-slim # Set environment variables ENV RAILS_ROOT /app diff --git a/spec/support/capybara.rb b/spec/support/capybara.rb index 20e81f41152..1bbb1cbd88c 100644 --- a/spec/support/capybara.rb +++ b/spec/support/capybara.rb @@ -8,7 +8,7 @@ Capybara.register_driver :headless_chrome do |app| options = Selenium::WebDriver::Chrome::Options.new - options.add_argument("--headless#{ENV['CI'] ? '' : '=new'}") if !ENV['SHOW_BROWSER'] + options.add_argument('--headless=new') if !ENV['SHOW_BROWSER'] options.add_argument('--disable-gpu') if !ENV['SHOW_BROWSER'] options.add_argument('--window-size=1200x700') options.add_argument('--no-sandbox') @@ -27,7 +27,7 @@ 'HeadlessChrome/88.0.4324.150 Safari/602.1' options = Selenium::WebDriver::Chrome::Options.new - options.add_argument("--headless#{ENV['CI'] ? '' : '=new'}") if !ENV['SHOW_BROWSER'] + options.add_argument('--headless=new') if !ENV['SHOW_BROWSER'] options.add_argument('--disable-gpu') if !ENV['SHOW_BROWSER'] options.add_argument('--no-sandbox') options.add_argument('--disable-dev-shm-usage') From 1a43a012b359a366f5163c1c54e43b7dd598cc71 Mon Sep 17 00:00:00 2001 From: Mitchell Henke Date: Thu, 16 May 2024 09:58:30 -0500 Subject: [PATCH 2/6] add more rescue --- .../features/document_capture_step_helper.rb | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/spec/support/features/document_capture_step_helper.rb b/spec/support/features/document_capture_step_helper.rb index b15281048c9..157416b8fc1 100644 --- a/spec/support/features/document_capture_step_helper.rb +++ b/spec/support/features/document_capture_step_helper.rb @@ -3,7 +3,20 @@ def submit_images click_on 'Submit' # Wait for the the loading interstitial to disappear before continuing - expect(page).not_to have_content(t('doc_auth.headings.interstitial'), wait: 10) + + begin + expect(page).not_to have_content(t('doc_auth.headings.interstitial'), wait: 10) + rescue Selenium::WebDriver::Error::StaleElementReferenceError, + Selenium::WebDriver::Error::UnknownError => e + # A StaleElementReferenceError means that the context the element + # was in has disappeared, which means the element is gone too. + # + # We sometimes see "UnknownError" with an error message that is similar to a + # StaleElementReferenceError, but have not been able to resolve it and are ignoring it + # for now. + raise e if e.is_a?(Selenium::WebDriver::Error::UnknownError) && + !e.message.include?('Node with given id does not belong to the document') + end end def attach_and_submit_images From 301afd26e0c0616b08f91206111e1e2f4e44e5b2 Mon Sep 17 00:00:00 2001 From: Mitchell Henke Date: Mon, 20 May 2024 11:20:52 -0500 Subject: [PATCH 3/6] Update spec/support/features/document_capture_step_helper.rb Co-authored-by: Zach Margolis --- .../features/document_capture_step_helper.rb | 8 +++----- spec/support/features/in_person_helper.rb | 8 +++----- spec/support/features/interaction_helper.rb | 13 +++++-------- 3 files changed, 11 insertions(+), 18 deletions(-) diff --git a/spec/support/features/document_capture_step_helper.rb b/spec/support/features/document_capture_step_helper.rb index 157416b8fc1..e03a73400d7 100644 --- a/spec/support/features/document_capture_step_helper.rb +++ b/spec/support/features/document_capture_step_helper.rb @@ -6,16 +6,14 @@ def submit_images begin expect(page).not_to have_content(t('doc_auth.headings.interstitial'), wait: 10) - rescue Selenium::WebDriver::Error::StaleElementReferenceError, - Selenium::WebDriver::Error::UnknownError => e + rescue Selenium::WebDriver::Error::StaleElementReferenceError # A StaleElementReferenceError means that the context the element # was in has disappeared, which means the element is gone too. - # + rescue Selenium::WebDriver::Error::UnknownError => e # We sometimes see "UnknownError" with an error message that is similar to a # StaleElementReferenceError, but have not been able to resolve it and are ignoring it # for now. - raise e if e.is_a?(Selenium::WebDriver::Error::UnknownError) && - !e.message.include?('Node with given id does not belong to the document') + raise e if !e.message.include?('Node with given id does not belong to the document') end end diff --git a/spec/support/features/in_person_helper.rb b/spec/support/features/in_person_helper.rb index 6d354d689d2..182c8277782 100644 --- a/spec/support/features/in_person_helper.rb +++ b/spec/support/features/in_person_helper.rb @@ -110,16 +110,14 @@ def complete_location_step(_user = nil) # pause for the location list to disappear begin expect(page).to have_no_css('.location-collection-item') - rescue Selenium::WebDriver::Error::StaleElementReferenceError, - Selenium::WebDriver::Error::UnknownError => e + rescue Selenium::WebDriver::Error::StaleElementReferenceError # A StaleElementReferenceError means that the context the element # was in has disappeared, which means the element is gone too. - # + rescue Selenium::WebDriver::Error::UnknownError => e # We sometimes see "UnknownError" with an error message that is similar to a # StaleElementReferenceError, but have not been able to resolve it and are ignoring it # for now. - raise e if e.is_a?(Selenium::WebDriver::Error::UnknownError) && - !e.message.include?('Node with given id does not belong to the document') + raise e if !e.message.include?('Node with given id does not belong to the document') end end diff --git a/spec/support/features/interaction_helper.rb b/spec/support/features/interaction_helper.rb index 9575125b972..b0866f1db5f 100644 --- a/spec/support/features/interaction_helper.rb +++ b/spec/support/features/interaction_helper.rb @@ -3,17 +3,14 @@ def click_spinner_button_and_wait(...) click_on(...) begin expect(page).to have_no_css('lg-spinner-button.spinner-button--spinner-active', wait: 10) - rescue Selenium::WebDriver::Error::StaleElementReferenceError, - Selenium::WebDriver::Error::UnknownError => e - raise e if e.is_a?(Selenium::WebDriver::Error::UnknownError) && - !e.message.include?('Node with given id does not belong to the document') - # A stale element error can occur when attempting to wait for the spinner to disappear if the - # context in which the button was clicked (e.g. a `within` block) itself disappears. This is - # fine, since if the ancestor disappears, it can be assumed that the button is gone too. - # + rescue Selenium::WebDriver::Error::StaleElementReferenceError + # A StaleElementReferenceError means that the context the element + # was in has disappeared, which means the element is gone too. + rescue Selenium::WebDriver::Error::UnknownError => e # We sometimes see "UnknownError" with an error message that is similar to a # StaleElementReferenceError, but have not been able to resolve it and are ignoring it # for now. + raise e if !e.message.include?('Node with given id does not belong to the document') end end end From 005f1bd8c575415b20da12cf95a821864d8dd1c8 Mon Sep 17 00:00:00 2001 From: Mitchell Henke Date: Thu, 23 May 2024 12:08:43 -0500 Subject: [PATCH 4/6] implement wait helper --- spec/support/features/document_capture_step_helper.rb | 11 +---------- spec/support/features/in_person_helper.rb | 10 +--------- spec/support/features/interaction_helper.rb | 8 +++++++- 3 files changed, 9 insertions(+), 20 deletions(-) diff --git a/spec/support/features/document_capture_step_helper.rb b/spec/support/features/document_capture_step_helper.rb index e03a73400d7..c87efa80494 100644 --- a/spec/support/features/document_capture_step_helper.rb +++ b/spec/support/features/document_capture_step_helper.rb @@ -3,17 +3,8 @@ def submit_images click_on 'Submit' # Wait for the the loading interstitial to disappear before continuing - - begin + wait_for_content_to_disappear do expect(page).not_to have_content(t('doc_auth.headings.interstitial'), wait: 10) - rescue Selenium::WebDriver::Error::StaleElementReferenceError - # A StaleElementReferenceError means that the context the element - # was in has disappeared, which means the element is gone too. - rescue Selenium::WebDriver::Error::UnknownError => e - # We sometimes see "UnknownError" with an error message that is similar to a - # StaleElementReferenceError, but have not been able to resolve it and are ignoring it - # for now. - raise e if !e.message.include?('Node with given id does not belong to the document') end end diff --git a/spec/support/features/in_person_helper.rb b/spec/support/features/in_person_helper.rb index 182c8277782..09444e5db6b 100644 --- a/spec/support/features/in_person_helper.rb +++ b/spec/support/features/in_person_helper.rb @@ -108,16 +108,8 @@ def complete_location_step(_user = nil) end # pause for the location list to disappear - begin + wait_for_content_to_disappear do expect(page).to have_no_css('.location-collection-item') - rescue Selenium::WebDriver::Error::StaleElementReferenceError - # A StaleElementReferenceError means that the context the element - # was in has disappeared, which means the element is gone too. - rescue Selenium::WebDriver::Error::UnknownError => e - # We sometimes see "UnknownError" with an error message that is similar to a - # StaleElementReferenceError, but have not been able to resolve it and are ignoring it - # for now. - raise e if !e.message.include?('Node with given id does not belong to the document') end end diff --git a/spec/support/features/interaction_helper.rb b/spec/support/features/interaction_helper.rb index b0866f1db5f..cc68dc146f1 100644 --- a/spec/support/features/interaction_helper.rb +++ b/spec/support/features/interaction_helper.rb @@ -1,8 +1,14 @@ module InteractionHelper def click_spinner_button_and_wait(...) click_on(...) - begin + wait_for_content_to_disappear do expect(page).to have_no_css('lg-spinner-button.spinner-button--spinner-active', wait: 10) + end + end + + def wait_for_content_to_disappear do + begin + yield rescue Selenium::WebDriver::Error::StaleElementReferenceError # A StaleElementReferenceError means that the context the element # was in has disappeared, which means the element is gone too. From d43e786617f526c9e93ba62dd904eef4f6d601d2 Mon Sep 17 00:00:00 2001 From: Mitchell Henke Date: Thu, 23 May 2024 12:22:23 -0500 Subject: [PATCH 5/6] Update spec/support/features/interaction_helper.rb Co-authored-by: Zach Margolis --- spec/support/features/interaction_helper.rb | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/spec/support/features/interaction_helper.rb b/spec/support/features/interaction_helper.rb index cc68dc146f1..a37e34be8ab 100644 --- a/spec/support/features/interaction_helper.rb +++ b/spec/support/features/interaction_helper.rb @@ -7,16 +7,14 @@ def click_spinner_button_and_wait(...) end def wait_for_content_to_disappear do - begin - yield - rescue Selenium::WebDriver::Error::StaleElementReferenceError - # A StaleElementReferenceError means that the context the element - # was in has disappeared, which means the element is gone too. - rescue Selenium::WebDriver::Error::UnknownError => e - # We sometimes see "UnknownError" with an error message that is similar to a - # StaleElementReferenceError, but have not been able to resolve it and are ignoring it - # for now. - raise e if !e.message.include?('Node with given id does not belong to the document') - end + yield + rescue Selenium::WebDriver::Error::StaleElementReferenceError + # A StaleElementReferenceError means that the context the element + # was in has disappeared, which means the element is gone too. + rescue Selenium::WebDriver::Error::UnknownError => e + # We sometimes see "UnknownError" with an error message that is similar to a + # StaleElementReferenceError, but have not been able to resolve it and are ignoring it + # for now. + raise e if !e.message.include?('Node with given id does not belong to the document') end end From 6924c3e7b60ea23fb3c13c56e9ddaa968d34d70d Mon Sep 17 00:00:00 2001 From: Mitchell Henke Date: Thu, 23 May 2024 12:08:43 -0500 Subject: [PATCH 6/6] implement wait helper --- spec/support/features/interaction_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/support/features/interaction_helper.rb b/spec/support/features/interaction_helper.rb index a37e34be8ab..56e329ff1f3 100644 --- a/spec/support/features/interaction_helper.rb +++ b/spec/support/features/interaction_helper.rb @@ -6,7 +6,7 @@ def click_spinner_button_and_wait(...) end end - def wait_for_content_to_disappear do + def wait_for_content_to_disappear yield rescue Selenium::WebDriver::Error::StaleElementReferenceError # A StaleElementReferenceError means that the context the element