diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2083b53f37d..bb2c101e657 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 7f219b5e301..3a4f49ebac8 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 95f4ea9399e..39fd266eb57 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/features/idv/doc_auth/document_capture_spec.rb b/spec/features/idv/doc_auth/document_capture_spec.rb index 635f942289f..a5f5e2301af 100644 --- a/spec/features/idv/doc_auth/document_capture_spec.rb +++ b/spec/features/idv/doc_auth/document_capture_spec.rb @@ -107,7 +107,7 @@ end end - it 'redirects to the rate limited error page' do + it 'redirects to the rate limited error page and logs events' do freeze_time do attach_and_submit_images timeout = distance_of_time_in_words( @@ -116,20 +116,13 @@ message = strip_tags(t('errors.doc_auth.rate_limited_text_html', timeout: timeout)) expect(page).to have_content(message) expect(page).to have_current_path(idv_session_errors_rate_limited_path) - end - end - it 'logs the rate limited analytics event for doc_auth' do - attach_and_submit_images - expect(@fake_analytics).to have_logged_event( - 'Rate Limit Reached', - limiter_type: :idv_doc_auth, - ) - end - - it 'logs irs attempts event for rate limiting' do - attach_and_submit_images - expect(fake_attempts_tracker).to have_received(:idv_document_upload_rate_limited) + expect(@fake_analytics).to have_logged_event( + 'Rate Limit Reached', + limiter_type: :idv_doc_auth, + ) + expect(fake_attempts_tracker).to have_received(:idv_document_upload_rate_limited) + end end context 'successfully processes image on last attempt' do 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') diff --git a/spec/support/features/document_capture_step_helper.rb b/spec/support/features/document_capture_step_helper.rb index b15281048c9..c87efa80494 100644 --- a/spec/support/features/document_capture_step_helper.rb +++ b/spec/support/features/document_capture_step_helper.rb @@ -3,7 +3,9 @@ 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) + wait_for_content_to_disappear do + expect(page).not_to have_content(t('doc_auth.headings.interstitial'), wait: 10) + end end def attach_and_submit_images diff --git a/spec/support/features/in_person_helper.rb b/spec/support/features/in_person_helper.rb index 6d354d689d2..09444e5db6b 100644 --- a/spec/support/features/in_person_helper.rb +++ b/spec/support/features/in_person_helper.rb @@ -108,18 +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, - 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 diff --git a/spec/support/features/interaction_helper.rb b/spec/support/features/interaction_helper.rb index 9575125b972..56e329ff1f3 100644 --- a/spec/support/features/interaction_helper.rb +++ b/spec/support/features/interaction_helper.rb @@ -1,19 +1,20 @@ 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) - 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. - # - # 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. end end + + def wait_for_content_to_disappear + 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