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

test: [M3-6609] - Add Linode details page assertion for LISH via SSH Info #10513

Merged
merged 8 commits into from
May 28, 2024

Conversation

AzureLatte
Copy link
Contributor

@AzureLatte AzureLatte commented May 23, 2024

Description 📝

Add Cypress assertions to confirm that the information displayed in the "LISH Console via SSH" section on Linode details pages is correct.

Changes 🔄

List any change relevant to the reviewer.

  • Clean up cy.intercept with intercept utils in linodes.ts
  • Add assertions to check the information displayed in the "LISH Console via SSH" section on Linode details pages is correct.

How to test 🧪

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

As an Author I have considered 🤔

Check all that apply

  • 👀 Doing a self review
  • ❔ Our contribution guidelines
  • 🤏 Splitting feature into small PRs
  • ➕ Adding a changeset
  • 🧪 Providing/Improving test coverage
  • 🔐 Removing all sensitive information from the code and PR description
  • 🚩 Using a feature flag to protect the release
  • 👣 Providing comprehensive reproduction steps
  • 📑 Providing or updating our documentation
  • 🕛 Scheduling a pair reviewing session
  • 📱 Providing mobile support
  • ♿ Providing accessibility support

@AzureLatte AzureLatte self-assigned this May 23, 2024
@AzureLatte AzureLatte requested a review from a team as a code owner May 23, 2024 19:36
@AzureLatte AzureLatte requested review from cliu-akamai and removed request for a team May 23, 2024 19:36
@AzureLatte AzureLatte requested a review from a team as a code owner May 23, 2024 19:36
@AzureLatte AzureLatte requested review from dwiley-akamai and hkhalil-akamai and removed request for a team May 23, 2024 19:36
@AzureLatte
Copy link
Contributor Author

Checking conflicts now. Will move to "ready for review" after conflicts resolved

Copy link

github-actions bot commented May 23, 2024

Coverage Report:
Base Coverage: 81.73%
Current Coverage: 81.73%

Copy link
Contributor

@dwiley-akamai dwiley-akamai left a comment

Choose a reason for hiding this comment

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

create-linode.spec.ts passes ✅
Code review ✅

Copy link
Contributor

@jdamore-linode jdamore-linode left a comment

Choose a reason for hiding this comment

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

Looks great @AzureLatte, posted a small suggestion but it's not a big deal! This addition looks really good as-is 👍

Comment on lines 134 to 143
cy.contains('LISH Console via SSH')
.should('be.visible')
.next() // Navigate to the next element which should be the value
.invoke('text') // Get the text of the next element
.then((text) => {
// Example assertion (ssh -t <Linode account username>@lish-<Linode region>.linode.com <Linode label>)
expect(text).equal(
`ssh -t ${username}@lish-${linodeRegion.id}.linode.com ${linodeLabel}`
);
});
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
cy.contains('LISH Console via SSH')
.should('be.visible')
.next() // Navigate to the next element which should be the value
.invoke('text') // Get the text of the next element
.then((text) => {
// Example assertion (ssh -t <Linode account username>@lish-<Linode region>.linode.com <Linode label>)
expect(text).equal(
`ssh -t ${username}@lish-${linodeRegion.id}.linode.com ${linodeLabel}`
);
});
cy.contains('LISH Console via SSH')
.should('be.visible')
.closest('tr')
.within(() => {
cy.contains(`ssh -t ${username}@lish-${linodeRegion.id}.linode.com ${linodeLabel}`).should('be.visible');
});

Very minor suggestion: here's a slightly more straightforward way to assert the SSH command is shown, with two minor benefits: it's slightly less dependent on the DOM structure, and it confirms that the SSH command is visible in addition to being present in the DOM

@AzureLatte AzureLatte merged commit b6c4094 into linode:develop May 28, 2024
18 checks passed
@AzureLatte AzureLatte deleted the M3-6609 branch May 28, 2024 13:10
@AzureLatte AzureLatte added e2e Indicates that a PR touches Cypress tests in some way and removed Ready for Review labels May 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
e2e Indicates that a PR touches Cypress tests in some way
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants