Skip to content
Snippets Groups Projects

Develop

Merged danielspeicher requested to merge develop into main
4 files
+ 54
1
Compare changes
  • Side-by-side
  • Inline
Files
4
+ 43
0
---
title: Docker Cypress
repo: https://gitlab.lakedrops.com/docker/cypress
issues: https://gitlab.lakedrops.com/docker/cypress/-/issues
tags:
- docker
- cypress
- tests
---
# Cypress
This Docker project contains the testing tool [Cypress](https://cypress.io/).
You will find the official documentation [here](https://docs.cypress.io/guides/overview/why-cypress).
We recommend using [Docker for Drupal](omposer/plugin/d4d/) to install cypress, so you will benefit form the great
and easy Drupal integration. You also get the corresponding [Ahoy](composer/plugin/ahoy/) commands out of the box.
Make sure the Docker container inside [l3D](docker/l3d/) for Drupal are running, and you can start Cypress by
```cypress
a cypress on
```
The container starts, and you will see the Cypress UI in a few seconds:
![Screenshot](/files/screenshots/cypress_start_screen.png)
The tests must be located in `<drupal_root>/tests/cypress/e2e` and will be automatically loaded.
As a useful convenience we provide a `commands.js` file, which is available all the time. You find it
[here](https://gitlab.lakedrops.com/docker/cypress/-/blob/main/commands.js?ref_type=heads), and it provides a lot of helpful
functions like:
- login
- createAndLogin
- drush
- and many more....
If you use Basic Auth on your website, no problem. You can pass the following two environment variables
to the Docker container:
- CYPRESS_basicauth_user={{ your.user }}
- CYPRESS_basicauth_pass={{ your.pass }}
Now the `visit` function takes care for it automatically.
\ No newline at end of file
Loading