17 Commits

Author SHA1 Message Date
Colum Ferry
320d9f223f
fix(testing): application generators should accurately configure e2e projects (#27453)
- feat(devkit): add util for determining the e2e web server info
- feat(vite): add util for determining the e2e web server info
- feat(webpack): add util for determining the e2e web server info
- fix(webpack): allow port override
- fix(devkit): e2e web server info util should handle target defaults
- feat(webpack): export the e2e web server info utils
- fix(vite): rename util
- fix(devkit): util should determine the devTarget for cypress
- fix(react): improve accuracy of e2e project generation

<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->
The logic for finding the correct targets and web addresses to use when
setting up e2e projects is flawed and missing some key considerations.


## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
The logic is accurate and usage is simplified across plugins 

Projects:
- [x] Angular
- [x] Expo
- [x] Next
- [x] Nuxt
- [x] Vue
- [x] Web
- [x] Remix
- [x] React
- [x] React Native


## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-08-27 10:00:43 -04:00
Colum Ferry
dfd7241ed5
fix(testing): adding e2e projects should register e2e-ci targetDefaults (#27185)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->



## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-08-07 12:25:32 -04:00
Colum Ferry
1dcfbeeeee
feat(testing): e2e-ci should use serve-static or vite preview for playwright and cypress (#27240)
- fix(vite): preview should dependOn build
- fix(react): playwright should use vite preview
- fix(vue): playwright should use vite preview
- fix(web): playwright should use vite preview
- chore(testing): add e2e test

<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->
Currently, `playwright` uses the `vite serve` command when setting up
the web server to run the e2e tests against.

The `vite preview` command/target should also depend on `vite build`.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
`playwright` should use the `vite preview` command when setting up the
web server

`vite preview` targets add a `dependsOn["build"]`

Ensure `serve-static` has a dependsOn: ['build']

Cypress should use the `ciBaseUrl` if it exists when running the
`e2e-ci` targets

Migrations for Playwright and Cypress to use serve-static and preview
correctly

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-08-02 11:56:07 -04:00
Colum Ferry
7f00927655
fix(testing): app generators should create correct e2e config at generation time (#22565) 2024-04-03 16:51:03 +01:00
Colum Ferry
29c80a33de
fix(web): spa flag should correctly define redirect (#22487) 2024-03-26 16:51:03 +00:00
Colum Ferry
c9c56a2cfd
fix(react): ensure playwright configuration is using correct port in app gen (#21941) 2024-02-23 11:25:54 +00:00
Jason Jean
396ffc4636
feat(core): enable project crystal by default (#21403)
Co-authored-by: Katerina Skroumpelou <sk.katherine@gmail.com>
Co-authored-by: Jack Hsu <jack.hsu@gmail.com>
Co-authored-by: Colum Ferry <cferry09@gmail.com>
Co-authored-by: Leosvel Pérez Espinosa <leosvel.perez.espinosa@gmail.com>
Co-authored-by: Emily Xiong <xiongemi@gmail.com>
Co-authored-by: Nicholas Cunningham <ndcunningham@gmail.com>
2024-02-02 03:40:59 -05:00
Jason Jean
c2be2ade1a
fix(testing): add webServerCommands/ciWebServerCommands option for cy… (#20616) 2023-12-07 16:10:17 -05:00
Katerina Skroumpelou
83db767b27
feat(vite): nodes for build, serve, test, preview targets (#20086) 2023-11-30 15:56:16 -05:00
Jack Hsu
507fe42e4f
feat(webpack): add plugin to automatically configure build and serve targets (#20243) 2023-11-28 13:01:03 -05:00
Jason Jean
78ab39b895
feat(testing): allow cypress preset to execute a command for a web server (#20355) 2023-11-27 13:30:01 -05:00
Emily Xiong
f5f31ab979
fix(testing): add e2e for root project should not add eslintrc.base (#19860) 2023-10-25 16:57:28 -04:00
Jack Hsu
b5ed979b90
feat(misc): remove usages of @nx/cypress:cypress-project internally (#19766) 2023-10-24 21:04:15 -04:00
Miroslav Jonaš
e34219ab96
feat(linter): add flat config support to generators (#18534) 2023-08-23 01:36:58 +02:00
Leosvel Pérez Espinosa
eb9caa1ade
feat(react): use helper to determine project name and root directory in project generators (#18615) 2023-08-18 13:12:23 -04:00
Emily Xiong
107a7536b8
fix(testing): make the default react playwright test to pass (#18559) 2023-08-11 10:37:28 -04:00
Emily Xiong
24b1ab5463
feat(react): add playwright to e2eTestRunner option (#18200) 2023-08-03 17:16:35 +02:00