# Tests frontaux Cypress

**URL:** <https://community.gladysassistant.com/t/cypress-frontend-tests/6256>\
**Category:** Développement\
**Tags:** cypress\
**Created:** [Avril 11, 2021, 10:19 UTC](https://community.gladysassistant.com/t/cypress-frontend-tests/6256 "2021-04-11T10:19:07Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![Terdious](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/terdious/32/6316_2.png) [@Terdious](https://community.gladysassistant.com/u/Terdious)\
**Post date:** [Avril 12, 2022, 9:11 UTC](https://community.gladysassistant.com/t/cypress-frontend-tests/6256/5 "2022-04-12T09:11:28Z")

</div>

Hi !!

Désolé je ne dois pas être doué ^^ @AlexTrovato pourrais-tu m’aider à lancer Cypress sous WSL ? Enfin si il y a un point que je n’ai pas compris ou fait …

- J’ai suivi la doc :

> [@Des tests frontends automatisés avec Cypress dans Gladys!](https://community.gladysassistant.com/t/des-tests-frontends-automatises-avec-cypress-dans-gladys/6309/1):
>
> [Faire tourner les tests Cypress dans Gladys | Gladys Assistant](https://gladysassistant.com/fr/docs/dev/cypress-tests/)

- J’ai donc lancé la commande serveur :

```auto
terdieu@DUBLEM-PC-01:~/gladys-dev/requeteAPI/Gladys/server[ExpandIconSelectionScenes !]$ npm run cypress

> gladys-server@ cypress /home/terdieu/gladys-dev/requeteAPI/Gladys/server
> npm run cypress:clean && npm run cypress:start

> gladys-server@ cypress:clean /home/terdieu/gladys-dev/requeteAPI/Gladys/server
> npx rimraf ./gladys-cypress.db*

> gladys-server@ cypress:start /home/terdieu/gladys-dev/requeteAPI/Gladys/server
> cross-env SQLITE_FILE_PATH=./gladys-cypress.db node index.js

2022-04-12T09:56:38+0200 <debug> index.js:370 (Umzug.log) == 20190205063641-create-user: migrating =======
2022-04-12T09:56:38+0200 <debug> index.js:370 (Umzug.log) == 20190205063641-create-user: migrated (0.036s)

```

- J’ai ensuite lancé la commande front :

```auto
terdieu@DUBLEM-PC-01:~/gladys-dev/requeteAPI/Gladys/front[ExpandIconSelectionScenes !]$ npm run start:cypress

> gladys-front@ start:cypress /home/terdieu/gladys-dev/requeteAPI/Gladys/front
> cross-env DEMO_MODE=false WEBSOCKET_URL=ws://localhost:1443 LOCAL_API_URL=http://localhost:1443 npm start

> gladys-front@ start /home/terdieu/gladys-dev/requeteAPI/Gladys/front
> per-env

> gladys-front@ start:development /home/terdieu/gladys-dev/requeteAPI/Gladys/front
> npm run -s dev

 Build [] 0% (0.0s) compilingℹ ｢wds｣: Project is running at http://0.0.0.0:1444/
ℹ ｢wds｣: webpack output is served from /
ℹ ｢wds｣: Content not from webpack is served from /home/terdieu/gladys-dev/requeteAPI/Gladys/front/src
ℹ ｢wds｣: 404s will fallback to /index.html
 Build [==] 10% (0.1s) buildingBrowserslist: caniuse-lite is outdated. Please run:
npx browserslist@latest --update-db

Why you should do it regularly:
https://github.com/browserslist/browserslist#browsers-data-updating
 Build [==========] 49% (13.9s) buildingBrowserslist: caniuse-lite is outdated. Please run:
npx browserslist@latest --update-db

Why you should do it regularly:
https://github.com/browserslist/browserslist#browsers-data-updating
Compiled successfully!

You can view the application in browser.

Local: http://0.0.0.0:1444
On Your Network: http://172.29.212.22:1444

```

- Et enfin tenté de lancé Cypress (essai à partir du front et de la racine Gladys).

```auto
terdieu@DUBLEM-PC-01:~/gladys-dev/requeteAPI/Gladys[ExpandIconSelectionScenes !]$ npm run cypress:open

> gladys@4.8.3 cypress:open /home/terdieu/gladys-dev/requeteAPI/Gladys
> cd front && npm run cypress:open

> gladys-front@ cypress:open /home/terdieu/gladys-dev/requeteAPI/Gladys/front
> cypress open --config-file cypress/cypress.json

It looks like this is your first time using Cypress: 6.9.1

  ✖ 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=156

----------

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

----------

Platform: linux (Ubuntu - 20.04)
Cypress Version: 6.9.1
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm 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-12T08_25_08_213Z-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 WARN Local package.json exists, but node_modules missing, did you mean to install?

npm ERR! A complete log of this run can be found in:
npm ERR! /home/terdieu/.npm/_logs/2022-04-12T08_25_08_243Z-debug.log

```

- J’ai ensuite tenté de suivre le lien que tu donnes dans tes slides :

> [@Point stabilité, mise à jour des dépendance & qualité de code](https://community.gladysassistant.com/t/point-stabilite-mise-a-jour-des-dependance-qualite-de-code/6121/46):
>
> [Installing Cypress | Cypress Documentation](https://docs.cypress.io/guides/getting-started/installing-cypress#System-requirements)
> 
> ⚠ Si WSL2
> 
> [Using Graphical User Interfaces like Cypress' in WSL2](https://nickymeuleman.netlify.app/blog/gui-on-wsl2-cypress/)
> 
> Pour les plus courageux, je prépare des slides (pour faire pro 😛 ) : [Cypress slides](https://docs.google.com/presentation/d/1iYCs9nGzACxWXlp8DFNgeFxl1FM9tw-QpMJEK_VT3dQ/edit?usp=sharing) (peut encore évoluer).  
> ça vous permet d’anticiper les questions.

Mais rien n’y fait 🥲 🥲

Merci d’avance !!

---

_[View the full topic](https://community.gladysassistant.com/t/cypress-frontend-tests/6256)._
