Skip to content

Commit

Permalink
Default chrome fix specs (#3337)
Browse files Browse the repository at this point in the history
* Switch back to default chrome

* Skip tests that interact with modals that chrome automatically dismisses

* Uploaded items aren't always cleaned up? Allow for some variance in item count

* Correct comment

* Are we just not waiting long enough for the document to get indexed?

* Install ImageMagick

* Remove sleep

* Expect exactly 56 items in the CSV

* Add more wait to another flaky test

* Add some wait to typeahead spec

---------

Co-authored-by: Justin Coyne <[email protected]>
Co-authored-by: Steve Taylor <[email protected]>
  • Loading branch information
3 people authored Dec 11, 2024
1 parent 7232e93 commit fed880a
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 14 deletions.
12 changes: 2 additions & 10 deletions .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,9 @@ jobs:
BOOTSTRAP_VERSION: ${{ matrix.bootstrap_version }}
ENGINE_CART_RAILS_OPTIONS: "--skip-git --skip-listen --skip-spring --skip-keeps --skip-coffee --skip-test --css bootstrap ${{ matrix.additional_engine_cart_rails_options }}"
steps:
- name: Install ImageMagick
run: sudo apt install imagemagick
- uses: actions/checkout@v4
# Remove these Chrome steps after https://issues.chromium.org/issues/351858989 is fixed
- name: Setup a specific version of Chrome
uses: browser-actions/setup-chrome@v1
id: setup-chrome
with:
chrome-version: 126
install-chromedriver: true
install-dependencies: true
- name: Set CHROME_BIN environment variable
run: echo "CHROME_BIN=${{ steps.setup-chrome.outputs.chrome-path }}" >> $GITHUB_ENV
- name: Set up Ruby ${{ matrix.ruby }}
uses: ruby/setup-ruby@v1
with:
Expand Down
2 changes: 1 addition & 1 deletion spec/controllers/spotlight/bulk_updates_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
}

content = CSV.parse(response.body)
expect(content.length).to eq 56
expect(content.length).to eq(56)
expect(content[0]).to eq ['Item ID', 'Item Title', 'Visibility']
end
end
Expand Down
4 changes: 2 additions & 2 deletions spec/features/autocomplete_typeahead_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
expect(page).to have_css('.leaflet-container', visible: true)

click_button 'Save changes'
sleep 1 # Test fails without this after move to Propshaft.
sleep 2 # Test fails without this after move to Propshaft.

featured_image = Spotlight::FeaturedImage.last

Expand All @@ -40,7 +40,7 @@
check 'Show background image in masthead'

fill_in_typeahead_field(with: 'xd327cm9378', type: 'featured-image')
sleep 1 # HACK: that seems to mysteriously work.
sleep 2 # HACK: that seems to mysteriously work.

expect(page).to have_css('[data-panel-image-pagination]', text: /Image 1 of 2/, visible: true)

Expand Down
2 changes: 1 addition & 1 deletion spec/features/javascript/edit_in_place_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
end
end

it 'updates the metadata label' do
it 'updates the metadata label', default_max_wait_time: 10 do
visit spotlight.exhibit_dashboard_path(exhibit)

within '#sidebar' do
Expand Down
4 changes: 4 additions & 0 deletions spec/features/javascript/feature_page_admin_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@
end

it 'stays in curation mode if a user has unsaved data' do
skip('Chromedriver automatically dismisses alerts so this test does not work')

visit spotlight.edit_exhibit_feature_page_path(page1.exhibit, page1)

fill_in('Title', with: 'Some Fancy Title')
Expand All @@ -66,6 +68,8 @@
end

it 'stays in curation mode if a user has unsaved contenteditable data' do
skip('Chromedriver automatically dismisses alerts so this test does not work')

visit spotlight.edit_exhibit_feature_page_path(page1.exhibit, page1)

add_widget 'solr_documents'
Expand Down

0 comments on commit fed880a

Please sign in to comment.