Cypress Frontend Tests

Mmmhh logique !! Quel noob !! Merci @VonOx, teste ca ^^

Alors en effet y a eu grosse évolution ^^ mais plante à la fin pour le front je pense ^^

  ⠹  Verifying Cypress can run /home/terdieu/.cache/Cypress/6.9.1/Cypress
2022-04-13T19:25:53+0200 <info> device.calculateAggregate.js:105 (ChildProcess.<anonymous>) device.calculateAggregate: Finishing processing for interval daily
2022-04-13T19:25:53+0200 <debug> gateway.forwardWebsockets.js:14 (Gateway.forwardWebsockets) Gateway: not connected. Prevent forwarding event.
2022-04-13T19:25:53+0200 <debug> gateway.forwardWebsockets.js:14 (Gateway.forwardWebsockets) Gateway: not connected. Prevent forwarding event.
2022-04-13T19:25:53+0200 <info> device.calculateAggregate.js:38 (DeviceManager.calculateAggregate) Calculating aggregates device feature state for interval monthly
  ⠇  Verifying Cypress can run /home/terdieu/.cache/Cypress/6.9.1/Cypress
2022-04-13T19:25:54+0200 <info> device.calculateAggregate.js:105 (ChildProcess.<anonymous>) device.calculateAggregate: Finishing processing for interval monthly
  ⠦  Verifying Cypress can run /home/terdieu/.cache/Cypress/6.9.1/Cypress
  ⠴  Verifying Cypress can run /home/terdieu/.cache/Cypress/6.9.1/Cypress
Browserslist: caniuse-lite is outdated. Please run:
npx browserslist@latest --update-db

Why you should do it regularly:
  ✖  Verifying Cypress can run /home/terdieu/.cache/Cypress/6.9.1/Cypress
    → Cypress Version: 6.9.1
Cypress verification timed out.

This command failed with the following output:

/home/terdieu/.cache/Cypress/6.9.1/Cypress/Cypress --no-sandbox --smoke-test --ping=179

----------

Command timed out after 30000 milliseconds: /home/terdieu/.cache/Cypress/6.9.1/Cypress/Cypress --no-sandbox --smoke-test --ping=179
Timed out

----------

Platform: linux (Ubuntu - 20.04)
Cypress Version: 6.9.1
npm ERR! code ELIFECYCLE
npm ERR! errno 1
 Build  [=============       ] 64% (25.0s) buildingnpm ERR! gladys-front@ cypress:open: `cypress open --config-file cypress/cypress.json`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the gladys-front@ cypress:open 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!     /home/terdieu/.npm/_logs/2022-04-13T17_26_16_400Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! gladys@4.8.3 cypress:open: `cd front && npm run cypress:open`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the gladys@4.8.3 cypress:open 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!     /home/terdieu/.npm/_logs/2022-04-13T17_26_16_434Z-debug.log
2022-04-13T19:26:16+0200 <info> index.js:25 (shutdown) SIGTERM received.
2022-04-13T19:26:16+0200 <info> index.js:31 (shutdown) Closing database connection.
2022-04-13T19:26:16+0200 <info> index.js:25 (shutdown) SIGTERM received.
2022-04-13T19:26:16+0200 <info> index.js:31 (shutdown) Closing database connection.
ERROR: "cypress:open" exited with 1.
2022-04-13T19:26:16+0200 <info> index.js:35 (shutdown) Database is probably already closed
2022-04-13T19:26:16+0200 <warn> index.js:36 (shutdown) [Error: SQLITE_MISUSE: Database handle is closed] {
  errno: 21,
  code: 'SQLITE_MISUSE'
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! gladys@4.8.3 cypress: `run-p start:cypress cypress:open`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the gladys@4.8.3 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!     /home/terdieu/.npm/_logs/2022-04-13T17_26_16_501Z-debug.log

Je vois ça :

Browserslist: caniuse-lite is outdated. Please run:
npx browserslist@latest --update-db

et ça :

ERROR: "cypress:open" exited with 1.

Bon j’avais un peu abandonné la chose pour le moment, n’y arrivant toujours pas.

Comme quoi reprendre les choses à tête reposée, c’est utile car ça marche enfin !! Alors un grand merci à vous @VonOx et @AlexTrovato pour vos explications et votre patience qui ont mené à cela.

Pour information, les seuls choses qu’il me restait à faire :

  • Ma variable DISPLAY dans .bashrc est inscrite ainsi comme dans la doc que tu m’avais passé @VonOx : export DISPLAY=$(cat /etc/resolv.conf | grep nameserver | awk '{print $2; exit;}'):0.0.
    Or dans mon fichier /etc/resolv.conf mon nameserver=10.1.0.254 soit l’adresse DNS par défaut.
  • Je dois au final redéfinir celle-ci avant le lancement de cypress comme suit : export DISPLAY=10.1.0.101:0.0 où 10.1.0.101 est l’adresse ip de ma carte réseau wifi affiliée à WSL.
  • Et ensuite en lançant la commande que vous m’avez indiqué à la racine de Gladys npm run cypress, cela fonctionne parfaitement et lance bien la fenêtre VcXsrv.

Encore merci