diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index bb2c101e657..2083b53f37d 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:0cea6ebf8fa4d693177f46ae9a8c24e6030245f3c795753269b7910178d5cfdd' + IDP_CI_SHA: 'sha256:756a1d450b422720dee36cb9a6217687bcad1e40b780219d360989861ce94212' PKI_IMAGE_TAG: 'main' DASHBOARD_IMAGE_TAG: 'main' diff --git a/.ruby-version b/.ruby-version index bea438e9ade..15a27998172 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -3.3.1 +3.3.0 diff --git a/Gemfile.lock b/Gemfile.lock index 3a4f49ebac8..7f219b5e301 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -865,7 +865,7 @@ DEPENDENCIES zxcvbn (= 0.1.9) RUBY VERSION - ruby 3.3.1p55 + ruby 3.3.0p0 BUNDLED WITH 2.5.6 diff --git a/dockerfiles/idp_review_app.Dockerfile b/dockerfiles/idp_review_app.Dockerfile index 39fd266eb57..95f4ea9399e 100644 --- a/dockerfiles/idp_review_app.Dockerfile +++ b/dockerfiles/idp_review_app.Dockerfile @@ -1,4 +1,4 @@ -FROM ruby:3.3.1-slim +FROM ruby:3.3.0-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 a5f5e2301af..635f942289f 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 and logs events' do + it 'redirects to the rate limited error page' do freeze_time do attach_and_submit_images timeout = distance_of_time_in_words( @@ -116,15 +116,22 @@ 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) - - 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 + 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) + end + context 'successfully processes image on last attempt' do before do DocAuth::Mock::DocAuthMockClient.reset! diff --git a/spec/support/capybara.rb b/spec/support/capybara.rb index 1bbb1cbd88c..20e81f41152 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=new') if !ENV['SHOW_BROWSER'] + options.add_argument("--headless#{ENV['CI'] ? '' : '=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=new') if !ENV['SHOW_BROWSER'] + options.add_argument("--headless#{ENV['CI'] ? '' : '=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 c87efa80494..b15281048c9 100644 --- a/spec/support/features/document_capture_step_helper.rb +++ b/spec/support/features/document_capture_step_helper.rb @@ -3,9 +3,7 @@ def submit_images click_on 'Submit' # Wait for the the loading interstitial to disappear before continuing - wait_for_content_to_disappear do - expect(page).not_to have_content(t('doc_auth.headings.interstitial'), wait: 10) - end + expect(page).not_to have_content(t('doc_auth.headings.interstitial'), wait: 10) 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 09444e5db6b..6d354d689d2 100644 --- a/spec/support/features/in_person_helper.rb +++ b/spec/support/features/in_person_helper.rb @@ -108,8 +108,18 @@ def complete_location_step(_user = nil) end # pause for the location list to disappear - wait_for_content_to_disappear do + begin 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 56e329ff1f3..9575125b972 100644 --- a/spec/support/features/interaction_helper.rb +++ b/spec/support/features/interaction_helper.rb @@ -1,20 +1,19 @@ module InteractionHelper def click_spinner_button_and_wait(...) click_on(...) - wait_for_content_to_disappear do + 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. + # + # 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