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

[React - Vue] - Migrate E2E Tests from Cypress to Playwright #335

Merged
merged 41 commits into from
Aug 27, 2024

Conversation

noriega2112
Copy link
Contributor

@noriega2112 noriega2112 commented Aug 9, 2024

What this does

Switches the E2E testing libraries from Cypress to Playwright for the React and Vue sides

Checklist

  • Switch to playwright on React Side
  • Switch to playwright on Vue Side
  • Switch E2E GH workflow

How to test

Add user steps to achieve desired functionality for this feature.

The test data creation script has been updated to use the `PLAYWRIGHT_TEST_USER_PASS` environment variable instead of `CYPRESS_TEST_USER_PASS` for the password of the Playwright E2E test user.
This commit adds e2e tests for the home page and sign up functionality in the React web client. The tests ensure that the welcome text, login button, and signup button are visible on the home page. Additionally, the tests cover the sign-up workflow, including filling in the required fields and submitting the form. This enhances the test coverage and helps ensure the proper functioning of these critical features.
@oudeismetis oudeismetis temporarily deployed to tn-spa-bootstrapper-pr-335 August 9, 2024 19:17 Inactive
@oudeismetis oudeismetis temporarily deployed to tn-spa-bootstrapper-pr-335 August 9, 2024 19:19 Inactive
…riable for Playwright E2E test user password
@oudeismetis oudeismetis temporarily deployed to tn-spa-bootstrapper-pr-335 August 9, 2024 19:22 Inactive
@oudeismetis oudeismetis temporarily deployed to tn-spa-bootstrapper-pr-335 August 9, 2024 19:31 Inactive
@oudeismetis oudeismetis temporarily deployed to tn-spa-bootstrapper-pr-335 August 9, 2024 19:40 Inactive
…de@v4

This commit updates the e2e.yml workflow file to use the latest versions of the actions/checkout and actions/setup-node actions. It also adds a custom name and path for the checkout action, and sets the node version to 18 for the setup-node action. These updates ensure that the e2e workflow is using the most up-to-date dependencies and configurations.
@oudeismetis oudeismetis temporarily deployed to tn-spa-bootstrapper-pr-335 August 9, 2024 20:00 Inactive
…de@v4

This commit updates the e2e.yml workflow file to use the latest versions of the actions/checkout and actions/setup-node actions. It also adds a custom name and path for the checkout action, and sets the node version to 18 for the setup-node action. These updates ensure that the e2e workflow is using the most up-to-date dependencies and configurations.
@oudeismetis oudeismetis temporarily deployed to tn-spa-bootstrapper-pr-335 August 9, 2024 20:13 Inactive
@oudeismetis oudeismetis temporarily deployed to tn-spa-bootstrapper-pr-335 August 9, 2024 20:16 Inactive
@oudeismetis oudeismetis temporarily deployed to tn-spa-bootstrapper-pr-335 August 9, 2024 20:28 Inactive
@oudeismetis oudeismetis temporarily deployed to tn-spa-bootstrapper-pr-335 August 9, 2024 20:30 Inactive
@oudeismetis oudeismetis temporarily deployed to tn-spa-bootstrapper-pr-335 August 9, 2024 20:40 Inactive
@oudeismetis oudeismetis temporarily deployed to tn-spa-bootstrapper-pr-335 August 9, 2024 20:43 Inactive
@oudeismetis oudeismetis temporarily deployed to tn-spa-bootstrapper-pr-335 August 9, 2024 20:49 Inactive
@oudeismetis oudeismetis temporarily deployed to tn-spa-bootstrapper-pr-335 August 9, 2024 20:52 Inactive
@oudeismetis oudeismetis temporarily deployed to tn-spa-bootstrapper-pr-335 August 15, 2024 18:42 Inactive
@oudeismetis oudeismetis temporarily deployed to tn-spa-bootstrapper-pr-335 August 16, 2024 17:36 Inactive
@oudeismetis oudeismetis temporarily deployed to tn-spa-bootstrapper-pr-335 August 16, 2024 17:40 Inactive
@noriega2112 noriega2112 temporarily deployed to tn-spa-bootstrapper-pr-335 August 20, 2024 14:55 Inactive
@noriega2112 noriega2112 temporarily deployed to tn-spa-bootstrapper-pr-335 August 20, 2024 17:27 Inactive
@noriega2112 noriega2112 temporarily deployed to tn-spa-bootstrapper-pr-335 August 20, 2024 19:49 Inactive
@noriega2112 noriega2112 temporarily deployed to tn-spa-bootstrapper-pr-335 August 21, 2024 21:38 Inactive
@oudeismetis oudeismetis temporarily deployed to tn-spa-bootstrapper-pr-335 August 21, 2024 21:40 Inactive
@oudeismetis oudeismetis temporarily deployed to tn-spa-bootstrapper-pr-335 August 21, 2024 23:03 Inactive
@oudeismetis oudeismetis temporarily deployed to tn-spa-bootstrapper-pr-335 August 21, 2024 23:07 Inactive
@noriega2112 noriega2112 marked this pull request as ready for review August 21, 2024 23:27
@noriega2112 noriega2112 changed the title React - Migrate E2E Tests from Cypress to Playwright [React - Vue] - Migrate E2E Tests from Cypress to Playwright Aug 21, 2024
Copy link
Member

@whusterj whusterj left a comment

Choose a reason for hiding this comment

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

The code looks good, but the Chrome and Firefox e2e tests have not passed yet:

image

Once these are passing and the conflict with main is resolved, this should be good to go!

await page.getByTestId('last-name').fill('e2e test')
await page
.getByTestId('email')
.fill(`playwright${Math.floor(Math.random() * 1000)}@thinknimble.com`)
Copy link
Member

Choose a reason for hiding this comment

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

I suggest using a UUID or a larger number here to greatly reduce the chance of a collision.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah you are right, I replaced it for a timestamp instead as its value is unique

Copy link
Member

Choose a reason for hiding this comment

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

There is still a chance of collision when browser tests are run in parallel, but that should be very unlikely, so this is a lot better. Thanks!

@noriega2112 noriega2112 temporarily deployed to tn-spa-bootstrapper-pr-335 August 27, 2024 03:50 Inactive
@noriega2112
Copy link
Contributor Author

The code looks good, but the Chrome and Firefox e2e tests have not passed yet:

image Once these are passing and the conflict with `main` is resolved, this should be good to go!

@whusterj These checks shouldn't be showing as they were part of the cypress.yml github action that was before, I think they are still showing as they were required prior to opening the PR.

Now this is being handled on the playwright config file which makes the tests to run on the 3 major browsers.

@whusterj
Copy link
Member

@whusterj These checks shouldn't be showing as they were part of the cypress.yml github action that was before, I think they are still showing as they were required prior to opening the PR.

Now this is being handled on the playwright config file which makes the tests to run on the 3 major browsers.

I see - that makes sense! They should disappear after we merge.

Copy link
Member

@whusterj whusterj left a comment

Choose a reason for hiding this comment

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

Looks good to go!

@lakardion lakardion merged commit e145468 into main Aug 27, 2024
17 of 18 checks passed
@lakardion lakardion deleted the feature/issue-330-react branch August 27, 2024 14:48
whusterj added a commit that referenced this pull request Aug 28, 2024
Following up on #335 and issue #330 - this removes all references to Cypress. Apps incorporating these changes will need to update their environment variables and repository secrets accordingly.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Migrate E2E Tests from Cypress to Playwright
4 participants