-
Notifications
You must be signed in to change notification settings - Fork 370
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
Conversation
@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 |
cy.findByText(linode.label) | ||
.should('be.visible') | ||
.parent() | ||
.parent() | ||
.parent() |
There was a problem hiding this comment.
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]')
964e1ab
to
90e5975
Compare
Description 📝
Add Cypress tests for Linode landing page "Summary View" button
Major Changes 🔄
How to test 🧪
yarn cy:run -s "cypress/e2e/core/linodes/smoke-linode-landing-table.spec.ts"