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-8319] - Add CM Logout test #10733

Merged
merged 3 commits into from
Aug 1, 2024
Merged

Conversation

AzureLatte
Copy link
Contributor

@AzureLatte AzureLatte commented Jul 31, 2024

Description 📝

Create a Cloud Manager end-to-end test which tests the Cloud Manager logout flow. This will confirm that Cloud Manager log out functionality works as expected and implicitly confirm that the login application is up, which is useful from a synthetic testing perspective.

Changes 🔄

  • Add a new test to confirm flow when logout.
  • Add a new util function in packages/manager/cypress/support/intercepts/account.ts

How to test 🧪

yarn cy:run -s "cypress/e2e/core/account/account-logout.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 Jul 31, 2024
@AzureLatte AzureLatte requested a review from a team as a code owner July 31, 2024 14:35
@AzureLatte AzureLatte requested review from jdamore-linode and removed request for a team July 31, 2024 14:35
@AzureLatte AzureLatte requested a review from a team as a code owner July 31, 2024 14:37
@AzureLatte AzureLatte requested review from hana-linode and jaalah-akamai and removed request for a team July 31, 2024 14:37
Copy link

Coverage Report:
Base Coverage: 82.36%
Current Coverage: 82.36%

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 couple little suggestions, but the one about the URL assertion is the only one that matters that much -- approved pending that!

Comment on lines 20 to 24
cy.findByTestId('nav-group-profile').click();
cy.findByTestId('menu-item-Log Out')
.should('be.visible')
.should('be.enabled')
.click();
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: we could make this a little more idiomatic using the userMenu and userMenuButton UI helpers

Suggested change
cy.findByTestId('nav-group-profile').click();
cy.findByTestId('menu-item-Log Out')
.should('be.visible')
.should('be.enabled')
.click();
ui.userMenuButton
.find()
.click();
ui.userMenu
.find()
.should('be.visible')
.within(() => {
cy.findByText('Log Out').should('be.visible').click();
});

Comment on lines 28 to 29
cy.visit('/login');
cy.url().should('endWith', `/login`);
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.visit('/login');
cy.url().should('endWith', `/login`);
cy.visit('/');
cy.url().should('startWith', `${LOGIN_ROOT}/login`);

Otherwise the URL assertion will immediately pass without waiting for Cloud to actually redirect to the Login application since both pages end with /login

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated, thank you!

@jaalah-akamai jaalah-akamai added Testing Approved Multiple approvals and ready to merge! and removed Ready for Review labels Jul 31, 2024
@AzureLatte
Copy link
Contributor Author

Volumn failure has been fixed in #10728

@AzureLatte AzureLatte merged commit 4a405c5 into linode:develop Aug 1, 2024
17 of 19 checks passed
@AzureLatte AzureLatte deleted the M3-8319 branch August 1, 2024 13:10
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! Testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants