Angular Schematic custom projectPath ignored #26402
Labels
E2E
Issue related to end-to-end testing
npm: @cypress/schematic
@cypress/schematic package issues
Triaged
Issue has been routed to backlog. This is not a commitment to have it prioritized by the team.
Current behavior
I have an Angular project. The
package.json
file is on the root level, but the actual Angular app is in a subfolderweb
. I'm trying to migrate from Protractor to Cypress using the cypress schematics.The issue is this: I can't seem to get Cypress to use the
web
subfolder to look for its files. I'm settingprojectPath
(https://github.com/cypress-io/cypress/blob/develop/npm/cypress-schematic/src/builders/cypress/cypressBuilderOptions.ts#L17) to the absolute path of myweb
folder (as a test) but this line here always overrides thatprojectPath
with the root path of the project: https://github.com/cypress-io/cypress/blob/develop/npm/cypress-schematic/src/builders/cypress/index.ts#L44I might simply be doing something wrong, but I can't seem to figure out how to tell Cypress to use the subfolder instead of the root folder.
This the
e2e
entry in my angular.json:Desired behavior
Cypress should respect the relative or absolute
projectPath
I set in angular.json.Test code to reproduce
You can find the forked test project here: https://github.com/jfahrenkrug/cypress-angular-test-tiny
It includes basically a vanilla Angular 15 app. Cypress was added by running
npx ng add @cypress/schematic
. Notice how the actual Angular app and the cypress folder live in a subfolder calledweb
. In angular.json, thee2e
section looks like this:Notice howe
projectPath
is set toweb
. But when runningnpm run e2e
, you get this error screen:As you can see, it's looking in
cypress/support/e2e
, NOT inweb/cypress/support/e2e
.Cypress Version
12.9.0
Node version
v16.18.0
Operating System
macOS 13.2.1
Debug Logs
No response
Other
No response
The text was updated successfully, but these errors were encountered: