-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(react): add playwright to e2eTestRunner option (#18200)
- Loading branch information
Showing
12 changed files
with
138 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 0 additions & 28 deletions
28
packages/react/src/generators/application/lib/add-cypress.ts
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
import type { GeneratorCallback, Tree } from '@nx/devkit'; | ||
import { | ||
addProjectConfiguration, | ||
ensurePackage, | ||
getPackageManagerCommand, | ||
joinPathFragments, | ||
readProjectConfiguration, | ||
} from '@nx/devkit'; | ||
import { webStaticServeGenerator } from '@nx/web'; | ||
|
||
import { nxVersion } from '../../../utils/versions'; | ||
import { NormalizedSchema } from '../schema'; | ||
|
||
export async function addE2e( | ||
tree: Tree, | ||
options: NormalizedSchema | ||
): Promise<GeneratorCallback> { | ||
switch (options.e2eTestRunner) { | ||
case 'cypress': | ||
webStaticServeGenerator(tree, { | ||
buildTarget: `${options.projectName}:build`, | ||
targetName: 'serve-static', | ||
}); | ||
|
||
const { cypressProjectGenerator } = ensurePackage< | ||
typeof import('@nx/cypress') | ||
>('@nx/cypress', nxVersion); | ||
|
||
return await cypressProjectGenerator(tree, { | ||
...options, | ||
name: options.e2eProjectName, | ||
directory: options.directory, | ||
project: options.projectName, | ||
bundler: options.bundler === 'rspack' ? 'webpack' : options.bundler, | ||
skipFormat: true, | ||
}); | ||
case 'playwright': | ||
const { configurationGenerator } = ensurePackage< | ||
typeof import('@nx/playwright') | ||
>('@nx/playwright', nxVersion); | ||
addProjectConfiguration(tree, options.e2eProjectName, { | ||
root: options.e2eProjectRoot, | ||
sourceRoot: joinPathFragments(options.e2eProjectRoot, 'src'), | ||
targets: {}, | ||
implicitDependencies: [options.projectName], | ||
}); | ||
return configurationGenerator(tree, { | ||
project: options.e2eProjectName, | ||
skipFormat: true, | ||
skipPackageJson: options.skipPackageJson, | ||
directory: 'src', | ||
js: false, | ||
linter: options.linter, | ||
setParserOptionsProject: options.setParserOptionsProject, | ||
webServerCommand: `${getPackageManagerCommand().exec} nx serve ${ | ||
options.name | ||
}`, | ||
}); | ||
case 'none': | ||
default: | ||
return () => {}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24b1ab5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
nx-dev – ./
nx-dev-git-master-nrwl.vercel.app
nx-dev-nrwl.vercel.app
nx-five.vercel.app
nx.dev