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): add playwright generator to convert from executors to plugin #22784

Merged
merged 11 commits into from
Apr 24, 2024

Conversation

Coly010
Copy link
Contributor

@Coly010 Coly010 commented Apr 11, 2024

Current Behavior

The only way to migrate a project from playwright executor usage to playwright plugin usage is to do so manually.

Expected Behavior

Add a generator that will convert projects from playwright executor usage to playwright plugin usage

Usage

nx g @nx/playwright:convert-to-inferred --project="myapp-e2e" // Convert only myapp-e2e from executor to plugin usage
nx g @nx/playwright:convert-to-inferred // Migrate all projects

Related Issue(s)

Fixes #

@Coly010 Coly010 requested a review from a team as a code owner April 11, 2024 18:57
Copy link

vercel bot commented Apr 11, 2024

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

1 Ignored Deployment
Name Status Preview Updated (UTC)
nx-dev ⬜️ Ignored (Inspect) Visit Preview Apr 24, 2024 9:29am

@Coly010 Coly010 marked this pull request as draft April 11, 2024 18:57
@Coly010 Coly010 changed the title wip feat(testing): playwright migration from executors to plugin Apr 11, 2024
@Coly010 Coly010 force-pushed the playwright/crystal-migration branch from 46fe18e to 4f03836 Compare April 12, 2024 12:57
@Coly010 Coly010 force-pushed the playwright/crystal-migration branch from 3a6fb21 to cf01c5b Compare April 16, 2024 10:56
@Coly010 Coly010 marked this pull request as ready for review April 16, 2024 10:57
@Coly010 Coly010 requested review from a team as code owners April 16, 2024 10:57
@Coly010 Coly010 requested review from jaysoo, AgentEnder and a team as code owners April 16, 2024 16:33
@Coly010 Coly010 changed the title feat(testing): playwright migration from executors to plugin feat(testing): add playwright generator to convert from executors to plugin Apr 16, 2024
@Coly010 Coly010 force-pushed the playwright/crystal-migration branch from 1560703 to 04b04de Compare April 17, 2024 09:44
@Coly010 Coly010 force-pushed the playwright/crystal-migration branch from 8bc2fd1 to 7760f69 Compare April 24, 2024 09:27
Comment on lines 19 to 29
const migrator = new ExecutorToPluginMigrator<PlaywrightPluginOptions>(
tree,
projectGraph,
'@nx/playwright:playwright',
'@nx/playwright/plugin',
(targetName) => ({ targetName, ciTargetName: 'e2e-ci' }),
postTargetTransformer,
createNodes,
options.project
);
await migrator.run();
Copy link
Collaborator

Choose a reason for hiding this comment

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

Export a function that does this.

return createdTarget;
}

async #getCreateNodesResults() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Use

projConfigs = await retrieveProjectConfigurations(

@FrozenPandaz FrozenPandaz merged commit 25eeddc into nrwl:master Apr 24, 2024
6 checks passed
@Coly010 Coly010 deleted the playwright/crystal-migration branch April 24, 2024 13:36
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

3 participants