8000 Lower PostgreSQL GitHub Action Chrome Version to Address Breaking Changes Between Latest Chrome Version (134) and `/features` Tests by aaronskiba · Pull Request #3491 · DMPRoadmap/roadmap · GitHub
[go: up one dir, main page]

Skip to content

Lower PostgreSQL GitHub Action Chrome Version to Address Breaking Changes Between Latest Chrome Version (134) and /features Tests #3491

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Mar 24, 2025
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
12 changes: 12 additions & 0 deletions .github/workflows/postgres.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,18 @@ jobs:
- name: 'Yarn Install'
run: |
yarn install

# TEMPORARY WORKAROUND FOR THE FOLLOWING ISSUE: https://github.com/DMPRoadmap/roadmap/issues/3485
# Remove this once our tests are compatible with the new version of Chrome
# Source: https://github.com/teamcapybara/capybara/issues/2800#issuecomment-2731100953
- name: Remove image-bundled Chrome
run: sudo apt-get purge google-chrome-stable
- name: Setup stable Chrome
uses: browser-actions/setup-chrome@v1
with:
chrome-version: 128
install-chromedriver: true
install-dependencies: true

# Initialize the DB
- name: 'Setup Test DB'
Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
- Fixed bar chart click function in the Usage dashboard (GitHub issue #3443)
- Fixed broken link for the V1 API documentation.
- Fix `hidden_field_tag` Nested Attributes Format For Rails 7 Upgrade and Add Test Coverage [#3479](https://github.com/DMPRoadmap/roadmap/pull/3479)

- Lower PostgreSQL GitHub Action Chrome Version to Address Breaking Changes Between Latest Chrome Version (134) and `/features` Tests [#3491](https://github.com/DMPRoadmap/roadmap/pull/3491)

**Note this upgrade is mainly a migration from Bootstrap 3 to Bootstrap 5.**

Expand Down
71 changes: 40 additions & 31 deletions spec/features/modal_search_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,28 +23,7 @@
end

it 'Modal search opens and closes and allows user to search, select and remove items', :js do
# Open the modal
click_button 'Add a repository'
expect(page).to have_text('Repository search')

within('#modal-search-repositories') do
# Search for the Repository
fill_in 'research_output_search_term', with: @model.name
click_button 'Apply filter(s)'
expect(page).to have_text(@model.description)
# Select the repository and make sure it no longer appears in the search results
click_link 'Select'
expect(page).not_to have_text(@model.description)

# Using JS to click on button, as click_button '.modal-header button.btn-close' did not work.
modal_close_button = find('.modal-header button.btn-close')
# Close the modal
execute_script('arguments[0].click();', modal_close_button)
end

# Verify that the selection was added to the main page's dom
expect(page).not_to have_text('Repository search')
expect(page).to have_text(@model.description)
perform_modal_actions
# Verify that we can remove the selection
click_link 'Remove'
expect(page).not_to have_text(@model.description)
Expand All @@ -55,15 +34,7 @@
fill_in 'Title', with: 'Test Output'
select 'Audiovisual', from: 'research_output_output_type'

# Open the modal and select repository
click_button 'Add a repository'
within('#modal-search-repositories') do
fill_in 'research_output_search_term', with: @model.name
click_button 'Apply filter(s)'
click_link 'Select'
# (execute_script('arguments[0].click();', modal_close_button) works locally here, but not as GitHub Action)
find('[data-bs-dismiss="modal"]').click
end
perform_modal_actions

click_button 'Save'

Expand All @@ -80,4 +51,42 @@
expect(research_output.repositories).to include(@model)
expect(research_output.plan).to eq(@plan)
end

private

# handles opening + closing of the modal, as well as the actions performed within the modal
def perform_modal_actions
open_modal

within('#modal-search-repositories') do
search_and_select_repository_within_modal
close_modal
end
# Verify that the selection was added to the main page's dom
expect(page).not_to have_text('Repository search')
expect(page).to have_text(@model.description)
end

def open_modal
# Open the modal
click_button 'Add a repository'
expect(page).to have_text('Repository search')
end

def search_and_select_repository_within_modal
# Search for the Repository
fill_in 'research_output_search_term', with: @model.name
click_button 'Apply filter(s)'
expect(page).to have_text(@model.description)
# Select the repository and make sure it no longer appears in the search results
click_link 'Select'
expect(page).not_to have_text(@model.description)
end

def close_modal
# Using JS to click on button, as click_button '.modal-header button.btn-close' did not work.
modal_close_button = find('.modal-header button.btn-close')
# Close the modal
execute_script('arguments[0].click();', modal_close_button)
end
end
0