mraible / jhipster7-demo

JHipster 7 Demo! 🔥
Apache License 2.0
81 stars 44 forks source link

Cypress 7.5.0 & record flag #5

Closed yoborider closed 3 years ago

yoborider commented 3 years ago

Hi!

Got an error with cypress (version 7.5.0) first launch (OS windows 10 pro) :

PS myapp> npm run e2e

> blog@0.0.1-SNAPSHOT e2e \myapp
> npm run e2e:cypress

> blog@0.0.1-SNAPSHOT e2e:cypress \myapp
> 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! blog@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 blog@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!     %USERPROFILE%\AppData\Roaming\npm-cache\_logs\2021-09-01T13_47_36_399Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! blog@0.0.1-SNAPSHOT e2e: `npm run e2e:cypress`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the blog@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!     %USERPROFILE%\AppData\Roaming\npm-cache\_logs\2021-09-01T13_47_36_460Z-debug.log

To solve it, i disable the record flag (by removing it) Cypress version 7.5.0 Edit the file package.json at root project dir : "e2e:cypress": "cypress run --browser chrome --record ${CYPRESS_ENABLE_RECORD:-false}", become : "e2e:cypress": "cypress run --browser chrome",

Hope it helps ;-) Thank you Matt for sharing this demo project!

mraible commented 3 years ago

This project was created with JHipster 7.0.1 and uses Cypress 6.6.0. https://github.com/mraible/jhipster7-demo/blob/main/package.json#L115

Are you using a more recent version of JHipster? If so, you might want to enter an issue in the JHipster GitHub project.

yoborider commented 3 years ago

Thank you for your quick response Matt, indeed it must come from this latest version of cypress or jhipster.

My setup :

PS > & "$env:JAVA_HOME\bin\java" -version
openjdk version "11.0.2" 2019-01-15
OpenJDK Runtime Environment 18.9 (build 11.0.2+9)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.2+9, mixed mode)

PS > node --version
v14.17.6

PS > npm version
{
  blog: '0.0.1-SNAPSHOT',
  npm: '6.14.15',
  ares: '1.17.2',
  brotli: '1.0.9',
  cldr: '39.0',
  icu: '69.1',
  llhttp: '2.1.3',
  modules: '83',
  napi: '8',
  nghttp2: '1.42.0',
  node: '14.17.6',
  openssl: '1.1.1l',
  tz: '2021a',
  unicode: '13.0',
  uv: '1.41.0',
  v8: '8.4.371.23-node.76',
  zlib: '1.2.11'
}

PS > & "$env:USERPROFILE\AppData\Roaming\npm\jhipster.cmd" --version
INFO! Using JHipster version installed locally in current project's node_modules
7.1.0

i'll submit an issue on jhipster github project as you suggest it ;-)

See you soon Matt!