Skip to content
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

Fix spec tests for table actions #5012

Merged
merged 11 commits into from
Jan 7, 2025
Merged

Conversation

martha
Copy link
Contributor

@martha martha commented Dec 18, 2024

Merging this PR

  • use the squash-merge strategy for PRs targeting a release-X branch

Description

GH issues: https://github.com/open-path/Green-River/issues/6761, https://github.com/open-path/Green-River/issues/6825
Replaces #4983

Several tables are adopting the new table actions convention, so this PR updates the spec tests so they can find the new actions.

Type of change

Spec test update

Checklist before requesting review

  • I have performed a self-review of my code
  • I have run the code that is being changed under ideal conditions, and it doesn't fail
  • [n/a] If adding a new endpoint / exposing data in a new way, I have:
    • [n/a] ensured the API can't leak data from other data sources
    • [n/a] ensured this does not introduce N+1s
    • [n/a] ensured permissions and visibility checks are performed in the right places
  • [n/a] I have updated the documentation (or not applicable)
  • I have added spec tests (or not applicable)
  • I have provided testing instructions in this PR or the related issue (or not applicable)

@martha martha requested a review from gigxz December 18, 2024 19:06
@eanders eanders changed the base branch from release-145 to release-146 January 2, 2025 14:01
@martha martha changed the base branch from release-146 to release-147 January 2, 2025 18:10
@@ -52,25 +52,25 @@
find('input[type="checkbox"][aria-label="select all"]', visible: :all).trigger(:click)

expect do
click_button 'Enroll (3) + Assign (3)'
find('button', text: 'Enroll (3) + Assign (3)').trigger(:click)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@martha I'm wondering about this change, were you seeing failures?
We had previously needed this workaround for failed clicks, but I thought we fixed it with #4735.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gigxz yes, I thought I saw a failure with this locally, but let me poke it a little more...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good. Something I will do if I want to be certain about new system test is to run it repeatedly on CI by adding to the below line:

RUN_SYSTEM_TESTS=true RAILS_ENV=test CAPYBARA_APP_HOST="http://$HOSTNAME:5173" rspec drivers/hmis/spec/system/hmis/*

RUN_SYSTEM_TESTS=true RAILS_ENV=test CAPYBARA_APP_HOST="http://$HOSTNAME:5173" rspec drivers/hmis/spec/system/hmis/my_test.rb
RUN_SYSTEM_TESTS=true RAILS_ENV=test CAPYBARA_APP_HOST="http://$HOSTNAME:5173" rspec drivers/hmis/spec/system/hmis/my_test.rb
RUN_SYSTEM_TESTS=true RAILS_ENV=test CAPYBARA_APP_HOST="http://$HOSTNAME:5173" rspec drivers/hmis/spec/system/hmis/my_test.rb
RUN_SYSTEM_TESTS=true RAILS_ENV=test CAPYBARA_APP_HOST="http://$HOSTNAME:5173" rspec drivers/hmis/spec/system/hmis/my_test.rb
etc...

temporarily of course :)

@@ -74,7 +74,7 @@ def complete_individual_assessment
expect(e2.intake_assessment).to be_nil

fill_in 'Search Clients', with: c1.last_name
click_link c1.brief_name
find('a', text: 'View Enrollment', match: :first).trigger(:click)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We lose some fidelity here -- previously we knew we were clicking on the row for c1 (or at least, a client with their name), and now we're just clicking on the first row. Can we use the aria-label here, so we know who we're clicking on?

Copy link
Contributor

@gigxz gigxz Jan 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like we have enable_aria_label enabled so you may be able to just look for the text of the aria label directly to find the button, like click_button "View Enrollment, {c1.brief_name}" (untested)

@martha martha changed the base branch from release-147 to deploy/6761-table-actions January 6, 2025 21:56
@martha martha merged commit c14a4f4 into deploy/6761-table-actions Jan 7, 2025
51 checks passed
@martha martha deleted the martha/6761-tables branch January 7, 2025 13:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants