element-web/test/end-to-end-tests
2020-07-07 16:48:03 -06:00
..
riot split up installing static webserver and riot copy 2019-10-18 17:18:18 +02:00
src queryAll, not just query 2020-07-07 16:48:03 -06:00
synapse here's hoping Synapse doesn't actually try to send an email :D 2020-04-22 13:50:40 +01:00
.gitignore move everything to subfolder to merge into react-sdk 2019-10-09 16:52:48 +02:00
has_custom_riot.js copyright 2019-10-10 11:42:59 +02:00
install.sh split up installing static webserver and riot copy 2019-10-18 17:18:18 +02:00
package.json move everything to subfolder to merge into react-sdk 2019-10-09 16:52:48 +02:00
README.md Update test/end-to-end-tests/README.md 2019-10-18 12:29:09 +00:00
run.sh Update test/end-to-end-tests/run.sh 2019-10-18 12:33:42 +00:00
start.js Don't explode if the e2e test directory exists when crashing 2020-04-17 14:39:45 -06:00
TODO.md move everything to subfolder to merge into react-sdk 2019-10-09 16:52:48 +02:00
Windows.md Minor updates to e2e test instructions on Windows 2020-04-16 15:55:33 -06:00
yarn.lock Bump https-proxy-agent from 2.2.1 to 2.2.4 in /test/end-to-end-tests 2020-04-16 18:53:03 +00:00

Matrix React SDK End-to-End tests

This directory contains tests for matrix-react-sdk. The tests fire up a headless Chrome and simulate user interaction (end-to-end). Note that end-to-end has little to do with the end-to-end encryption Matrix supports, just that we test the full stack, going from user interaction to expected DOM in the browser.

Setup

Run ./install.sh. This will:

  • install Synapse, fetches the master branch at the moment. If anything fails here, please refer to the Synapse README to see if you're missing one of the prerequisites.
  • install Riot, this fetches the master branch at the moment.
  • install dependencies (will download copy of chrome)

Running the tests

Run tests with ./run.sh.

Debug tests locally.

./run.sh will run the tests against the Riot copy present in riot/riot-web served by a static Python HTTP server. You can symlink your riot-web develop copy here but that doesn't work well with Webpack recompiling. You can run the test runner directly and specify parameters to get more insight into a failure or run the tests against your local Webpack server.

./synapse/stop.sh && \
./synapse/start.sh && \
node start.js <parameters>

It's important to always stop and start Synapse before each run of the tests to clear the in-memory SQLite database it uses, as the tests assume a blank slate.

start.js accepts these parameters (and more, see node start.js --help) that can help running the tests locally:

  • --riot-url <url> don't use the Riot copy and static server provided by the tests, but use a running server like the Webpack watch server to run the tests against. Make sure to have the following local config:
    • welcomeUserId disabled as the tests assume there is no riot-bot currently.
  • --slow-mo type at a human speed, useful with --windowed.
  • --throttle-cpu <factor> throttle cpu in the browser by the given factor. Useful to reproduce failures because of insufficient timeouts happening on the slower CI server.
  • --windowed run the tests in an actual browser window Try to limit interacting with the windows while the tests are running. Hovering over the window tends to fail the tests, dragging the title bar should be fine though.
  • --dev-tools open the devtools in the browser window, only applies if --windowed is set as well.

Developer Guide

Please follow the standard Matrix contributor's guide: https://github.com/matrix-org/synapse/tree/master/CONTRIBUTING.rst

Please follow the Matrix JS/React code style as per: https://github.com/matrix-org/matrix-react-sdk/blob/master/code_style.md