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

Refactor the Existing Cypress Auth Test #9015

Open
nihal467 opened this issue Nov 6, 2024 · 1 comment · May be fixed by #9024
Open

Refactor the Existing Cypress Auth Test #9015

nihal467 opened this issue Nov 6, 2024 · 1 comment · May be fixed by #9024
Assignees

Comments

@nihal467
Copy link
Member

nihal467 commented Nov 6, 2024

Description

Refactor all the existing auth test in the platform to POM approach and use the reusable components

Task - Part 1

Rename and Merge Files:

Refactor to POM

  • Import and reuse login credentials from the LoginPage.ts file. If the credentials are not present, add new ones to the LoginPage file as well, and replace any direct usage of cy.loginbyapi with calls to LoginPage.
  • Add API verification with cy.intercept before clicking #user-profile-name to ensure the page is fully loaded.
  • Convert lines 9 and 10 to POM and create functions for them in the UserProfilePage.ts file.
  • Similarly, convert all code from lines 15 to 21 to the POM approach, adding cy.intercept for verification and moving credentials to LoginPage if they are missing.
  • Use the reusable helper functions in the commands.ts file for the submit button , notification verification, etc... common functions
  • Remove the hardcoded wait, and if necessary, replace it with cy.intercept() API verification to avoid flaky tests.

Image

Task - 2

Image

  • Combine all the tests into one single test
  • Test Follow: Click on forgot password -> Send password reset link -> Go back to the login page
  • Follow all the similar approaches for writing code mentioned in the test - 1
@JavidSumra
Copy link
Contributor

Can You please Assign this issue to me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Triage
Development

Successfully merging a pull request may close this issue.

2 participants