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

feat(testing): make playwright default e2e test runner option #22511

Merged
merged 1 commit into from
Apr 23, 2024

Conversation

Coly010
Copy link
Contributor

@Coly010 Coly010 commented Mar 26, 2024

Current Behavior

Cypress is set as the default e2e test runner

Expected Behavior

Playwright is set as the default e2e test runner

Related Issue(s)

Fixes #

@Coly010 Coly010 self-assigned this Mar 26, 2024
@Coly010 Coly010 requested review from AgentEnder and a team as code owners March 26, 2024 11:19
Copy link

vercel bot commented Mar 26, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
nx-dev ✅ Ready (Inspect) Visit Preview Apr 23, 2024 2:33pm

@leosvelperez
Copy link
Member

@Coly010 I guess we should also default to the Playwright choice in the CNW prompt, isn't it?

@Coly010 Coly010 requested review from a team and vsavkin as code owners April 5, 2024 13:02
@Coly010 Coly010 requested a review from JamesHenry as a code owner April 5, 2024 13:02
@Coly010 Coly010 added the target: next major version To be merged for the next major version release label Apr 5, 2024
Copy link
Member

@AgentEnder AgentEnder left a comment

Choose a reason for hiding this comment

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

Do you think it would be worth adding a migration for current workspaces that already contain a cypress project that sets cypress as the default for the various generators inside nx.json#generators?

As is, I could see folks being upset if they have a repo with 5+ e2e apps using cypress, and suddenly this swaps to playwright.

@Coly010
Copy link
Contributor Author

Coly010 commented Apr 15, 2024

@AgentEnder Those generatorDefaults should be set already when they chose cypress as their e2e tool though right?

I'm not sure what the "right" thing to do here would be because I can see people also wanting to actually use playwright but might have legacy cypress projects.

I think it could be a case of having some kind of note in release notes, or wait and see the verdict from people after the change has been made.

@@ -43,7 +43,7 @@ describe('React Module Federation', () => {
const defaultRemotePort = 4201;

runCLI(
`generate @nx/react:host ${shell} --remotes=${remote1},${remote2},${remote3} --style=css --no-interactive --skipFormat --js=${js}`
`generate @nx/react:host ${shell} --remotes=${remote1},${remote2},${remote3} --e2eTestRunner=cypress --style=css --no-interactive --skipFormat --js=${js}`
Copy link
Collaborator

Choose a reason for hiding this comment

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

How come these tests use cypress? Are there playwright ones elsewhere? Should these be playwright?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

They perform specific setup of .cy.ts files, it felt wrong to change and not have covered.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There may need to be new e2e tests written specifically for playwright, i'll double check which are missing and address in follow up

@@ -68,6 +68,7 @@ export async function addE2e(host: Tree, options: NormalizedSchema) {
root: options.e2eProjectRoot,
sourceRoot: joinPathFragments(options.e2eProjectRoot, 'src'),
targets: {},
tags: [],
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why was this added? Can you fix this in a follow up PR please?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It was failing without it. I can check again

@Coly010 Coly010 merged commit 739e2e7 into nrwl:master Apr 23, 2024
6 checks passed
@Coly010 Coly010 deleted the make-playwright-default branch April 23, 2024 15:30
Copy link

github-actions bot commented May 1, 2024

This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants