Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Document how to match the CI config for Cypress #11531

Merged
merged 3 commits into from
Sep 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,5 @@ Now the yarn commands should work as normal.

### End-to-End tests

Make sure you've got your Element development server running (by doing `yarn
start` in element-web), and then in this project, run `yarn run test:cypress`. See
[`docs/cypress.md`](https://github.com/matrix-org/matrix-react-sdk/blob/develop/docs/cypress.md)
for more information.
We use Cypress and Element Web for end-to-end tests. See
[`docs/cypress.md`](docs/cypress.md) for more information.
29 changes: 24 additions & 5 deletions docs/cypress.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
# Cypress in Element Web

## Scope of this Document
## Contents

This doc is about our Cypress tests in Element Web and how we use Cypress to write tests.
It aims to cover:

- How to run the tests yourself
- How to run the tests
- How the tests work
- How to write great Cypress tests
- Visual testing
Expand Down Expand Up @@ -45,6 +42,28 @@ To launch it:
yarn run test:cypress:open
```

### Matching the CI environment

In our Continuous Integration environment, we run the Cypress tests in the
Chrome browser.

In some rare cases, tests behave differently between different browsers, so if
you see CI failures for the Cypress tests, but those tests work OK on your local
machine, try running them in Chrome like this:

```bash
yarn run test:cypress --browser=chrome
```

(Use `--browser=chromium` if you'd prefer to use Chromium.)

If you launch the interactive UI you can choose the browser you want to use. To
match the CI setup, choose Chrome.

Note that you will need to have Chrome installed on your system to run the tests
inside those browsers, whereas the default is to use Electron, which is included
within the Cypress dependency.

### Running with Rust cryptography

`matrix-js-sdk` is currently in the
Expand Down
Loading