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

Create e2e folder inside application folder #14250

Closed
1 task
na-ji opened this issue Jan 10, 2023 · 3 comments
Closed
1 task

Create e2e folder inside application folder #14250

na-ji opened this issue Jan 10, 2023 · 3 comments
Labels
outdated scope: testing tools Issues related to Cypress / Jest / Playwright / Vitest support in Nx type: feature

Comments

@na-ji
Copy link

na-ji commented Jan 10, 2023

Description

This is a feature request to be able to put the e2e folder inside the app itself, instead of having a separate app for it. This has already been asked for numerous times: #743, #4812 and even on stackoverflow. A PR was also proposed: #770.
Back then, the official answer, provided by vsavkin, was that it was made like this because NX schematics extended Angular CLI schematics that had this behavior. Starting Angular CLI 8, this behavior is no longer the default and the e2e folder is always created inside an app. So why NX didn't allow the possibility to create the e2e folder inside an application?

Motivation

This behavior will allows reducing the clutter inside the folder listing applications, by reducing the number of application by two.

Suggested Implementation

I don't know how exactly is implemented NX, but providing to the users the possibility to create the e2e folder inside the application itself via a flag would be great.

@FrozenPandaz FrozenPandaz added the scope: testing tools Issues related to Cypress / Jest / Playwright / Vitest support in Nx label Jan 11, 2023
@barbados-clemens
Copy link
Contributor

With the most recent work with standalone and nested projects you should be able to do this now with the directory flag on the cypress-project generator. the directory will be prefixed with what is set as the apps directory by default. so you just need to provide the name of the folder the for the app you wish to test it in and the project name will be the folder name that the project goes in. i.e.
if you have an app located in apps/my-existing-project/
then running

npx nx g @nrwl/cypress:cypress-project e2e --project=my-existing-project --directory=my-existing-project

will produce a cypress project in the apps/my-existing-project/e2e/ folder

if you have an existing project you want to nested, then you can use the @nrwl/workspace:move generator to move it into a subfolder.

@na-ji
Copy link
Author

na-ji commented Jan 15, 2023

Thank you, it wasn't clear for me on how to do that.

@github-actions
Copy link

github-actions bot commented Mar 3, 2023

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated scope: testing tools Issues related to Cypress / Jest / Playwright / Vitest support in Nx type: feature
Projects
None yet
Development

No branches or pull requests

3 participants