# Cypress Frontend Tests

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

<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:** [April 13, 2022, 5:19pm UTC](https://community.gladysassistant.com/t/cypress-frontend-tests/6256/21 "2022-04-13T17:19:19Z")

</div>

Mmmhh logic!! What a noob!! Thanks @VonOx, try this ^^

---

<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:** [April 13, 2022, 5:30pm UTC](https://community.gladysassistant.com/t/cypress-frontend-tests/6256/22 "2022-04-13T17:30:33Z")

</div>

> [@VonOx](#):
>
> npm rebuild

So indeed there has been a major evolution ^^ but it crashes at the end for the front I think ^^

```auto
  ⠹ 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) building
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-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

```

I see this:

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

```

and this:

```auto
ERROR: "cypress:open" exited with 1.

```

---

<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:** [May 15, 2022, 2:50pm UTC](https://community.gladysassistant.com/t/cypress-frontend-tests/6256/23 "2022-05-15T14:50:01Z")

</div>

Well, I’d kind of given up on it for the moment, still not managing to get it working.

It just goes to show that taking things up with a clear head is useful because it finally works!! So a big thank you to you @VonOx and @AlexTrovato for your explanations and your patience that led to this.

For your information, the only things I had left to do were:

- My `DISPLAY` variable in .bashrc is written like this as in the doc you gave me @VonOx: `export DISPLAY=$(cat /etc/resolv.conf | grep nameserver | awk '{print $2; exit;}'):0.0`.  
However, in my /etc/resolv.conf file my `nameserver=10.1.0.254`, i.e. the default DNS address.
- I ultimately have to redefine it before launching cypress as follows: `export DISPLAY=10.1.0.101:0.0` where 10.1.0.101 is the IP address of my WiFi network card attached to WSL.
- And then by running the command you indicated to me at the root of Gladys `npm run cypress`, it works perfectly and indeed launches the VcXsrv window.

Thanks again

[Previous page](https://community.gladysassistant.com/t/cypress-frontend-tests/6256.md?page=1)
