element-web/test/end-to-end-tests
Michael Telatynski dcb9b9b777 Merge branch 'develop' of github.com:matrix-org/matrix-react-sdk into t3chguy/fix/17686
 Conflicts:
	src/components/views/elements/MiniAvatarUploader.tsx
	src/components/views/spaces/SpaceSettingsVisibilityTab.tsx
	src/i18n/strings/en_EN.json
	src/settings/handlers/RoomSettingsHandler.ts
	src/stores/SpaceStore.tsx
2021-07-15 10:04:48 +01:00
..
element Do not generate a lockfile when running in CI 2021-07-07 16:11:47 +02:00
src Update e2e tests 2021-07-06 12:05:06 +01:00
synapse Standardise spelling of identity server 2021-07-13 16:28:43 +01:00
.gitignore Performance monitoring measurements (#6041) 2021-05-19 10:07:02 +01:00
README.md
TODO.md
Windows.md
has-custom-app.js
install.sh Do not generate a lockfile when running in CI 2021-07-07 16:11:47 +02:00
package.json Upgrade puppeteer to use newer version of Chrome 2021-06-25 14:47:16 +01:00
run.sh fix typo in end-to-end-test run script output 2021-01-31 09:53:15 +01:00
start.js Auto-fix lint errors 2021-06-29 13:11:58 +01:00
yarn.lock Upgrade puppeteer to use newer version of Chrome 2021-06-25 14:47:16 +01:00

README.md

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 develop 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 Element Web, this fetches the develop 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 Element copy present in element/element-web served by a static Python HTTP server. You can symlink your element-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:

  • --app-url <url> don't use the Element Web copy and static server provided by the tests, but use a running server like the Webpack watch server to run the tests against.
  • --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