mattermost/e2e-tests/playwright
Daniel Schalla 1bbc3b4e83
[MM-58560] Configurable session revocation during password resets (#27286)
* [MM-58560] Allow for configurable session revocation during password reset

* Missing i18n additions

* Update Settings Wording

* Update Settings Wording #2

* Update default_config.ts for Session Termination

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
2024-06-18 21:13:29 +02:00
..
script E2E/Playwright: Upgrade playwright/dependencies and test server config (#26464) 2024-03-19 08:09:25 +08:00
support [MM-58560] Configurable session revocation during password resets (#27286) 2024-06-18 21:13:29 +02:00
tests Playwright/E2E: Upgrade to playwright@1.43 and its dependencies (#26833) 2024-04-23 06:58:49 +08:00
.eslintignore Move /e2e -> /e2e-tests 2023-03-28 18:10:00 +02:00
.eslintrc.json Move /e2e -> /e2e-tests 2023-03-28 18:10:00 +02:00
.percy.yml Move /e2e -> /e2e-tests 2023-03-28 18:10:00 +02:00
.prettierignore Move /e2e -> /e2e-tests 2023-03-28 18:10:00 +02:00
.prettierrc.json Move /e2e -> /e2e-tests 2023-03-28 18:10:00 +02:00
global_setup.ts Playwright/E2E: Upgrade to playwright@1.43 and its dependencies (#26833) 2024-04-23 06:58:49 +08:00
package-lock.json Playwright/E2E: Upgrade to playwright@1.43 and its dependencies (#26833) 2024-04-23 06:58:49 +08:00
package.json Playwright/E2E: Upgrade to playwright@1.43 and its dependencies (#26833) 2024-04-23 06:58:49 +08:00
playwright.config.ts MM-52642 CLD-6352 MM-54007 Prepare setup for Playwright pipeline (#24647) 2023-10-14 07:02:32 +08:00
README.md Playwright/E2E: Upgrade to playwright@1.43 and its dependencies (#26833) 2024-04-23 06:58:49 +08:00
sample.env CLD-5948 Playwright/E2E: Update dependencies, server default config and its types, and remove Boards and mobile view tests (#24583) 2023-09-20 05:28:35 +08:00
test.config.ts Playwright/E2E: Upgrade to playwright@1.43 and its dependencies (#26833) 2024-04-23 06:58:49 +08:00
tsconfig.json E2E/Playwright: Upgrade playwright/dependencies and test server config (#26464) 2024-03-19 08:09:25 +08:00
types.ts Playwright/E2E: Upgrade to playwright@1.43 and its dependencies (#26833) 2024-04-23 06:58:49 +08:00

Local development

1. Start local server in a separate terminal.

# Typically run the local server with:
cd server && make run

# Or build and distribute webapp including channels and playbooks
# so that their product URLs do not rely on Webpack dev server.
# Especially important when running test inside the Playwright's docker container.
cd webapp && make dist
cd server && make run-server

2. Install dependencies and run the test.

Note: If you're using Node.js version 18 and above, you may need to set NODE_OPTIONS='--no-experimental-fetch'.

# Install npm packages
npm i

# Install browser binaries as prompted if Playwright is just installed or updated
# See https://playwright.dev/docs/browsers
npx playwright install

# Run specific test of all projects -- chrome, firefox, iphone and ipad.
# See https://playwright.dev/docs/test-cli.
npm run test -- login

# Run specific test of a project
npm run test -- login --project=chrome

# Or run all tests
npm run test

3. Inspect test results at /test-results folder when something failed unexpectedly.

Updating screenshots is strictly via Playwright's docker container for consistency

1. Run docker container using latest focal version

Change to root directory, run docker container

docker run -it --rm -v "$(pwd):/mattermost/" --ipc=host mcr.microsoft.com/playwright:v1.43.0-jammy /bin/bash

2. Inside the docker container

export NODE_OPTIONS='--no-experimental-fetch'
export PW_BASE_URL=http://host.docker.internal:8065
export PW_HEADLESS=true
cd mattermost/e2e-tests/playwright

# Install npm packages. Use "npm ci" to match the automated environment
export PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 npm ci

# Run specific test. See https://playwright.dev/docs/test-cli.
npm run test -- login --project=chrome

# Or run all tests
npm run test

# Update snapshots
npm run test -- login --update-snapshots

Page/Component Object Model

See https://playwright.dev/docs/test-pom.

Page and component abstractions are located at ./support/ui. It should be first class before writing a spec file so that any future change in DOM structure will be done in one place only. No static UI text and fixed locator should be written in the spec file.