Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand Down
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.3.1
3.3.0
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -865,7 +865,7 @@ DEPENDENCIES
zxcvbn (= 0.1.9)

RUBY VERSION
ruby 3.3.1p55
ruby 3.3.0p0

BUNDLED WITH
2.5.6
2 changes: 1 addition & 1 deletion dockerfiles/idp_review_app.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ruby:3.3.1-slim
FROM ruby:3.3.0-slim

# Set environment variables
ENV RAILS_ROOT /app
Expand Down
21 changes: 14 additions & 7 deletions spec/features/idv/doc_auth/document_capture_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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!
Expand Down
4 changes: 2 additions & 2 deletions spec/support/capybara.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand All @@ -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')
Expand Down
4 changes: 1 addition & 3 deletions spec/support/features/document_capture_step_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 11 additions & 1 deletion spec/support/features/in_person_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
25 changes: 12 additions & 13 deletions spec/support/features/interaction_helper.rb
Original file line number Diff line number Diff line change
@@ -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