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

M3-6614 Add Cypress tests for Linode landing page 'Summary View' #9477

Merged
merged 2 commits into from
Aug 8, 2023

Conversation

cliu-akamai
Copy link
Contributor

Description 📝

Add Cypress tests for Linode landing page "Summary View" button

Major Changes 🔄

  • Add test to verify "Summary View" button works as expected.

How to test 🧪

yarn cy:run -s "cypress/e2e/core/linodes/smoke-linode-landing-table.spec.ts"

@bnussman-akamai bnussman-akamai added Add'tl Approval Needed Waiting on another approval! and removed Ready for Review labels Aug 1, 2023
@bnussman-akamai bnussman-akamai added Approved Multiple approvals and ready to merge! and removed Add'tl Approval Needed Waiting on another approval! labels Aug 1, 2023
@jdamore-linode
Copy link
Contributor

@cliu-akamai I'm hoping to take a look at this before you merge if you wouldn't mind waiting, I've been held up by region testing but am hoping to look at this today

Comment on lines 364 to 368
cy.findByText(linode.label)
.should('be.visible')
.parent()
.parent()
.parent()
Copy link
Contributor

Choose a reason for hiding this comment

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

I think in this case adding a data-qa attribute would be better: it's difficult to tell which element is being selected here, and it's a little bit fragile to changes that could be made to the component.

Instead, I'd add the following data attribute to the component in src/features/Linodes/LinodesLanding/CardView.tsx ln 92:

// Currently: <Grid className={`${classes.summaryOuter} py0`} xs={12}>
<Grid className={`${classes.summaryOuter} py0`} xs={12} data-qa-linode-card={linode.id}>

Then, in the test, you can select the card like this:

cy.findByText(linode.label)
  .should('be.visible')
  .closest('[data-qa-linode-card]')

@cliu-akamai cliu-akamai merged commit c690dc3 into linode:develop Aug 8, 2023
@cliu-akamai cliu-akamai deleted the feature/M3-6614 branch August 8, 2023 17:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Approved Multiple approvals and ready to merge! Missing Changeset
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants