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

LF-4371a Fix Cypress tests #3545

Merged
merged 4 commits into from
Nov 25, 2024
Merged

Conversation

kathyavini
Copy link
Collaborator

@kathyavini kathyavini commented Nov 22, 2024

Description

This was extremely annoying!

The only issue with the Cypress tests was that the non-specific selectors, e.g. cy.get(Selectors.RADIO).first() or cy.get(Selectors.REACT_SELECT) were also now returning the off-screen elements included in the closed sideDrawer form.

Filtering on ':visible' should have worked in theory (and did for the React Select), but two of the Radios stopped returning the visible radios once the off-screen radios were found (??!) I.e. cy.get() used to return the on-screen radios, but now returned only the off-screen ones before the on-screen ones were even rendered. And a third cy.get(Selectors.RADIO) did return all four elements, but none of them were marked as visible 🤷

In fixing the radio selectors, I accidentally changed one selected value, causing an inscrutable missing element in a different test file, which wanted a termination task instead of a harvest task, although that was not clear from the error message. After fixing that, the tests have passed on CI.

Jira link: none

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

  • Passes test case
  • UI components visually reviewed on desktop view
  • UI components visually reviewed on mobile view
  • Other (please explain)

Ran Cypress locally + in CI on GitHub actions. The wait for the googlemapsAPI call seems to only work in CI now.

Checklist:

  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • The precommit and linting ran successfully
  • I have added or updated language tags for text that's part of the UI
  • I have added "MISSING" for all new language tags to languages I don't speak
  • I have added the GNU General Public License to all new files

Apparently this radio is not considered visible by Cypress? I think that is also the reason for the 'force' when interacting with this radio
Tracking down the source of the error in the following test file due to this was so annoying
@kathyavini kathyavini added the bug Something isn't working label Nov 22, 2024
@kathyavini kathyavini self-assigned this Nov 22, 2024
@kathyavini kathyavini requested review from a team as code owners November 22, 2024 19:35
@kathyavini kathyavini requested review from antsgar and SayakaOno and removed request for a team November 22, 2024 19:35
Copy link
Collaborator

@antsgar antsgar left a comment

Choose a reason for hiding this comment

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

I can feel your pain reading the PR description 😂 glad you were able to solve it but this seems really annoying!

Copy link
Collaborator

@SayakaOno SayakaOno left a comment

Choose a reason for hiding this comment

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

Worked for me too!!!

@SayakaOno SayakaOno added this pull request to the merge queue Nov 25, 2024
Merged via the queue into integration with commit 8dade36 Nov 25, 2024
5 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants