generator-jhipster: Cypress tests could not be launched
Overview of the issue
PS D:\temp\jhcypress> npm run e2e
> jhcypress@0.0.1-SNAPSHOT e2e D:\temp\jhcypress
> npm run e2e:cypress
> jhcypress@0.0.1-SNAPSHOT e2e:cypress D:\temp\jhcypress
> cypress run --browser chrome --record ${CYPRESS_ENABLE_RECORD:-false}
You passed the --record flag but this project has not been setup to record.
This project is missing the 'projectId' inside of 'cypress.json'.
We cannot uniquely identify this project without this id.
You need to setup this project to record. This will generate a unique 'projectId'.
Alternatively if you omit the --record flag this project will run without recording.
https://on.cypress.io/recording-project-runs
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! jhcypress@0.0.1-SNAPSHOT e2e:cypress: `cypress run --browser chrome --record ${CYPRESS_ENABLE_RECORD:-false}`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the jhcypress@0.0.1-SNAPSHOT e2e:cypress script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\user\AppData\Roaming\npm-cache\_logs\2021-03-14T07_43_51_176Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! jhcypress@0.0.1-SNAPSHOT e2e: `npm run e2e:cypress`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the jhcypress@0.0.1-SNAPSHOT e2e script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\user\AppData\Roaming\npm-cache\_logs\2021-03-14T07_43_51_198Z-debug.log
PS D:\temp\jhcypress>
Motivation for or Use Case
A new application should be able to run cypress without any issue.
Reproduce the error
- Create an app selecting cypress
- Run
npm run e2e
Related issues
Suggest a Fix
JHipster Version(s)
jhcypress@0.0.1-SNAPSHOT D:\temp\jhcypress
`-- generator-jhipster@7.0.0-beta.1
JHipster configuration, a .yo-rc.json file generated in the root folder
.yo-rc.json file
{
"generator-jhipster": {
"blueprints": [],
"otherModules": [],
"applicationType": "monolith",
"baseName": "jhcypress",
"jhipsterVersion": "7.0.0-beta.1",
"skipClient": false,
"skipServer": false,
"skipUserManagement": false,
"skipCheckLengthOfIdentifier": false,
"skipFakeData": false,
"jhiPrefix": "jhi",
"entitySuffix": "",
"dtoSuffix": "DTO",
"testFrameworks": ["cypress"],
"pages": [],
"creationTimestamp": 1615707064549,
"serviceDiscoveryType": false,
"reactive": false,
"authenticationType": "session",
"packageName": "com.mycompany.myapp",
"serverPort": "8080",
"cacheProvider": "no",
"enableHibernateCache": false,
"databaseType": "sql",
"devDatabaseType": "h2Disk",
"prodDatabaseType": "postgresql",
"buildTool": "maven",
"serverSideOptions": [],
"websocket": false,
"searchEngine": false,
"messageBroker": false,
"enableSwaggerCodegen": false,
"clientFramework": "angularX",
"withAdminUi": true,
"clientTheme": "none",
"enableTranslation": false,
"nativeLanguage": "en",
"packageFolder": "com/mycompany/myapp",
"rememberMeKey": "YourJWTSecretKeyWasReplacedByThisMeaninglessTextByTheJHipsterInfoCommandForObviousSecurityReasons",
"clientPackageManager": "npm",
"clientThemeVariant": "",
"languages": ["en", "fr"]
}
}
JDL for the Entity configuration(s) entityName.json files generated in the .jhipster directory
JDL entity definitions
Environment and Tools
java version “11.0.9” 2020-10-20 LTS Java™ SE Runtime Environment 18.9 (build 11.0.9+7-LTS) Java HotSpot™ 64-Bit Server VM 18.9 (build 11.0.9+7-LTS, mixed mode)
git version 2.29.0.windows.1
node: v14.15.5
npm: 6.14.11
Docker version 20.10.5, build 55c4c88
docker-compose version 1.28.5, build c4eb3a1f
Browsers and Operating System
- Checking this box is mandatory (this is just to show you read everything)
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 2
- Comments: 24 (15 by maintainers)
Commits related to this issue
- add cypress tip add Cypress tip for devs using Windows platform Close #14309 — committed to zhyd1997/generator-jhipster by zhyd1997 a year ago
- add cypress tip add Cypress tip for devs using Windows platform Close #14309 — committed to BrayanMnz/generator-jhipster by zhyd1997 a year ago
Maybe windows did not pick up ${CYPRESS_ENABLE_RECORD:-false}" Try this: add this to package.json “cy:run”: “(is-ci && cypress run --browser chrome --record) || cypress run --browser chrome” Then, run “npm run cy:run” And you can run it with or without set up your key You can see this post: https://github.com/cypress-io/cypress/issues/4876