Compare commits

..

5 Commits

Author SHA1 Message Date
Michael Telatynski
4f14d3f5ae Stash
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2024-12-06 11:41:40 +00:00
Michael Telatynski
62c765bfd3 Fix React class constructor signature to not pass context
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2024-12-06 11:41:32 +00:00
Michael Telatynski
983db465c3 Fix react function refs returning things
This is incompatible with React 19

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2024-12-06 11:37:57 +00:00
Michael Telatynski
c299d2a0d1 Codemod
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2024-12-06 00:15:08 +00:00
Michael Telatynski
a9a3751f3e Upgrade to React 19
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2024-12-06 00:01:50 +00:00
2637 changed files with 17018 additions and 21627 deletions

View File

@@ -1,5 +1,5 @@
module.exports = { module.exports = {
plugins: ["matrix-org", "eslint-plugin-react-compiler"], plugins: ["matrix-org"],
extends: ["plugin:matrix-org/babel", "plugin:matrix-org/react", "plugin:matrix-org/a11y"], extends: ["plugin:matrix-org/babel", "plugin:matrix-org/react", "plugin:matrix-org/a11y"],
parserOptions: { parserOptions: {
project: ["./tsconfig.json"], project: ["./tsconfig.json"],
@@ -170,8 +170,6 @@ module.exports = {
"jsx-a11y/role-supports-aria-props": "off", "jsx-a11y/role-supports-aria-props": "off",
"matrix-org/require-copyright-header": "error", "matrix-org/require-copyright-header": "error",
"react-compiler/react-compiler": "error",
}, },
overrides: [ overrides: [
{ {
@@ -264,7 +262,6 @@ module.exports = {
// These are fine in tests // These are fine in tests
"no-restricted-globals": "off", "no-restricted-globals": "off",
"react-compiler/react-compiler": "off",
}, },
}, },
{ {
@@ -274,7 +271,6 @@ module.exports = {
}, },
rules: { rules: {
"react-hooks/rules-of-hooks": ["off"], "react-hooks/rules-of-hooks": ["off"],
"@typescript-eslint/no-floating-promises": ["error"],
}, },
}, },
{ {

7
.github/CODEOWNERS vendored
View File

@@ -10,14 +10,9 @@
/test/components/views/dialogs/security/ @element-hq/element-crypto-web-reviewers /test/components/views/dialogs/security/ @element-hq/element-crypto-web-reviewers
/src/stores/SetupEncryptionStore.ts @element-hq/element-crypto-web-reviewers /src/stores/SetupEncryptionStore.ts @element-hq/element-crypto-web-reviewers
/test/stores/SetupEncryptionStore-test.ts @element-hq/element-crypto-web-reviewers /test/stores/SetupEncryptionStore-test.ts @element-hq/element-crypto-web-reviewers
/src/components/views/settings/tabs/user/EncryptionUserSettingsTab.tsx @element-hq/element-crypto-web-reviewers
/src/src/components/views/settings/encryption/ @element-hq/element-crypto-web-reviewers
/test/unit-tests/components/views/settings/encryption/ @element-hq/element-crypto-web-reviewers
/playwright/e2e/settings/encryption-user-tab/ @element-hq/element-crypto-web-reviewers
# Ignore translations as those will be updated by GHA for Localazy download # Ignore translations as those will be updated by GHA for Localazy download
/src/i18n/strings /src/i18n/strings
/src/i18n/strings/en_EN.json @element-hq/element-web-reviewers
# Ignore the synapse plugin as this is updated by GHA for docker image updating # Ignore the synapse plugin as this is updated by GHA for docker image updating
/playwright/testcontainers/synapse.ts /playwright/plugins/homeserver/synapse/index.ts

12
.github/labels.yml vendored
View File

@@ -210,9 +210,6 @@
- name: "X-Upcoming-Release-Blocker" - name: "X-Upcoming-Release-Blocker"
description: "This does not affect the current release cycle but will affect the next one" description: "This does not affect the current release cycle but will affect the next one"
color: "e99695" color: "e99695"
- name: "X-Run-All-Tests"
description: "When applied to PRs, it'll run the full gamut of end-to-end tests on the PR"
color: "ff7979"
- name: "Z-Actions" - name: "Z-Actions"
color: "ededed" color: "ededed"
- name: "Z-Cache-Confusion" - name: "Z-Cache-Confusion"
@@ -235,15 +232,6 @@
- name: "Z-Flaky-Test" - name: "Z-Flaky-Test"
description: "A test is raising false alarms" description: "A test is raising false alarms"
color: "ededed" color: "ededed"
- name: "Z-Flaky-Test-Chrome"
description: "Flaky playwright test in Chrome"
color: "ededed"
- name: "Z-Flaky-Test-Firefox"
description: "Flaky playwright test in Firefox"
color: "ededed"
- name: "Z-Flaky-Test-Webkit"
description: "Flaky playwright test in Webkit"
color: "ededed"
- name: "Z-Flaky-Jest-Test" - name: "Z-Flaky-Jest-Test"
description: "A Jest test is raising false alarms" description: "A Jest test is raising false alarms"
color: "ededed" color: "ededed"

View File

@@ -5,9 +5,6 @@ on:
branches: [develop, master] branches: [develop, master]
merge_group: merge_group:
types: [checks_requested] types: [checks_requested]
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.sha }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
# develop pushes and repository_dispatch handled in build_develop.yaml # develop pushes and repository_dispatch handled in build_develop.yaml
env: env:
# These must be set for fetchdep.sh to get the right branch # These must be set for fetchdep.sh to get the right branch
@@ -27,17 +24,10 @@ jobs:
- macos-14 - macos-14
isDevelop: isDevelop:
- ${{ github.event_name == 'push' && github.ref_name == 'develop' }} - ${{ github.event_name == 'push' && github.ref_name == 'develop' }}
isPullRequest:
- ${{ github.event_name == 'pull_request' }}
# Skip the ubuntu-24.04 build for the develop branch as the dedicated CD build_develop workflow handles that # Skip the ubuntu-24.04 build for the develop branch as the dedicated CD build_develop workflow handles that
# Skip the non-linux builds for pull requests as Windows is awfully slow, so run in merge queue only
exclude: exclude:
- isDevelop: true - isDevelop: true
image: ubuntu-24.04 image: ubuntu-24.04
- isPullRequest: true
image: windows-2022
- isPullRequest: true
image: macos-14
runs-on: ${{ matrix.image }} runs-on: ${{ matrix.image }}
defaults: defaults:
run: run:
@@ -47,38 +37,14 @@ jobs:
- uses: actions/setup-node@v4 - uses: actions/setup-node@v4
with: with:
# Disable cache on Windows as it is slower than not caching cache: "yarn"
# https://github.com/actions/setup-node/issues/975
cache: ${{ runner.os != 'Windows' && 'yarn' || '' }}
node-version: "lts/*" node-version: "lts/*"
# Workaround for yarn install timeouts, especially on Windows # Workaround for yarn install timeouts, especially on Windows
- run: yarn config set network-timeout 300000 - run: yarn config set network-timeout 300000
- name: Fetch layered build - name: Install Dependencies
id: layered_build run: "./scripts/layered.sh"
env:
# tell layered.sh to check out the right sha of the JS-SDK & EW, if they were given one
JS_SDK_GITHUB_BASE_REF: ${{ inputs.matrix-js-sdk-sha }}
run: |
scripts/layered.sh
JSSDK_SHA=$(git -C matrix-js-sdk rev-parse --short=12 HEAD)
VECTOR_SHA=$(git rev-parse --short=12 HEAD)
echo "VERSION=$VECTOR_SHA--js-$JSSDK_SHA" >> $GITHUB_OUTPUT
- name: Copy config
run: cp element.io/develop/config.json config.json
- name: Build - name: Build
env: run: "yarn build"
CI_PACKAGE: true
VERSION: "${{ steps.layered_build.outputs.VERSION }}"
run: |
yarn build
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: webapp-${{ matrix.image }}
path: webapp
retention-days: 1

View File

@@ -16,11 +16,6 @@ on:
options: options:
- staging.element.io - staging.element.io
- app.element.io - app.element.io
skip-checks:
description: Skip CI on the tagged commit
required: true
default: false
type: boolean
concurrency: ${{ inputs.site || 'staging.element.io' }} concurrency: ${{ inputs.site || 'staging.element.io' }}
permissions: {} permissions: {}
jobs: jobs:
@@ -80,7 +75,6 @@ jobs:
- name: Wait for other steps to succeed - name: Wait for other steps to succeed
uses: t3chguy/wait-on-check-action@18541021811b56544d90e0f073401c2b99e249d6 # fork uses: t3chguy/wait-on-check-action@18541021811b56544d90e0f073401c2b99e249d6 # fork
if: inputs.skip-checks != true
with: with:
ref: ${{ github.sha }} ref: ${{ github.sha }}
running-workflow-name: "Deploy to Cloudflare Pages" running-workflow-name: "Deploy to Cloudflare Pages"
@@ -96,4 +90,3 @@ jobs:
projectName: ${{ env.SITE == 'staging.element.io' && 'element-web-staging' || 'element-web' }} projectName: ${{ env.SITE == 'staging.element.io' && 'element-web-staging' || 'element-web' }}
directory: _deploy directory: _deploy
gitHubToken: ${{ secrets.GITHUB_TOKEN }} gitHubToken: ${{ secrets.GITHUB_TOKEN }}
branch: main

View File

@@ -24,10 +24,10 @@ jobs:
uses: sigstore/cosign-installer@dc72c7d5c4d10cd6bcb8cf6e3fd625a9e5e537da # v3 uses: sigstore/cosign-installer@dc72c7d5c4d10cd6bcb8cf6e3fd625a9e5e537da # v3
- name: Set up QEMU - name: Set up QEMU
uses: docker/setup-qemu-action@53851d14592bedcffcf25ea515637cff71ef929a # v3 uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # v3
- name: Set up Docker Buildx - name: Set up Docker Buildx
uses: docker/setup-buildx-action@6524bf65af31da8d45b59e8c27de4bd072b392f5 # v3 uses: docker/setup-buildx-action@c47758b77c9736f4b2ef4073d4d51994fabfe349 # v3
with: with:
install: true install: true
@@ -51,7 +51,7 @@ jobs:
- name: Build and push - name: Build and push
id: build-and-push id: build-and-push
uses: docker/build-push-action@67a2d409c0a876cbe6b11854e3e25193efe4e62d # v6 uses: docker/build-push-action@48aba3b46d1b1fec4febb7c5d0c644b249a11355 # v6
with: with:
context: . context: .
push: true push: true

View File

@@ -3,9 +3,6 @@
# as an artifact and run end-to-end tests. # as an artifact and run end-to-end tests.
name: End to End Tests name: End to End Tests
on: on:
# CRON to run all Projects at 6am UTC
schedule:
- cron: "0 6 * * *"
pull_request: {} pull_request: {}
merge_group: merge_group:
types: [checks_requested] types: [checks_requested]
@@ -35,8 +32,6 @@ concurrency:
env: env:
# fetchdep.sh needs to know our PR number # fetchdep.sh needs to know our PR number
PR_NUMBER: ${{ github.event.pull_request.number }} PR_NUMBER: ${{ github.event.pull_request.number }}
# Use 6 runners in the default case, but 4 when running on a schedule where we run all 5 projects (20 runners total)
NUM_RUNNERS: ${{ github.event_name == 'schedule' && 4 || 6 }}
permissions: {} # No permissions required permissions: {} # No permissions required
@@ -45,9 +40,6 @@ jobs:
name: "Build Element-Web" name: "Build Element-Web"
runs-on: ubuntu-24.04 runs-on: ubuntu-24.04
if: inputs.skip != true if: inputs.skip != true
outputs:
num-runners: ${{ env.NUM_RUNNERS }}
runners-matrix: ${{ steps.runner-vars.outputs.matrix }}
steps: steps:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v4 uses: actions/checkout@v4
@@ -87,17 +79,8 @@ jobs:
path: webapp path: webapp
retention-days: 1 retention-days: 1
- name: Calculate runner variables
id: runner-vars
uses: actions/github-script@v7
with:
script: |
const numRunners = parseInt(process.env.NUM_RUNNERS, 10);
const matrix = Array.from({ length: numRunners }, (_, i) => i + 1);
core.setOutput("matrix", JSON.stringify(matrix));
playwright: playwright:
name: "Run Tests [${{ matrix.project }}] ${{ matrix.runner }}/${{ needs.build.outputs.num-runners }}" name: "Run Tests ${{ matrix.runner }}/${{ strategy.job-total }}"
needs: build needs: build
if: inputs.skip != true if: inputs.skip != true
runs-on: ubuntu-24.04 runs-on: ubuntu-24.04
@@ -109,25 +92,7 @@ jobs:
fail-fast: false fail-fast: false
matrix: matrix:
# Run multiple instances in parallel to speed up the tests # Run multiple instances in parallel to speed up the tests
runner: ${{ fromJSON(needs.build.outputs.runners-matrix) }} runner: [1, 2, 3, 4, 5, 6]
project:
- Chrome
- Firefox
- WebKit
- Dendrite
- Pinecone
runAllTests:
- ${{ github.event_name == 'schedule' || contains(github.event.pull_request.labels.*.name, 'X-Run-All-Tests') }}
# Skip the Firefox & Safari runs unless this was a cron trigger or PR has X-Run-All-Tests label
exclude:
- runAllTests: false
project: Firefox
- runAllTests: false
project: WebKit
- runAllTests: false
project: Dendrite
- runAllTests: false
project: Pinecone
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
with: with:
@@ -159,30 +124,24 @@ jobs:
with: with:
path: | path: |
~/.cache/ms-playwright ~/.cache/ms-playwright
key: ${{ runner.os }}-playwright-${{ steps.playwright.outputs.version }} key: ${{ runner.os }}-playwright-${{ steps.playwright.outputs.version }}-chromium
- name: Install Playwright browsers - name: Install Playwright browser
if: steps.playwright-cache.outputs.cache-hit != 'true' if: steps.playwright-cache.outputs.cache-hit != 'true'
run: yarn playwright install --with-deps --no-shell run: yarn playwright install --with-deps --no-shell chromium
- name: Install system dependencies for WebKit
# Some WebKit dependencies seem to lay outside the cache and will need to be installed separately
if: matrix.project == 'WebKit' && steps.playwright-cache.outputs.cache-hit == 'true'
run: yarn playwright install-deps webkit
# We skip tests tagged with @mergequeue when running on PRs, but run them in MQ and everywhere else # We skip tests tagged with @mergequeue when running on PRs, but run them in MQ and everywhere else
- name: Run Playwright tests - name: Run Playwright tests
run: | run: |
yarn playwright test \ yarn playwright test \
--shard "${{ matrix.runner }}/${{ needs.build.outputs.num-runners }}" \ --shard "${{ matrix.runner }}/${{ strategy.job-total }}" \
--project="${{ matrix.project }}" \ ${{ github.event_name == 'pull_request' && '--grep-invert @mergequeue' || '' }}
${{ (github.event_name == 'pull_request' && matrix.runAllTests == false ) && '--grep-invert @mergequeue' || '' }}
- name: Upload blob report to GitHub Actions Artifacts - name: Upload blob report to GitHub Actions Artifacts
if: always() if: always()
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
name: all-blob-reports-${{ matrix.project }}-${{ matrix.runner }} name: all-blob-reports-${{ matrix.runner }}
path: blob-report path: blob-report
retention-days: 1 retention-days: 1

View File

@@ -3,8 +3,7 @@ on:
workflow_dispatch: {} workflow_dispatch: {}
schedule: schedule:
- cron: "0 6 * * 1,3,5" # Every Monday, Wednesday and Friday at 6am UTC - cron: "0 6 * * 1,3,5" # Every Monday, Wednesday and Friday at 6am UTC
permissions: permissions: {} # We use ELEMENT_BOT_TOKEN instead
pull-requests: write # needed to auto-approve PRs
jobs: jobs:
download: download:
uses: matrix-org/matrix-web-i18n/.github/workflows/localazy_download.yaml@main uses: matrix-org/matrix-web-i18n/.github/workflows/localazy_download.yaml@main

View File

@@ -3,7 +3,7 @@
name: Upload Preview Build to Netlify name: Upload Preview Build to Netlify
on: on:
workflow_run: workflow_run:
workflows: ["Build"] workflows: ["End to End Tests"]
types: types:
- completed - completed
jobs: jobs:
@@ -32,7 +32,7 @@ jobs:
with: with:
github-token: ${{ secrets.GITHUB_TOKEN }} github-token: ${{ secrets.GITHUB_TOKEN }}
run-id: ${{ github.event.workflow_run.id }} run-id: ${{ github.event.workflow_run.id }}
name: webapp-ubuntu-24.04 name: webapp
path: webapp path: webapp
- name: 📤 Deploy to Netlify - name: 📤 Deploy to Netlify

View File

@@ -17,13 +17,13 @@ jobs:
docker pull "$IMAGE" docker pull "$IMAGE"
INSPECT=$(docker inspect --format='{{index .RepoDigests 0}}' "$IMAGE") INSPECT=$(docker inspect --format='{{index .RepoDigests 0}}' "$IMAGE")
DIGEST=${INSPECT#*@} DIGEST=${INSPECT#*@}
sed -i "s/const TAG.*/const TAG = \"develop@$DIGEST\";/" playwright/testcontainers/synapse.ts sed -i "s/const DOCKER_TAG.*/const DOCKER_TAG = \"develop@$DIGEST\";/" playwright/plugins/homeserver/synapse/index.ts
env: env:
IMAGE: ghcr.io/element-hq/synapse:develop IMAGE: ghcr.io/element-hq/synapse:develop
- name: Create Pull Request - name: Create Pull Request
id: cpr id: cpr
uses: peter-evans/create-pull-request@67ccf781d68cd99b580ae25a5c18a1cc84ffff1f # v7 uses: peter-evans/create-pull-request@5e914681df9dc83aa4e4905692ca88beb2f9e91f # v7
with: with:
token: ${{ secrets.ELEMENT_BOT_TOKEN }} token: ${{ secrets.ELEMENT_BOT_TOKEN }}
branch: actions/playwright-image-updates branch: actions/playwright-image-updates

View File

@@ -132,3 +132,9 @@ jobs:
- name: Run linter - name: Run linter
run: "yarn run lint:knip" run: "yarn run lint:knip"
- name: Install Deps
run: "scripts/layered.sh"
- name: Dead Code Analysis
run: "yarn run analyse:unused-exports"

View File

@@ -104,7 +104,7 @@ jobs:
- name: Skip SonarCloud in merge queue - name: Skip SonarCloud in merge queue
if: github.event_name == 'merge_group' || inputs.disable_coverage == 'true' if: github.event_name == 'merge_group' || inputs.disable_coverage == 'true'
uses: guibranco/github-status-action-v2@ecd54a02cf761e85a8fb328fe937710fd4227cda uses: guibranco/github-status-action-v2@66088c44e212a906c32a047529a213d81809ec1c
with: with:
authToken: ${{ secrets.GITHUB_TOKEN }} authToken: ${{ secrets.GITHUB_TOKEN }}
state: success state: success

View File

@@ -1,6 +1,5 @@
name: Close stale flaky issues name: Close stale flaky issues
on: on:
workflow_dispatch: {}
schedule: schedule:
- cron: "30 1 * * *" - cron: "30 1 * * *"
permissions: {} permissions: {}
@@ -18,4 +17,3 @@ jobs:
days-before-close: 0 days-before-close: 0
close-issue-message: "This flaky test issue has not been updated in 14 days. It is being closed as presumed resolved." close-issue-message: "This flaky test issue has not been updated in 14 days. It is being closed as presumed resolved."
exempt-issue-labels: "Z-Flaky-Test-Disabled" exempt-issue-labels: "Z-Flaky-Test-Disabled"
operations-per-run: 100

View File

@@ -23,7 +23,7 @@ jobs:
run: "yarn update:jitsi" run: "yarn update:jitsi"
- name: Create Pull Request - name: Create Pull Request
uses: peter-evans/create-pull-request@67ccf781d68cd99b580ae25a5c18a1cc84ffff1f # v7 uses: peter-evans/create-pull-request@5e914681df9dc83aa4e4905692ca88beb2f9e91f # v7
with: with:
token: ${{ secrets.ELEMENT_BOT_TOKEN }} token: ${{ secrets.ELEMENT_BOT_TOKEN }}
branch: actions/jitsi-update branch: actions/jitsi-update

View File

@@ -1,56 +1,3 @@
Changes in [1.11.90](https://github.com/element-hq/element-web/releases/tag/v1.11.90) (2025-01-14)
==================================================================================================
## ✨ Features
* Docker: run as non-root ([#28849](https://github.com/element-hq/element-web/pull/28849)). Contributed by @richvdh.
* Docker: allow configuration of HTTP listen port via env var ([#28840](https://github.com/element-hq/element-web/pull/28840)). Contributed by @richvdh.
* Update matrix-wysiwyg to consume WASM asset ([#28838](https://github.com/element-hq/element-web/pull/28838)). Contributed by @t3chguy.
* OIDC settings tweaks ([#28787](https://github.com/element-hq/element-web/pull/28787)). Contributed by @t3chguy.
* Delabs native OIDC support ([#28615](https://github.com/element-hq/element-web/pull/28615)). Contributed by @t3chguy.
* Move room header info button to right-most position ([#28754](https://github.com/element-hq/element-web/pull/28754)). Contributed by @t3chguy.
* Enable key backup by default ([#28691](https://github.com/element-hq/element-web/pull/28691)). Contributed by @dbkr.
## 🐛 Bug Fixes
* Fix building the automations mermaid diagram ([#28881](https://github.com/element-hq/element-web/pull/28881)). Contributed by @dbkr.
* Playwright: wait for the network listener on the postgres db ([#28808](https://github.com/element-hq/element-web/pull/28808)). Contributed by @dbkr.
Changes in [1.11.89](https://github.com/element-hq/element-web/releases/tag/v1.11.89) (2024-12-18)
==================================================================================================
This is a patch release to fix a bug which could prevent loading stored crypto state from storage, and also to fix URL previews when switching back to a room.
## 🐛 Bug Fixes
* Upgrade matrix-sdk-crypto-wasm to 1.11.0 (https://github.com/matrix-org/matrix-js-sdk/pull/4593)
* Fix url preview display ([#28766](https://github.com/element-hq/element-web/pull/28766)).
Changes in [1.11.88](https://github.com/element-hq/element-web/releases/tag/v1.11.88) (2024-12-17)
==================================================================================================
## ✨ Features
* Allow trusted Element Call widget to send and receive media encryption key to-device messages ([#28316](https://github.com/element-hq/element-web/pull/28316)). Contributed by @hughns.
* increase ringing timeout from 10 seconds to 90 seconds ([#28630](https://github.com/element-hq/element-web/pull/28630)). Contributed by @fkwp.
* Add `Close` tooltip to dialog ([#28617](https://github.com/element-hq/element-web/pull/28617)). Contributed by @florianduros.
* New UX for Share dialog ([#28598](https://github.com/element-hq/element-web/pull/28598)). Contributed by @florianduros.
* Improve performance of RoomContext in RoomHeader ([#28574](https://github.com/element-hq/element-web/pull/28574)). Contributed by @t3chguy.
* Remove `Features.RustCrypto` flag ([#28582](https://github.com/element-hq/element-web/pull/28582)). Contributed by @florianduros.
* Add Modernizr warning when running in non-secure context ([#28581](https://github.com/element-hq/element-web/pull/28581)). Contributed by @t3chguy.
## 🐛 Bug Fixes
* Fix jumpy timeline when the pinned message banner is displayed ([#28654](https://github.com/element-hq/element-web/pull/28654)). Contributed by @florianduros.
* Fix font \& spaces in settings subsection ([#28631](https://github.com/element-hq/element-web/pull/28631)). Contributed by @florianduros.
* Remove manual device verification which is not supported by the new cryptography stack ([#28588](https://github.com/element-hq/element-web/pull/28588)). Contributed by @florianduros.
* Fix code block highlighting not working reliably with many code blocks ([#28613](https://github.com/element-hq/element-web/pull/28613)). Contributed by @t3chguy.
* Remove remaining reply fallbacks code ([#28610](https://github.com/element-hq/element-web/pull/28610)). Contributed by @t3chguy.
* Provide a way to activate GIFs via the keyboard for a11y ([#28611](https://github.com/element-hq/element-web/pull/28611)). Contributed by @t3chguy.
* Fix format bar position ([#28591](https://github.com/element-hq/element-web/pull/28591)). Contributed by @florianduros.
* Fix room taking long time to load ([#28579](https://github.com/element-hq/element-web/pull/28579)). Contributed by @florianduros.
* Show the correct shield status in tooltip for more conditions ([#28476](https://github.com/element-hq/element-web/pull/28476)). Contributed by @uhoreg.
Changes in [1.11.87](https://github.com/element-hq/element-web/releases/tag/v1.11.87) (2024-12-03) Changes in [1.11.87](https://github.com/element-hq/element-web/releases/tag/v1.11.87) (2024-12-03)
================================================================================================== ==================================================================================================
## ✨ Features ## ✨ Features

View File

@@ -1,17 +1,20 @@
# Builder # Builder
FROM --platform=$BUILDPLATFORM node:22-bullseye AS builder FROM --platform=$BUILDPLATFORM node:22-bullseye as builder
# Support custom branch of the js-sdk. This also helps us build images of element-web develop. # Support custom branch of the js-sdk. This also helps us build images of element-web develop.
ARG USE_CUSTOM_SDKS=false ARG USE_CUSTOM_SDKS=false
ARG JS_SDK_REPO="https://github.com/matrix-org/matrix-js-sdk.git" ARG JS_SDK_REPO="https://github.com/matrix-org/matrix-js-sdk.git"
ARG JS_SDK_BRANCH="master" ARG JS_SDK_BRANCH="master"
RUN apt-get update && apt-get install -y git dos2unix
WORKDIR /src WORKDIR /src
COPY . /src COPY . /src
RUN /src/scripts/docker-link-repos.sh RUN dos2unix /src/scripts/docker-link-repos.sh && bash /src/scripts/docker-link-repos.sh
RUN yarn --network-timeout=200000 install RUN yarn --network-timeout=200000 install
RUN /src/scripts/docker-package.sh
RUN dos2unix /src/scripts/docker-package.sh /src/scripts/get-version-from-git.sh /src/scripts/normalize-version.sh && bash /src/scripts/docker-package.sh
# Copy the config now so that we don't create another layer in the app image # Copy the config now so that we don't create another layer in the app image
RUN cp /src/config.sample.json /src/webapp/config.json RUN cp /src/config.sample.json /src/webapp/config.json
@@ -21,22 +24,8 @@ FROM nginx:alpine-slim
COPY --from=builder /src/webapp /app COPY --from=builder /src/webapp /app
# Override default nginx config. Templates in `/etc/nginx/templates` are passed # Override default nginx config
# through `envsubst` by the nginx docker image entry point. COPY /nginx/conf.d/default.conf /etc/nginx/conf.d/default.conf
COPY /docker/nginx-templates/* /etc/nginx/templates/
# Tell nginx to put its pidfile elsewhere, so it can run as non-root
RUN sed -i -e 's,/var/run/nginx.pid,/tmp/nginx.pid,' /etc/nginx/nginx.conf
# nginx user must own the cache and etc directory to write cache and tweak the nginx config
RUN chown -R nginx:0 /var/cache/nginx /etc/nginx
RUN chmod -R g+w /var/cache/nginx /etc/nginx
RUN rm -rf /usr/share/nginx/html \ RUN rm -rf /usr/share/nginx/html \
&& ln -s /app /usr/share/nginx/html && ln -s /app /usr/share/nginx/html
# Run as nginx user by default
USER nginx
# HTTP listen port
ENV ELEMENT_WEB_PORT=80

View File

@@ -1,6 +0,0 @@
Licensees holding a valid commercial license with Element may use this
software in accordance with the terms contained in a written agreement
between you and Element.
To purchase a commercial license please contact our sales team at
licensing@element.io

View File

@@ -311,18 +311,3 @@ For a developer guide, see the [translating dev doc](docs/translating-dev.md).
Issues are triaged by community members and the Web App Team, following the [triage process](https://github.com/element-hq/element-meta/wiki/Triage-process). Issues are triaged by community members and the Web App Team, following the [triage process](https://github.com/element-hq/element-meta/wiki/Triage-process).
We use [issue labels](https://github.com/element-hq/element-meta/wiki/Issue-labelling) to sort all incoming issues. We use [issue labels](https://github.com/element-hq/element-meta/wiki/Issue-labelling) to sort all incoming issues.
## Copyright & License
Copyright (c) 2014-2017 OpenMarket Ltd
Copyright (c) 2017 Vector Creations Ltd
Copyright (c) 2017-2025 New Vector Ltd
This software is multi licensed by New Vector Ltd (Element). It can be used either:
(1) for free under the terms of the GNU Affero General Public License (as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version); OR
(2) for free under the terms of the GNU General Public License (as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version); OR
(3) under the terms of a paid-for Element Commercial License agreement between you and Element (the terms of which may vary depending on what you and Element have agreed to).
Unless required by applicable law or agreed to in writing, software distributed under the Licenses is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the Licenses for the specific language governing permissions and limitations under the Licenses.

View File

@@ -2,7 +2,7 @@
Copyright 2024 New Vector Ltd. Copyright 2024 New Vector Ltd.
Copyright 2022 The Matrix.org Foundation C.I.C. Copyright 2022 The Matrix.org Foundation C.I.C.
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
Please see LICENSE files in the repository root for full details. Please see LICENSE files in the repository root for full details.
*/ */
@@ -17,7 +17,6 @@ class MockMap extends EventEmitter {
setCenter = jest.fn(); setCenter = jest.fn();
setStyle = jest.fn(); setStyle = jest.fn();
fitBounds = jest.fn(); fitBounds = jest.fn();
remove = jest.fn();
} }
const MockMapInstance = new MockMap(); const MockMapInstance = new MockMap();

View File

@@ -2,7 +2,7 @@
Copyright 2024 New Vector Ltd. Copyright 2024 New Vector Ltd.
Copyright 2023 The Matrix.org Foundation C.I.C. Copyright 2023 The Matrix.org Foundation C.I.C.
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
Please see LICENSE files in the repository root for full details. Please see LICENSE files in the repository root for full details.
*/ */

View File

@@ -3,7 +3,7 @@
"description": "A glossy Matrix collaboration client for the web.", "description": "A glossy Matrix collaboration client for the web.",
"repository": { "repository": {
"url": "https://github.com/element-hq/element-web", "url": "https://github.com/element-hq/element-web",
"license": "AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial" "license": "AGPL-3.0-only OR GPL-3.0-only"
}, },
"bugs": { "bugs": {
"list": "https://github.com/element-hq/element-web/issues", "list": "https://github.com/element-hq/element-web/issues",

View File

@@ -60,22 +60,6 @@ would be:
docker run --rm -p 127.0.0.1:80:80 -v /etc/element-web/config.json:/app/config.json vectorim/element-web docker run --rm -p 127.0.0.1:80:80 -v /etc/element-web/config.json:/app/config.json vectorim/element-web
``` ```
The Docker image is configured to run as an unprivileged (non-root) user by
default. This should be fine on modern Docker runtimes, but binding to port 80
on other runtimes may require root privileges. To resolve this, either run the
image as root (`docker run --user 0`) or, better, change the port that nginx
listens on via the `ELEMENT_WEB_PORT` environment variable.
The behaviour of the docker image can be customised via the following
environment variables:
- `ELEMENT_WEB_PORT`
The port to listen on (within the docker container) for HTTP
traffic. Defaults to `80`.
### Building the docker image
To build the image yourself: To build the image yourself:
```bash ```bash

View File

@@ -1,9 +1,29 @@
# OIDC and delegated authentication # OIDC and delegated authentication
## Compatibility/OIDC-aware mode
[MSC2965: OIDC provider discovery](https://github.com/matrix-org/matrix-spec-proposals/pull/2965)
[MSC3824: OIDC aware clients](https://github.com/matrix-org/matrix-spec-proposals/pull/3824)
This mode uses an SSO flow to gain a `loginToken` from the authentication provider, then continues with SSO login.
Element Web uses [MSC2965: OIDC provider discovery](https://github.com/matrix-org/matrix-spec-proposals/pull/2965) to discover the configured provider.
Wherever valid MSC2965 configuration is discovered, OIDC-aware login flow will be the only option offered.
## (🧪Experimental) OIDC-native flow
Can be enabled by a config-level-only setting in `config.json`
```json
{
"features": {
"feature_oidc_native_flow": true
}
}
```
See https://areweoidcyet.com/client-implementation-guide/ for implementation details. See https://areweoidcyet.com/client-implementation-guide/ for implementation details.
Element Web uses [MSC2965: OIDC provider discovery](https://github.com/matrix-org/matrix-spec-proposals/pull/2965) to discover the configured provider. Element Web uses [MSC2965: OIDC provider discovery](https://github.com/matrix-org/matrix-spec-proposals/pull/2965) to discover the configured provider.
Where a valid MSC2965 configuration is discovered, OIDC native login flow will be the only login option offered. Where OIDC native login flow is enabled and valid MSC2965 configuration is discovered, OIDC native login flow will be the only login option offered.
Element Web will attempt to [dynamically register](https://openid.net/specs/openid-connect-registration-1_0.html) with the configured OP. Element Web will attempt to [dynamically register](https://openid.net/specs/openid-connect-registration-1_0.html) with the configured OP.
Then, authentication will be completed [as described here](https://areweoidcyet.com/client-implementation-guide/). Then, authentication will be completed [as described here](https://areweoidcyet.com/client-implementation-guide/).

View File

@@ -23,19 +23,21 @@ element-web project is fine: leave it running it a different terminal as you wou
when developing. Alternatively if you followed the development set up from element-web then when developing. Alternatively if you followed the development set up from element-web then
Playwright will be capable of running the webserver on its own if it isn't already running. Playwright will be capable of running the webserver on its own if it isn't already running.
The tests use [testcontainers](https://node.testcontainers.org/) to launch Homeserver (Synapse or Dendrite) The tests use Docker to launch Homeserver (Synapse or Dendrite) instances to test against, so you'll also
instances to test against, so you'll also need to one of the need to have Docker installed and working in order to run the Playwright tests.
[supported container runtimes](#supporter-container-runtimes)
installed and working in order to run the Playwright tests.
There are a few different ways to run the tests yourself. The simplest is to run: There are a few different ways to run the tests yourself. The simplest is to run:
```shell ```shell
docker pull ghcr.io/element-hq/synapse:develop
yarn run test:playwright yarn run test:playwright
``` ```
This will run the Playwright tests once, non-interactively. This will run the Playwright tests once, non-interactively.
Note: you don't need to run the `docker pull` command every time, but you should
do it regularly to ensure you are running against an up-to-date Synapse.
You can also run individual tests this way too, as you'd expect: You can also run individual tests this way too, as you'd expect:
```shell ```shell
@@ -51,36 +53,41 @@ yarn run test:playwright:open --headed --debug
See more command line options at <https://playwright.dev/docs/test-cli>. See more command line options at <https://playwright.dev/docs/test-cli>.
## Projects ### Running with Rust cryptography
By default, Playwright will run all "Projects", this means tests will run against Chrome, Firefox and "Safari" (Webkit). `matrix-js-sdk` is currently in the
We only run tests against Chrome in pull request CI, but all projects in the merge queue. [process](https://github.com/vector-im/element-web/issues/21972) of being
Some tests are excluded from running on certain browsers due to incompatibilities in the test harness. updated to replace its end-to-end encryption implementation to use the [Matrix
Rust SDK](https://github.com/matrix-org/matrix-rust-sdk). This is not currently
enabled by default, but it is possible to have Playwright configure Element to use
the Rust crypto implementation by passing `--project="Rust Crypto"` or using
the top left options in open mode.
## How the Tests Work ## How the Tests Work
Everything Playwright-related lives in the `playwright/` subdirectory Everything Playwright-related lives in the `playwright/` subdirectory of react-sdk
as is typical for Playwright tests. Likewise, tests live in `playwright/e2e`. as is typical for Playwright tests. Likewise, tests live in `playwright/e2e`.
`playwright/testcontainers` contains the testcontainers which start instances `playwright/plugins/homeservers` contains Playwright plugins that starts instances
of Synapse/Dendrite. These servers are what Element-web runs against in the tests. of Synapse/Dendrite in Docker containers. These servers are what Element-web runs
against in the tests.
Synapse can be launched with different configurations in order to test element Synapse can be launched with different configurations in order to test element
in different configurations. You can specify `synapseConfig` as such: in different configurations. `playwright/plugins/homeserver/synapse/templates`
contains template configuration files for each different configuration.
```typescript Each test suite can then launch whatever Synapse instances it needs in whatever
test.use({ configurations.
synapseConfig: {
// The config options to pass to the Synapse instance
},
});
```
The appropriate homeserver will be launched by the Playwright worker and reused for all tests which match the worker configuration. Note that although tests should stop the Homeserver instances after running and the
Due to homeservers being reused between tests, please use unique names for any rooms put into the room directory as plugin also stop any remaining instances after all tests have run, it is possible
they may be visible from other tests, the suggested approach is to use `testInfo.testId` within the name or lodash's uniqueId. to be left with some stray containers if, for example, you terminate a test such
We remove public rooms from the room directory between tests but deleting users doesn't have a homeserver agnostic solution. that the `after()` does not run and also exit Playwright uncleanly. All the containers
The logs from testcontainers will be attached to any reports output from Playwright. it starts are prefixed, so they are easy to recognise. They can be removed safely.
After each test run, logs from the Synapse instances are saved in `playwright/logs/synapse`
with each instance in a separate directory named after its ID. These logs are removed
at the start of each test run.
## Writing Tests ## Writing Tests
@@ -110,6 +117,25 @@ Homeserver instances should be reasonably cheap to start (you may see the first
while as it pulls the Docker image). while as it pulls the Docker image).
You do not need to explicitly clean up the instance as it will be cleaned up by the fixture. You do not need to explicitly clean up the instance as it will be cleaned up by the fixture.
### Synapse Config Templates
When a Synapse instance is started, it's given a config generated from one of the config
templates in `playwright/plugins/homeserver/synapse/templates`. There are a couple of special files
in these templates:
- `homeserver.yaml`:
Template substitution happens in this file. Template variables are:
- `REGISTRATION_SECRET`: The secret used to register users via the REST API.
- `MACAROON_SECRET_KEY`: Generated each time for security
- `FORM_SECRET`: Generated each time for security
- `PUBLIC_BASEURL`: The localhost url + port combination the synapse is accessible at
- `localhost.signing.key`: A signing key is auto-generated and saved to this file.
Config templates should not contain a signing key and instead assume that one will exist
in this file.
All other files in the template are copied recursively to `/data/`, so the file `foo.html`
in a template can be referenced in the config as `/data/foo.html`.
### Logging In ### Logging In
We again heavily leverage the magic of [Playwright fixtures](https://playwright.dev/docs/test-fixtures). We again heavily leverage the magic of [Playwright fixtures](https://playwright.dev/docs/test-fixtures).
@@ -198,20 +224,3 @@ We use test tags to categorise tests for running subsets more efficiently.
- `@mergequeue`: Tests that are slow or flaky and cover areas of the app we update seldom, should not be run on every PR commit but will be run in the Merge Queue. - `@mergequeue`: Tests that are slow or flaky and cover areas of the app we update seldom, should not be run on every PR commit but will be run in the Merge Queue.
- `@screenshot`: Tests that use `toMatchScreenshot` to speed up a run of `test:playwright:screenshots`. A test with this tag must not also have the `@mergequeue` tag as this would cause false positives in the stale screenshot detection. - `@screenshot`: Tests that use `toMatchScreenshot` to speed up a run of `test:playwright:screenshots`. A test with this tag must not also have the `@mergequeue` tag as this would cause false positives in the stale screenshot detection.
- `@no-$project`: Tests which are unsupported in $Project. These tests will be skipped when running in $Project.
Anything testing Matrix media will need to have `@no-firefox` and `@no-webkit` as those rely on the service worker which
has to be disabled in Playwright on Firefox & Webkit to retain routing functionality.
Anything testing VoIP/microphone will need to have `@no-webkit` as fake microphone functionality is not available
there at this time.
If you wish to run all tests in a PR, you can give it the label `X-Run-All-Tests`.
## Supporter container runtimes
We use testcontainers to spin up various instances of Synapse, Matrix Authentication Service, and more.
It supports Docker out of the box but also has support for Podman, Colima, Rancher, you just need to follow some instructions to achieve it:
https://node.testcontainers.org/supported-container-runtimes/
If you are running under Colima, you may need to set the environment variable `TMPDIR` to `/tmp/colima` or a path
within `$HOME` to allow bind mounting temporary directories into the Docker containers.

View File

@@ -8,13 +8,11 @@
#### develop #### develop
The develop branch holds the very latest and greatest code we have to offer, as such it may be less stable. The develop branch holds the very latest and greatest code we have to offer, as such it may be less stable. It corresponds to the develop.element.io CD platform.
It is auto-deployed on every commit to element-web or matrix-js-sdk to develop.element.io via GitHub Actions `build_develop.yml`.
#### staging #### staging
The staging branch corresponds to the very latest release regardless of whether it is an RC or not. Deployed to staging.element.io manually. The staging branch corresponds to the very latest release regardless of whether it is an RC or not. Deployed to staging.element.io manually.
It is auto-deployed on every release of element-web to staging.element.io via GitHub Actions `deploy.yml`.
#### master #### master
@@ -217,7 +215,7 @@ We ship Element Web to dockerhub, `*.element.io`, and packages.element.io.
We ship Element Desktop to packages.element.io. We ship Element Desktop to packages.element.io.
- [ ] Check that element-web has shipped to dockerhub - [ ] Check that element-web has shipped to dockerhub
- [ ] Check that the staging [deployment](https://github.com/element-hq/element-web/actions/workflows/deploy.yml) has completed successfully - [ ] Deploy staging.element.io. [See docs.](https://handbook.element.io/books/element-web-team/page/deploying-appstagingelementio)
- [ ] Test staging.element.io - [ ] Test staging.element.io
For final releases additionally do these steps: For final releases additionally do these steps:
@@ -227,9 +225,6 @@ For final releases additionally do these steps:
- [ ] Ensure Element Web package has shipped to packages.element.io - [ ] Ensure Element Web package has shipped to packages.element.io
- [ ] Ensure Element Desktop packages have shipped to packages.element.io - [ ] Ensure Element Desktop packages have shipped to packages.element.io
If you need to roll back a deployment to staging.element.io,
you can run the `deploy.yml` automation choosing an older tag which you wish to deploy.
# Housekeeping # Housekeeping
We have some manual housekeeping to do in order to prepare for the next release. We have some manual housekeeping to do in order to prepare for the next release.

View File

@@ -2,7 +2,7 @@
Copyright 2024 New Vector Ltd. Copyright 2024 New Vector Ltd.
Copyright 2023 The Matrix.org Foundation C.I.C. Copyright 2023 The Matrix.org Foundation C.I.C.
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
Please see LICENSE files in the repository root for full details. Please see LICENSE files in the repository root for full details.
*/ */
@@ -14,8 +14,6 @@ const config: Config = {
testEnvironment: "jsdom", testEnvironment: "jsdom",
testEnvironmentOptions: { testEnvironmentOptions: {
url: "http://localhost/", url: "http://localhost/",
// This is needed to be able to load dual CJS/ESM WASM packages e.g. rust crypto & matrix-wywiwyg
customExportConditions: ["browser", "node"],
}, },
testMatch: ["<rootDir>/test/**/*-test.[tj]s?(x)"], testMatch: ["<rootDir>/test/**/*-test.[tj]s?(x)"],
globalSetup: "<rootDir>/test/globalSetup.ts", globalSetup: "<rootDir>/test/globalSetup.ts",

13
knip.ts
View File

@@ -10,13 +10,13 @@ export default {
"playwright/**", "playwright/**",
"test/**", "test/**",
"res/decoder-ring/**", "res/decoder-ring/**",
"res/jitsi_external_api.min.js",
"docs/**",
// Used by jest
"__mocks__/maplibre-gl.js",
], ],
project: ["**/*.{js,ts,jsx,tsx}"], project: ["**/*.{js,ts,jsx,tsx}"],
ignore: [ ignore: [
"docs/**",
"res/jitsi_external_api.min.js",
// Used by jest
"__mocks__/maplibre-gl.js",
// Keep for now // Keep for now
"src/hooks/useLocalStorageState.ts", "src/hooks/useLocalStorageState.ts",
"src/components/views/elements/InfoTooltip.tsx", "src/components/views/elements/InfoTooltip.tsx",
@@ -37,8 +37,13 @@ export default {
// False positive // False positive
"sw.js", "sw.js",
// Used by webpack // Used by webpack
"buffer",
"process", "process",
"util", "util",
// Used by workflows
"ts-prune",
// Required due to bug in bloom-filters https://github.com/Callidon/bloom-filters/issues/75
"@types/seedrandom",
], ],
ignoreBinaries: [ ignoreBinaries: [
// Used in scripts & workflows // Used in scripts & workflows

View File

@@ -1,7 +1,7 @@
/* /*
Copyright 2022-2024 New Vector Ltd. Copyright 2022-2024 New Vector Ltd.
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
Please see LICENSE files in the repository root for full details. Please see LICENSE files in the repository root for full details.
*/ */

View File

@@ -1,7 +1,7 @@
/* /*
Copyright 2022-2024 New Vector Ltd. Copyright 2022-2024 New Vector Ltd.
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
Please see LICENSE files in the repository root for full details. Please see LICENSE files in the repository root for full details.
*/ */

View File

@@ -1,7 +1,7 @@
/* /*
Copyright 2022-2024 New Vector Ltd. Copyright 2022-2024 New Vector Ltd.
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
Please see LICENSE files in the repository root for full details. Please see LICENSE files in the repository root for full details.
*/ */

View File

@@ -1,6 +1,6 @@
server { server {
listen ${ELEMENT_WEB_PORT}; listen 80;
listen [::]:${ELEMENT_WEB_PORT}; listen [::]:80;
server_name localhost; server_name localhost;
root /usr/share/nginx/html; root /usr/share/nginx/html;

View File

@@ -1,13 +1,13 @@
{ {
"name": "element-web", "name": "element-web",
"version": "1.11.90", "version": "1.11.87",
"description": "A feature-rich client for Matrix.org", "description": "A feature-rich client for Matrix.org",
"author": "New Vector Ltd.", "author": "New Vector Ltd.",
"repository": { "repository": {
"type": "git", "type": "git",
"url": "https://github.com/element-hq/element-web" "url": "https://github.com/element-hq/element-web"
}, },
"license": "SEE LICENSE IN README.md", "license": "AGPL-3.0-only OR GPL-3.0-only",
"files": [ "files": [
"lib", "lib",
"res", "res",
@@ -64,17 +64,20 @@
"test:playwright:open": "yarn test:playwright --ui", "test:playwright:open": "yarn test:playwright --ui",
"test:playwright:screenshots": "yarn test:playwright:screenshots:build && yarn test:playwright:screenshots:run", "test:playwright:screenshots": "yarn test:playwright:screenshots:build && yarn test:playwright:screenshots:run",
"test:playwright:screenshots:build": "docker build playwright -t element-web-playwright", "test:playwright:screenshots:build": "docker build playwright -t element-web-playwright",
"test:playwright:screenshots:run": "docker run --rm --network host -e BASE_URL -e CI -v $(pwd):/work/ -v $(node -e 'console.log(require(`path`).dirname(require.resolve(`matrix-js-sdk/package.json`)))'):/work/node_modules/matrix-js-sdk -v /var/run/docker.sock:/var/run/docker.sock -v /tmp/:/tmp/ -it element-web-playwright --grep @screenshot --project=Chrome", "test:playwright:screenshots:run": "docker run --rm --network host -e BASE_URL -e CI -v $(pwd):/work/ -v $(node -e 'console.log(require(`path`).dirname(require.resolve(`matrix-js-sdk/package.json`)))'):/work/node_modules/matrix-js-sdk -v /var/run/docker.sock:/var/run/docker.sock -v /tmp/:/tmp/ -it element-web-playwright --grep @screenshot",
"coverage": "yarn test --coverage", "coverage": "yarn test --coverage",
"analyse:unused-exports": "ts-node ./scripts/analyse_unused_exports.ts",
"analyse:webpack-bundles": "webpack-bundle-analyzer webpack-stats.json webapp", "analyse:webpack-bundles": "webpack-bundle-analyzer webpack-stats.json webapp",
"update:jitsi": "curl -s https://meet.element.io/libs/external_api.min.js > ./res/jitsi_external_api.min.js" "update:jitsi": "curl -s https://meet.element.io/libs/external_api.min.js > ./res/jitsi_external_api.min.js"
}, },
"resolutions": { "resolutions": {
"@types/react": "18.3.18", "@types/react": "19.0.0",
"@types/react-dom": "18.3.5", "@types/react-dom": "19.0.0",
"oidc-client-ts": "3.1.0", "oidc-client-ts": "3.1.0",
"jwt-decode": "4.0.0", "jwt-decode": "4.0.0",
"caniuse-lite": "1.0.30001692", "caniuse-lite": "1.0.30001684",
"react": "19.0.0",
"react-dom": "19.0.0",
"wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0", "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0",
"wrap-ansi": "npm:wrap-ansi@^7.0.0" "wrap-ansi": "npm:wrap-ansi@^7.0.0"
}, },
@@ -88,11 +91,9 @@
"@matrix-org/react-sdk-module-api": "^2.4.0", "@matrix-org/react-sdk-module-api": "^2.4.0",
"@matrix-org/spec": "^1.7.0", "@matrix-org/spec": "^1.7.0",
"@sentry/browser": "^8.0.0", "@sentry/browser": "^8.0.0",
"@types/png-chunks-extract": "^1.0.2", "@vector-im/compound-design-tokens": "^2.0.1",
"@types/react-virtualized": "^9.21.30", "@vector-im/compound-web": "^7.4.0",
"@vector-im/compound-design-tokens": "^2.1.0", "@vector-im/matrix-wysiwyg": "2.37.13",
"@vector-im/compound-web": "^7.5.0",
"@vector-im/matrix-wysiwyg": "2.38.0",
"@zxcvbn-ts/core": "^3.0.4", "@zxcvbn-ts/core": "^3.0.4",
"@zxcvbn-ts/language-common": "^3.0.4", "@zxcvbn-ts/language-common": "^3.0.4",
"@zxcvbn-ts/language-en": "^3.0.2", "@zxcvbn-ts/language-en": "^3.0.2",
@@ -124,11 +125,11 @@
"linkify-string": "4.2.0", "linkify-string": "4.2.0",
"linkifyjs": "4.2.0", "linkifyjs": "4.2.0",
"lodash": "^4.17.21", "lodash": "^4.17.21",
"maplibre-gl": "^5.0.0", "maplibre-gl": "^4.0.0",
"matrix-encrypt-attachment": "^1.0.3", "matrix-encrypt-attachment": "^1.0.3",
"matrix-events-sdk": "0.0.1", "matrix-events-sdk": "0.0.1",
"matrix-js-sdk": "github:matrix-org/matrix-js-sdk#develop", "matrix-js-sdk": "github:matrix-org/matrix-js-sdk#develop",
"matrix-widget-api": "1.11.0", "matrix-widget-api": "^1.10.0",
"memoize-one": "^6.0.0", "memoize-one": "^6.0.0",
"mime": "^4.0.4", "mime": "^4.0.4",
"oidc-client-ts": "^3.0.1", "oidc-client-ts": "^3.0.1",
@@ -137,17 +138,16 @@
"png-chunks-extract": "^1.0.0", "png-chunks-extract": "^1.0.0",
"posthog-js": "1.157.2", "posthog-js": "1.157.2",
"qrcode": "1.5.4", "qrcode": "1.5.4",
"re-resizable": "6.10.3", "re-resizable": "6.10.1",
"react": "^18.3.1", "react": "^19",
"react-beautiful-dnd": "^13.1.0", "react-beautiful-dnd": "^13.1.0",
"react-blurhash": "^0.3.0", "react-blurhash": "^0.3.0",
"react-dom": "^18.3.1", "react-dom": "^19",
"react-focus-lock": "^2.5.1", "react-focus-lock": "^2.5.1",
"react-transition-group": "^4.4.1", "react-transition-group": "^4.4.1",
"react-virtualized": "^9.22.5",
"rfc4648": "^1.4.0", "rfc4648": "^1.4.0",
"sanitize-filename": "^1.6.3", "sanitize-filename": "^1.6.3",
"sanitize-html": "2.14.0", "sanitize-html": "2.13.1",
"tar-js": "^0.3.0", "tar-js": "^0.3.0",
"temporal-polyfill": "^0.2.5", "temporal-polyfill": "^0.2.5",
"ua-parser-js": "^1.0.2", "ua-parser-js": "^1.0.2",
@@ -178,13 +178,12 @@
"@peculiar/webcrypto": "^1.4.3", "@peculiar/webcrypto": "^1.4.3",
"@playwright/test": "^1.40.1", "@playwright/test": "^1.40.1",
"@principalstudio/html-webpack-inject-preload": "^1.2.7", "@principalstudio/html-webpack-inject-preload": "^1.2.7",
"@sentry/webpack-plugin": "^3.0.0", "@sentry/webpack-plugin": "^2.7.1",
"@stylistic/eslint-plugin": "^2.9.0", "@stylistic/eslint-plugin": "^2.9.0",
"@svgr/webpack": "^8.0.0", "@svgr/webpack": "^8.0.0",
"@testcontainers/postgresql": "^10.16.0",
"@testing-library/dom": "^10.4.0", "@testing-library/dom": "^10.4.0",
"@testing-library/jest-dom": "^6.4.8", "@testing-library/jest-dom": "^6.4.8",
"@testing-library/react": "^16.0.0", "@testing-library/react": "^16.1.0",
"@testing-library/user-event": "^14.5.2", "@testing-library/user-event": "^14.5.2",
"@types/commonmark": "^0.27.4", "@types/commonmark": "^0.27.4",
"@types/counterpart": "^0.18.1", "@types/counterpart": "^0.18.1",
@@ -193,6 +192,7 @@
"@types/escape-html": "^1.0.1", "@types/escape-html": "^1.0.1",
"@types/express": "^5.0.0", "@types/express": "^5.0.0",
"@types/file-saver": "^2.0.3", "@types/file-saver": "^2.0.3",
"@types/fs-extra": "^11.0.0",
"@types/glob-to-regexp": "^0.4.1", "@types/glob-to-regexp": "^0.4.1",
"@types/jest": "29.5.12", "@types/jest": "29.5.12",
"@types/jitsi-meet": "^2.0.2", "@types/jitsi-meet": "^2.0.2",
@@ -205,17 +205,17 @@
"@types/node-fetch": "^2.6.2", "@types/node-fetch": "^2.6.2",
"@types/pako": "^2.0.0", "@types/pako": "^2.0.0",
"@types/qrcode": "^1.3.5", "@types/qrcode": "^1.3.5",
"@types/react": "18.3.18", "@types/react": "^19",
"@types/react-beautiful-dnd": "^13.0.0", "@types/react-beautiful-dnd": "^13.0.0",
"@types/react-dom": "18.3.5", "@types/react-dom": "^19",
"@types/react-transition-group": "^4.4.0", "@types/react-transition-group": "^4.4.0",
"@types/sanitize-html": "2.13.0", "@types/sanitize-html": "2.13.0",
"@types/semver": "^7.5.8", "@types/semver": "^7.5.8",
"@types/tar-js": "^0.3.5", "@types/tar-js": "^0.3.5",
"@types/ua-parser-js": "^0.7.36", "@types/ua-parser-js": "^0.7.36",
"@types/uuid": "^10.0.0", "@types/uuid": "^10.0.0",
"@typescript-eslint/eslint-plugin": "^8.19.0", "@typescript-eslint/eslint-plugin": "^8.0.0",
"@typescript-eslint/parser": "^8.19.0", "@typescript-eslint/parser": "^8.0.0",
"babel-jest": "^29.0.0", "babel-jest": "^29.0.0",
"babel-loader": "^9.0.0", "babel-loader": "^9.0.0",
"babel-plugin-jsx-remove-data-test-id": "^3.0.0", "babel-plugin-jsx-remove-data-test-id": "^3.0.0",
@@ -230,14 +230,13 @@
"dotenv": "^16.0.2", "dotenv": "^16.0.2",
"eslint": "8.57.1", "eslint": "8.57.1",
"eslint-config-google": "^0.14.0", "eslint-config-google": "^0.14.0",
"eslint-config-prettier": "^10.0.0", "eslint-config-prettier": "^9.0.0",
"eslint-plugin-deprecate": "0.8.5", "eslint-plugin-deprecate": "0.8.5",
"eslint-plugin-import": "^2.25.4", "eslint-plugin-import": "^2.25.4",
"eslint-plugin-jest": "^28.0.0", "eslint-plugin-jest": "^28.0.0",
"eslint-plugin-jsx-a11y": "^6.5.1", "eslint-plugin-jsx-a11y": "^6.5.1",
"eslint-plugin-matrix-org": "^2.0.2", "eslint-plugin-matrix-org": "^2.0.2",
"eslint-plugin-react": "^7.28.0", "eslint-plugin-react": "^7.28.0",
"eslint-plugin-react-compiler": "^19.0.0-beta-df7b47d-20241124",
"eslint-plugin-react-hooks": "^5.0.0", "eslint-plugin-react-hooks": "^5.0.0",
"eslint-plugin-unicorn": "^56.0.0", "eslint-plugin-unicorn": "^56.0.0",
"express": "^4.18.2", "express": "^4.18.2",
@@ -245,6 +244,7 @@
"fetch-mock": "9.11.0", "fetch-mock": "9.11.0",
"fetch-mock-jest": "^1.5.1", "fetch-mock-jest": "^1.5.1",
"file-loader": "^6.0.0", "file-loader": "^6.0.0",
"fs-extra": "^11.0.0",
"glob": "^11.0.0", "glob": "^11.0.0",
"html-webpack-plugin": "^5.5.3", "html-webpack-plugin": "^5.5.3",
"husky": "^9.0.0", "husky": "^9.0.0",
@@ -258,12 +258,12 @@
"lint-staged": "^15.0.2", "lint-staged": "^15.0.2",
"mailhog": "^4.16.0", "mailhog": "^4.16.0",
"matrix-web-i18n": "^3.2.1", "matrix-web-i18n": "^3.2.1",
"mini-css-extract-plugin": "2.9.2", "mini-css-extract-plugin": "2.9.0",
"minimist": "^1.2.6", "minimist": "^1.2.6",
"modernizr": "^3.12.0", "modernizr": "^3.12.0",
"node-fetch": "^2.6.7", "node-fetch": "^2.6.7",
"playwright-core": "^1.45.1", "playwright-core": "^1.45.1",
"postcss": "8.4.46", "postcss": "8.4.38",
"postcss-easings": "^4.0.0", "postcss-easings": "^4.0.0",
"postcss-hexrgba": "2.1.0", "postcss-hexrgba": "2.1.0",
"postcss-import": "16.1.0", "postcss-import": "16.1.0",
@@ -273,28 +273,26 @@
"postcss-preset-env": "^10.0.0", "postcss-preset-env": "^10.0.0",
"postcss-scss": "^4.0.4", "postcss-scss": "^4.0.4",
"postcss-simple-vars": "^7.0.1", "postcss-simple-vars": "^7.0.1",
"prettier": "3.4.2", "prettier": "3.4.1",
"process": "^0.11.10", "process": "^0.11.10",
"raw-loader": "^4.0.2", "raw-loader": "^4.0.2",
"rimraf": "^6.0.0", "rimraf": "^6.0.0",
"semver": "^7.5.2", "semver": "^7.5.2",
"source-map-loader": "^5.0.0", "source-map-loader": "^5.0.0",
"strip-ansi": "^7.1.0",
"stylelint": "^16.1.0", "stylelint": "^16.1.0",
"stylelint-config-standard": "^36.0.0", "stylelint-config-standard": "^36.0.0",
"stylelint-scss": "^6.0.0", "stylelint-scss": "^6.0.0",
"stylelint-value-no-unknown-custom-properties": "^6.0.1", "stylelint-value-no-unknown-custom-properties": "^6.0.1",
"terser-webpack-plugin": "^5.3.9", "terser-webpack-plugin": "^5.3.9",
"testcontainers": "^10.16.0",
"ts-node": "^10.9.1", "ts-node": "^10.9.1",
"typescript": "5.7.3", "ts-prune": "^0.10.3",
"typescript": "5.6.3",
"util": "^0.12.5", "util": "^0.12.5",
"web-streams-polyfill": "^4.0.0", "web-streams-polyfill": "^4.0.0",
"webpack": "^5.89.0", "webpack": "^5.89.0",
"webpack-bundle-analyzer": "^4.8.0", "webpack-bundle-analyzer": "^4.8.0",
"webpack-cli": "^6.0.0", "webpack-cli": "^5.0.0",
"webpack-dev-server": "^5.0.0", "webpack-dev-server": "^5.0.0",
"webpack-retry-chunk-load-plugin": "^3.1.1",
"webpack-version-file-plugin": "^0.5.0", "webpack-version-file-plugin": "^0.5.0",
"yaml": "^2.3.3" "yaml": "^2.3.3"
}, },

View File

@@ -2,80 +2,25 @@
Copyright 2024 New Vector Ltd. Copyright 2024 New Vector Ltd.
Copyright 2023 The Matrix.org Foundation C.I.C. Copyright 2023 The Matrix.org Foundation C.I.C.
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
Please see LICENSE files in the repository root for full details. Please see LICENSE files in the repository root for full details.
*/ */
import { defineConfig, devices } from "@playwright/test"; import { defineConfig, devices } from "@playwright/test";
import { Options } from "./playwright/services";
const baseURL = process.env["BASE_URL"] ?? "http://localhost:8080"; const baseURL = process.env["BASE_URL"] ?? "http://localhost:8080";
const chromeProject = { export default defineConfig({
...devices["Desktop Chrome"], projects: [{ name: "Chrome", use: { ...devices["Desktop Chrome"], channel: "chromium" } }],
channel: "chromium",
permissions: ["clipboard-write", "clipboard-read", "microphone"],
launchOptions: {
args: ["--use-fake-ui-for-media-stream", "--use-fake-device-for-media-stream", "--mute-audio"],
},
};
export default defineConfig<Options>({
projects: [
{
name: "Chrome",
use: {
...chromeProject,
},
},
{
name: "Firefox",
use: {
...devices["Desktop Firefox"],
launchOptions: {
firefoxUserPrefs: {
"permissions.default.microphone": 1,
},
},
// This is needed to work around an issue between Playwright routes, Firefox, and Service workers
// https://github.com/microsoft/playwright/issues/33561#issuecomment-2471642120
serviceWorkers: "block",
},
ignoreSnapshots: true,
},
{
name: "WebKit",
use: {
...devices["Desktop Safari"],
// Seemingly WebKit has the same issue as Firefox in Playwright routes not working
// https://playwright.dev/docs/network#missing-network-events-and-service-workers
serviceWorkers: "block",
},
ignoreSnapshots: true,
},
{
name: "Dendrite",
use: {
...chromeProject,
homeserverType: "dendrite",
},
ignoreSnapshots: true,
},
{
name: "Pinecone",
use: {
...chromeProject,
homeserverType: "pinecone",
},
ignoreSnapshots: true,
},
],
use: { use: {
viewport: { width: 1280, height: 720 }, viewport: { width: 1280, height: 720 },
ignoreHTTPSErrors: true, ignoreHTTPSErrors: true,
video: "retain-on-failure", video: "retain-on-failure",
baseURL, baseURL,
permissions: ["clipboard-write", "clipboard-read", "microphone"],
launchOptions: {
args: ["--use-fake-ui-for-media-stream", "--use-fake-device-for-media-stream", "--mute-audio"],
},
trace: "on-first-retry", trace: "on-first-retry",
}, },
webServer: { webServer: {

View File

@@ -2,7 +2,7 @@
Copyright 2024 New Vector Ltd. Copyright 2024 New Vector Ltd.
Copyright 2024 The Matrix.org Foundation C.I.C. Copyright 2024 The Matrix.org Foundation C.I.C.
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
Please see LICENSE files in the repository root for full details. Please see LICENSE files in the repository root for full details.
*/ */

View File

@@ -1,4 +1,4 @@
FROM mcr.microsoft.com/playwright:v1.49.1-noble FROM mcr.microsoft.com/playwright:v1.49.0-noble
WORKDIR /work WORKDIR /work

View File

@@ -2,7 +2,7 @@
Copyright 2024 New Vector Ltd. Copyright 2024 New Vector Ltd.
Copyright 2024 The Matrix.org Foundation C.I.C. Copyright 2024 The Matrix.org Foundation C.I.C.
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
Please see LICENSE files in the repository root for full details. Please see LICENSE files in the repository root for full details.
*/ */
@@ -123,7 +123,7 @@ test.describe("Landmark navigation tests", () => {
await expect(page.getByText("Bob joined the room")).toBeVisible(); await expect(page.getByText("Bob joined the room")).toBeVisible();
// Close the room // Close the room
await page.goto("/#/home"); page.goto("/#/home");
// Pressing Control+F6 will first focus the space button // Pressing Control+F6 will first focus the space button
await page.keyboard.press("ControlOrMeta+F6"); await page.keyboard.press("ControlOrMeta+F6");

View File

@@ -2,7 +2,7 @@
Copyright 2024 New Vector Ltd. Copyright 2024 New Vector Ltd.
Copyright 2024 The Matrix.org Foundation C.I.C. Copyright 2024 The Matrix.org Foundation C.I.C.
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
Please see LICENSE files in the repository root for full details. Please see LICENSE files in the repository root for full details.
*/ */

View File

@@ -2,7 +2,7 @@
Copyright 2024 New Vector Ltd. Copyright 2024 New Vector Ltd.
Copyright 2024 The Matrix.org Foundation C.I.C. Copyright 2024 The Matrix.org Foundation C.I.C.
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
Please see LICENSE files in the repository root for full details. Please see LICENSE files in the repository root for full details.
*/ */
@@ -13,8 +13,13 @@ Please see LICENSE files in the repository root for full details.
import { expect, test } from "../../element-web-test"; import { expect, test } from "../../element-web-test";
test.use({ test.use({
synapseConfig: { startHomeserverOpts: "guest-enabled",
allow_guest_access: true, config: async ({ homeserver }, use) => {
await use({
default_server_config: {
"m.homeserver": { base_url: homeserver.config.baseUrl },
},
});
}, },
}); });

View File

@@ -2,7 +2,7 @@
Copyright 2024 New Vector Ltd. Copyright 2024 New Vector Ltd.
Copyright 2024 The Matrix.org Foundation C.I.C. Copyright 2024 The Matrix.org Foundation C.I.C.
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
Please see LICENSE files in the repository root for full details. Please see LICENSE files in the repository root for full details.
*/ */

View File

@@ -3,7 +3,7 @@ Copyright 2024 New Vector Ltd.
Copyright 2023 Suguru Hirahara Copyright 2023 Suguru Hirahara
Copyright 2023 The Matrix.org Foundation C.I.C. Copyright 2023 The Matrix.org Foundation C.I.C.
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
Please see LICENSE files in the repository root for full details. Please see LICENSE files in the repository root for full details.
*/ */
@@ -13,15 +13,7 @@ import { SettingLevel } from "../../../src/settings/SettingLevel";
import { Layout } from "../../../src/settings/enums/Layout"; import { Layout } from "../../../src/settings/enums/Layout";
import { ElementAppPage } from "../../pages/ElementAppPage"; import { ElementAppPage } from "../../pages/ElementAppPage";
// Find and click "Reply" button test.describe("Audio player", () => {
const clickButtonReply = async (tile: Locator) => {
await expect(async () => {
await tile.hover();
await tile.getByRole("button", { name: "Reply", exact: true }).click();
}).toPass();
};
test.describe("Audio player", { tag: ["@no-firefox", "@no-webkit"] }, () => {
test.use({ test.use({
displayName: "Hanako", displayName: "Hanako",
}); });
@@ -230,7 +222,8 @@ test.describe("Audio player", { tag: ["@no-firefox", "@no-webkit"] }, () => {
// Find and click "Reply" button on MessageActionBar // Find and click "Reply" button on MessageActionBar
const tile = page.locator(".mx_EventTile_last"); const tile = page.locator(".mx_EventTile_last");
await clickButtonReply(tile); await tile.hover();
await tile.getByRole("button", { name: "Reply", exact: true }).click();
// Reply to the player with another audio file // Reply to the player with another audio file
await uploadFile(page, "playwright/sample-files/1sec.ogg"); await uploadFile(page, "playwright/sample-files/1sec.ogg");
@@ -258,12 +251,19 @@ test.describe("Audio player", { tag: ["@no-firefox", "@no-webkit"] }, () => {
const tile = page.locator(".mx_EventTile_last"); const tile = page.locator(".mx_EventTile_last");
// Find and click "Reply" button
const clickButtonReply = async () => {
await tile.scrollIntoViewIfNeeded();
await tile.hover();
await tile.getByRole("button", { name: "Reply", exact: true }).click();
};
await uploadFile(page, "playwright/sample-files/upload-first.ogg"); await uploadFile(page, "playwright/sample-files/upload-first.ogg");
// Assert that the audio player is rendered // Assert that the audio player is rendered
await expect(page.locator(".mx_EventTile_last .mx_AudioPlayer_container")).toBeVisible(); await expect(page.locator(".mx_EventTile_last .mx_AudioPlayer_container")).toBeVisible();
await clickButtonReply(tile); await clickButtonReply();
// Reply to the player with another audio file // Reply to the player with another audio file
await uploadFile(page, "playwright/sample-files/upload-second.ogg"); await uploadFile(page, "playwright/sample-files/upload-second.ogg");
@@ -271,7 +271,7 @@ test.describe("Audio player", { tag: ["@no-firefox", "@no-webkit"] }, () => {
// Assert that the audio player is rendered // Assert that the audio player is rendered
await expect(page.locator(".mx_EventTile_last .mx_AudioPlayer_container")).toBeVisible(); await expect(page.locator(".mx_EventTile_last .mx_AudioPlayer_container")).toBeVisible();
await clickButtonReply(tile); await clickButtonReply();
// Reply to the player with yet another audio file to create a reply chain // Reply to the player with yet another audio file to create a reply chain
await uploadFile(page, "playwright/sample-files/upload-third.ogg"); await uploadFile(page, "playwright/sample-files/upload-third.ogg");

View File

@@ -2,7 +2,7 @@
Copyright 2024 New Vector Ltd. Copyright 2024 New Vector Ltd.
Copyright 2024 The Matrix.org Foundation C.I.C. Copyright 2024 The Matrix.org Foundation C.I.C.
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
Please see LICENSE files in the repository root for full details. Please see LICENSE files in the repository root for full details.
*/ */
@@ -95,7 +95,7 @@ test.describe("HTML Export", () => {
async ({ page, app, room }) => { async ({ page, app, room }) => {
// Set a fixed time rather than masking off the line with the time in it: we don't need to worry // Set a fixed time rather than masking off the line with the time in it: we don't need to worry
// about the width changing and we can actually test this line looks correct. // about the width changing and we can actually test this line looks correct.
await page.clock.setSystemTime(new Date("2024-01-01T00:00:00Z")); page.clock.setSystemTime(new Date("2024-01-01T00:00:00Z"));
// Send a bunch of messages to populate the room // Send a bunch of messages to populate the room
for (let i = 1; i < 10; i++) { for (let i = 1; i < 10; i++) {

View File

@@ -2,7 +2,7 @@
Copyright 2024 New Vector Ltd. Copyright 2024 New Vector Ltd.
Copyright 2022, 2023 The Matrix.org Foundation C.I.C. Copyright 2022, 2023 The Matrix.org Foundation C.I.C.
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
Please see LICENSE files in the repository root for full details. Please see LICENSE files in the repository root for full details.
*/ */

View File

@@ -2,7 +2,7 @@
Copyright 2024 New Vector Ltd. Copyright 2024 New Vector Ltd.
Copyright 2022, 2023 The Matrix.org Foundation C.I.C. Copyright 2022, 2023 The Matrix.org Foundation C.I.C.
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
Please see LICENSE files in the repository root for full details. Please see LICENSE files in the repository root for full details.
*/ */
@@ -79,8 +79,9 @@ test.describe("Composer", () => {
// Enter some more text, then send the message // Enter some more text, then send the message
await page.getByRole("textbox").pressSequentially("this is the spoiler text "); await page.getByRole("textbox").pressSequentially("this is the spoiler text ");
await page.getByRole("button", { name: "Send message" }).click(); await page.getByRole("button", { name: "Send message" }).click();
// Check that a spoiler item has appeared in the timeline and contains the spoiler text // Check that a spoiler item has appeared in the timeline and locator the spoiler command text
await expect(page.locator("button.mx_EventTile_spoiler")).toHaveText("this is the spoiler text"); await expect(page.locator("button.mx_EventTile_spoiler")).toBeVisible();
await expect(page.getByText("this is the spoiler text")).toBeVisible();
}); });
}); });
}); });
@@ -165,7 +166,7 @@ test.describe("Composer", () => {
// Type another // Type another
await page.locator("div[contenteditable=true]").pressSequentially("my message 1"); await page.locator("div[contenteditable=true]").pressSequentially("my message 1");
// Send message // Send message
await page.locator("div[contenteditable=true]").press("Enter"); page.locator("div[contenteditable=true]").press("Enter");
// It was sent // It was sent
await expect(page.locator(".mx_EventTile_last .mx_EventTile_body").getByText("my message 1")).toBeVisible(); await expect(page.locator(".mx_EventTile_last .mx_EventTile_body").getByText("my message 1")).toBeVisible();
}); });

View File

@@ -2,7 +2,7 @@
Copyright 2024 New Vector Ltd. Copyright 2024 New Vector Ltd.
Copyright 2022, 2023 The Matrix.org Foundation C.I.C. Copyright 2022, 2023 The Matrix.org Foundation C.I.C.
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
Please see LICENSE files in the repository root for full details. Please see LICENSE files in the repository root for full details.
*/ */
@@ -27,7 +27,7 @@ test.describe("Create Room", () => {
// Submit // Submit
await dialog.getByRole("button", { name: "Create room" }).click(); await dialog.getByRole("button", { name: "Create room" }).click();
await expect(page).toHaveURL(new RegExp(`/#/room/#test-room-1:${user.homeServer}`)); await expect(page).toHaveURL(/\/#\/room\/#test-room-1:localhost/);
const header = page.locator(".mx_RoomHeader"); const header = page.locator(".mx_RoomHeader");
await expect(header).toContainText(name); await expect(header).toContainText(name);
}); });

View File

@@ -1,95 +0,0 @@
/*
Copyright 2024 New Vector Ltd.
Copyright 2023 The Matrix.org Foundation C.I.C.
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial
Please see LICENSE files in the repository root for full details.
*/
import { test, expect } from "../../element-web-test";
import { registerAccountMas } from "../oidc";
import { isDendrite } from "../../plugins/homeserver/dendrite";
import { TestClientServerAPI } from "../csAPI";
import { masHomeserver } from "../../plugins/homeserver/synapse/masHomeserver.ts";
// These tests register an account with MAS because then we go through the "normal" registration flow
// and crypto gets set up. Using the 'user' fixture create a user and synthesizes an existing login,
// which is faster but leaves us without crypto set up.
test.use(masHomeserver);
test.describe("Encryption state after registration", () => {
test.skip(isDendrite, "does not yet support MAS");
test("Key backup is enabled by default", async ({ page, mailhogClient, app }, testInfo) => {
await page.goto("/#/login");
await page.getByRole("button", { name: "Continue" }).click();
await registerAccountMas(page, mailhogClient, `alice_${testInfo.testId}`, "alice@email.com", "Pa$sW0rD!");
await app.settings.openUserSettings("Security & Privacy");
await expect(page.getByText("This session is backing up your keys.")).toBeVisible();
});
test("user is prompted to set up recovery", async ({ page, mailhogClient, app }, testInfo) => {
await page.goto("/#/login");
await page.getByRole("button", { name: "Continue" }).click();
await registerAccountMas(page, mailhogClient, `alice_${testInfo.testId}`, "alice@email.com", "Pa$sW0rD!");
await page.getByRole("button", { name: "Add room" }).click();
await page.getByRole("menuitem", { name: "New room" }).click();
await page.getByRole("textbox", { name: "Name" }).fill("test room");
await page.getByRole("button", { name: "Create room" }).click();
await expect(page.getByRole("heading", { name: "Set up recovery" })).toBeVisible();
});
});
test.describe("Key backup reset from elsewhere", () => {
test.skip(isDendrite, "does not yet support MAS");
test("Key backup is disabled when reset from elsewhere", async ({
page,
mailhogClient,
request,
homeserver,
}, testInfo) => {
const testUsername = `alice_${testInfo.testId}`;
const testPassword = "Pa$sW0rD!";
// there's a delay before keys are uploaded so the error doesn't appear immediately: use a fake
// clock so we can skip the delay
await page.clock.install();
await page.goto("/#/login");
await page.getByRole("button", { name: "Continue" }).click();
await registerAccountMas(page, mailhogClient, testUsername, "alice@email.com", testPassword);
await page.getByRole("button", { name: "Add room" }).click();
await page.getByRole("menuitem", { name: "New room" }).click();
await page.getByRole("textbox", { name: "Name" }).fill("test room");
await page.getByRole("button", { name: "Create room" }).click();
const accessToken = await page.evaluate(() => window.mxMatrixClientPeg.get().getAccessToken());
const csAPI = new TestClientServerAPI(request, homeserver, accessToken);
const backupInfo = await csAPI.getCurrentBackupInfo();
await csAPI.deleteBackupVersion(backupInfo.version);
await page.getByRole("textbox", { name: "Send an encrypted message…" }).fill("/discardsession");
await page.getByRole("button", { name: "Send message" }).click();
await page.getByRole("textbox", { name: "Send an encrypted message…" }).fill("Message with broken key backup");
await page.getByRole("button", { name: "Send message" }).click();
// Should be the message we sent plus the room creation event
await expect(page.locator(".mx_EventTile")).toHaveCount(2);
await expect(
page.locator(".mx_RoomView_MessageList > .mx_EventTile_last .mx_EventTile_receiptSent"),
).toBeVisible();
// Wait for it to try uploading the key
await page.clock.fastForward(20000);
await expect(page.getByRole("heading", { level: 1, name: "New Recovery Method" })).toBeVisible();
});
});

View File

@@ -2,14 +2,13 @@
Copyright 2024 New Vector Ltd. Copyright 2024 New Vector Ltd.
Copyright 2023 The Matrix.org Foundation C.I.C. Copyright 2023 The Matrix.org Foundation C.I.C.
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
Please see LICENSE files in the repository root for full details. Please see LICENSE files in the repository root for full details.
*/ */
import { type Page } from "@playwright/test"; import { type Page } from "@playwright/test";
import { test, expect } from "../../element-web-test"; import { test, expect } from "../../element-web-test";
import { isDendrite } from "../../plugins/homeserver/dendrite";
async function expectBackupVersionToBe(page: Page, version: string) { async function expectBackupVersionToBe(page: Page, version: string) {
await expect(page.locator(".mx_SecureBackupPanel_statusList tr:nth-child(5) td")).toHaveText( await expect(page.locator(".mx_SecureBackupPanel_statusList tr:nth-child(5) td")).toHaveText(
@@ -20,15 +19,11 @@ async function expectBackupVersionToBe(page: Page, version: string) {
} }
test.describe("Backups", () => { test.describe("Backups", () => {
test.skip(isDendrite, "Dendrite lacks support for MSC3967 so requires additional auth here");
test.use({ test.use({
displayName: "Hanako", displayName: "Hanako",
}); });
test( test("Create, delete and recreate a keys backup", async ({ page, user, app }, workerInfo) => {
"Create, delete and recreate a keys backup",
{ tag: "@no-webkit" },
async ({ page, user, app }, workerInfo) => {
// Create a backup // Create a backup
const securityTab = await app.settings.openUserSettings("Security & Privacy"); const securityTab = await app.settings.openUserSettings("Security & Privacy");
@@ -113,6 +108,5 @@ test.describe("Backups", () => {
// go back to the settings to check that no backup was created (the setup button should still be there) // go back to the settings to check that no backup was created (the setup button should still be there)
await app.settings.openUserSettings("Security & Privacy"); await app.settings.openUserSettings("Security & Privacy");
await expect(securityTab.getByRole("button", { name: "Set up", exact: true })).toBeVisible(); await expect(securityTab.getByRole("button", { name: "Set up", exact: true })).toBeVisible();
}, });
);
}); });

View File

@@ -2,16 +2,14 @@
Copyright 2024 New Vector Ltd. Copyright 2024 New Vector Ltd.
Copyright 2023 The Matrix.org Foundation C.I.C. Copyright 2023 The Matrix.org Foundation C.I.C.
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
Please see LICENSE files in the repository root for full details. Please see LICENSE files in the repository root for full details.
*/ */
import { test, expect } from "../../element-web-test"; import { test, expect } from "../../element-web-test";
import { logIntoElement } from "./utils"; import { logIntoElement } from "./utils";
import { isDendrite } from "../../plugins/homeserver/dendrite";
test.describe("Complete security", () => { test.describe("Complete security", () => {
test.skip(isDendrite, "Dendrite lacks support for MSC3967 so requires additional auth here");
test.use({ test.use({
displayName: "Jeff", displayName: "Jeff",
}); });
@@ -21,9 +19,9 @@ test.describe("Complete security", () => {
homeserver, homeserver,
credentials, credentials,
}) => { }) => {
await logIntoElement(page, credentials); await logIntoElement(page, homeserver, credentials);
await expect(page.getByText("Welcome Jeff", { exact: true })).toBeVisible(); await expect(page.getByText("Welcome Jeff", { exact: true })).toBeVisible();
}); });
// see also "Verify device during login with SAS" in `verification.spec.ts`. // see also "Verify device during login with SAS" in `verifiction.spec.ts`.
}); });

View File

@@ -2,7 +2,7 @@
Copyright 2024 New Vector Ltd. Copyright 2024 New Vector Ltd.
Copyright 2022-2024 The Matrix.org Foundation C.I.C. Copyright 2022-2024 The Matrix.org Foundation C.I.C.
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
Please see LICENSE files in the repository root for full details. Please see LICENSE files in the repository root for full details.
*/ */
@@ -11,7 +11,6 @@ import { expect, test } from "../../element-web-test";
import { autoJoin, copyAndContinue, createSharedRoomWithUser, enableKeyBackup, verify } from "./utils"; import { autoJoin, copyAndContinue, createSharedRoomWithUser, enableKeyBackup, verify } from "./utils";
import { Bot } from "../../pages/bot"; import { Bot } from "../../pages/bot";
import { ElementAppPage } from "../../pages/ElementAppPage"; import { ElementAppPage } from "../../pages/ElementAppPage";
import { isDendrite } from "../../plugins/homeserver/dendrite";
const checkDMRoom = async (page: Page) => { const checkDMRoom = async (page: Page) => {
const body = page.locator(".mx_RoomView_body"); const body = page.locator(".mx_RoomView_body");
@@ -68,7 +67,6 @@ const bobJoin = async (page: Page, bob: Bot) => {
}; };
test.describe("Cryptography", function () { test.describe("Cryptography", function () {
test.skip(isDendrite, "Dendrite lacks support for MSC3967 so requires additional auth here");
test.use({ test.use({
displayName: "Alice", displayName: "Alice",
botCreateOpts: { botCreateOpts: {
@@ -83,7 +81,7 @@ test.describe("Cryptography", function () {
* Verify that the `m.cross_signing.${keyType}` key is available on the account data on the server * Verify that the `m.cross_signing.${keyType}` key is available on the account data on the server
* @param keyType * @param keyType
*/ */
async function verifyKey(app: ElementAppPage, keyType: "master" | "self_signing" | "user_signing") { async function verifyKey(app: ElementAppPage, keyType: string) {
const accountData: { encrypted: Record<string, Record<string, string>> } = await app.client.evaluate( const accountData: { encrypted: Record<string, Record<string, string>> } = await app.client.evaluate(
(cli, keyType) => cli.getAccountDataFromServer(`m.cross_signing.${keyType}`), (cli, keyType) => cli.getAccountDataFromServer(`m.cross_signing.${keyType}`),
keyType, keyType,

View File

@@ -2,7 +2,7 @@
Copyright 2024 New Vector Ltd. Copyright 2024 New Vector Ltd.
Copyright 2022-2024 The Matrix.org Foundation C.I.C. Copyright 2022-2024 The Matrix.org Foundation C.I.C.
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
Please see LICENSE files in the repository root for full details. Please see LICENSE files in the repository root for full details.
*/ */
@@ -28,8 +28,6 @@ test.describe("Cryptography", function () {
}); });
test.describe("decryption failure messages", () => { test.describe("decryption failure messages", () => {
test.skip(isDendrite, "Dendrite lacks support for MSC3967 so requires additional auth here");
test("should handle device-relative historical messages", async ({ test("should handle device-relative historical messages", async ({
homeserver, homeserver,
page, page,
@@ -47,7 +45,7 @@ test.describe("Cryptography", function () {
await logOutOfElement(page, true); await logOutOfElement(page, true);
// Log in again, and see how the message looks. // Log in again, and see how the message looks.
await logIntoElement(page, credentials); await logIntoElement(page, homeserver, credentials);
await app.viewRoomByName("Test room"); await app.viewRoomByName("Test room");
const lastTile = page.locator(".mx_EventTile").last(); const lastTile = page.locator(".mx_EventTile").last();
await expect(lastTile).toContainText("Historical messages are not available on this device"); await expect(lastTile).toContainText("Historical messages are not available on this device");
@@ -64,7 +62,7 @@ test.describe("Cryptography", function () {
// Finally, log out again, and back in, skipping verification for now, and see what we see. // Finally, log out again, and back in, skipping verification for now, and see what we see.
await logOutOfElement(page); await logOutOfElement(page);
await logIntoElement(page, credentials); await logIntoElement(page, homeserver, credentials);
await page.locator(".mx_AuthPage").getByRole("button", { name: "Skip verification for now" }).click(); await page.locator(".mx_AuthPage").getByRole("button", { name: "Skip verification for now" }).click();
await page.locator(".mx_AuthPage").getByRole("button", { name: "I'll verify later" }).click(); await page.locator(".mx_AuthPage").getByRole("button", { name: "I'll verify later" }).click();
await app.viewRoomByName("Test room"); await app.viewRoomByName("Test room");

View File

@@ -2,34 +2,26 @@
Copyright 2024 New Vector Ltd. Copyright 2024 New Vector Ltd.
Copyright 2024 The Matrix.org Foundation C.I.C. Copyright 2024 The Matrix.org Foundation C.I.C.
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
Please see LICENSE files in the repository root for full details. Please see LICENSE files in the repository root for full details.
*/ */
import { Locator, type Page } from "@playwright/test"; import { Locator, type Page } from "@playwright/test";
import { test, expect } from "../../element-web-test"; import { test as base, expect } from "../../element-web-test";
import { viewRoomSummaryByName } from "../right-panel/utils"; import { viewRoomSummaryByName } from "../right-panel/utils";
import { isDendrite } from "../../plugins/homeserver/dendrite"; import { isDendrite } from "../../plugins/homeserver/dendrite";
const ROOM_NAME = "Test room"; const test = base.extend({
const NAME = "Alice"; // eslint-disable-next-line no-empty-pattern
startHomeserverOpts: async ({}, use) => {
function getMemberTileByName(page: Page, name: string): Locator { await use("dehydration");
return page.locator(`.mx_MemberTileView, [title="${name}"]`);
}
test.use({
displayName: NAME,
synapseConfig: {
experimental_features: {
msc2697_enabled: false,
msc3814_enabled: true,
}, },
}, config: async ({ homeserver, context }, use) => {
config: async ({ config, context }, use) => {
const wellKnown = { const wellKnown = {
...config.default_server_config, "m.homeserver": {
base_url: homeserver.config.baseUrl,
},
"org.matrix.msc3814": true, "org.matrix.msc3814": true,
}; };
@@ -37,14 +29,29 @@ test.use({
await route.fulfill({ json: wellKnown }); await route.fulfill({ json: wellKnown });
}); });
await use(config); await use({
default_server_config: wellKnown,
});
}, },
}); });
const ROOM_NAME = "Test room";
const NAME = "Alice";
function getMemberTileByName(page: Page, name: string): Locator {
return page.locator(`.mx_EntityTile, [title="${name}"]`);
}
test.describe("Dehydration", () => { test.describe("Dehydration", () => {
test.skip(isDendrite, "does not yet support dehydration v2"); test.skip(isDendrite, "does not yet support dehydration v2");
test.use({
displayName: NAME,
});
test("Create dehydrated device", async ({ page, user, app }, workerInfo) => { test("Create dehydrated device", async ({ page, user, app }, workerInfo) => {
test.skip(workerInfo.project.name === "Legacy Crypto", "This test only works with Rust crypto.");
// Create a backup (which will create SSSS, and dehydrated device) // Create a backup (which will create SSSS, and dehydrated device)
const securityTab = await app.settings.openUserSettings("Security & Privacy"); const securityTab = await app.settings.openUserSettings("Security & Privacy");
@@ -88,7 +95,7 @@ test.describe("Dehydration", () => {
await viewRoomSummaryByName(page, app, ROOM_NAME); await viewRoomSummaryByName(page, app, ROOM_NAME);
await page.locator(".mx_RightPanel").getByRole("menuitem", { name: "People" }).click(); await page.locator(".mx_RightPanel").getByRole("menuitem", { name: "People" }).click();
await expect(page.locator(".mx_MemberListView")).toBeVisible(); await expect(page.locator(".mx_MemberList")).toBeVisible();
await getMemberTileByName(page, NAME).click(); await getMemberTileByName(page, NAME).click();
await page.locator(".mx_UserInfo_devices .mx_UserInfo_expand").click(); await page.locator(".mx_UserInfo_devices .mx_UserInfo_expand").click();

View File

@@ -2,7 +2,7 @@
Copyright 2024 New Vector Ltd. Copyright 2024 New Vector Ltd.
Copyright 2023 The Matrix.org Foundation C.I.C. Copyright 2023 The Matrix.org Foundation C.I.C.
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
Please see LICENSE files in the repository root for full details. Please see LICENSE files in the repository root for full details.
*/ */
@@ -15,23 +15,42 @@ import {
awaitVerifier, awaitVerifier,
checkDeviceIsConnectedKeyBackup, checkDeviceIsConnectedKeyBackup,
checkDeviceIsCrossSigned, checkDeviceIsCrossSigned,
createBot,
doTwoWaySasVerification, doTwoWaySasVerification,
logIntoElement, logIntoElement,
waitForVerificationRequest, waitForVerificationRequest,
} from "./utils"; } from "./utils";
import { Bot } from "../../pages/bot"; import { Bot } from "../../pages/bot";
test.describe("Device verification", { tag: "@no-webkit" }, () => { test.describe("Device verification", () => {
let aliceBotClient: Bot; let aliceBotClient: Bot;
/** The backup version that was set up by the bot client. */ /** The backup version that was set up by the bot client. */
let expectedBackupVersion: string; let expectedBackupVersion: string;
test.beforeEach(async ({ page, homeserver, credentials }) => { test.beforeEach(async ({ page, homeserver, credentials }) => {
const res = await createBot(page, homeserver, credentials); // Visit the login page of the app, to load the matrix sdk
aliceBotClient = res.botClient; await page.goto("/#/login");
expectedBackupVersion = res.expectedBackupVersion;
// wait for the page to load
await page.waitForSelector(".mx_AuthPage", { timeout: 30000 });
// Create a new device for alice
aliceBotClient = new Bot(page, homeserver, {
bootstrapCrossSigning: true,
bootstrapSecretStorage: true,
});
aliceBotClient.setCredentials(credentials);
// Backup is prepared in the background. Poll until it is ready.
const botClientHandle = await aliceBotClient.prepareClient();
await expect
.poll(async () => {
expectedBackupVersion = await botClientHandle.evaluate((cli) =>
cli.getCrypto()!.getActiveSessionBackupVersion(),
);
return expectedBackupVersion;
})
.not.toBe(null);
}); });
// Click the "Verify with another device" button, and have the bot client auto-accept it. // Click the "Verify with another device" button, and have the bot client auto-accept it.
@@ -47,7 +66,7 @@ test.describe("Device verification", { tag: "@no-webkit" }, () => {
} }
test("Verify device with SAS during login", async ({ page, app, credentials, homeserver }) => { test("Verify device with SAS during login", async ({ page, app, credentials, homeserver }) => {
await logIntoElement(page, credentials); await logIntoElement(page, homeserver, credentials);
// Launch the verification request between alice and the bot // Launch the verification request between alice and the bot
const verificationRequest = await initiateAliceVerificationRequest(page); const verificationRequest = await initiateAliceVerificationRequest(page);
@@ -74,7 +93,7 @@ test.describe("Device verification", { tag: "@no-webkit" }, () => {
test("Verify device with QR code during login", async ({ page, app, credentials, homeserver }) => { test("Verify device with QR code during login", async ({ page, app, credentials, homeserver }) => {
// A mode 0x02 verification: "self-verifying in which the current device does not yet trust the master key" // A mode 0x02 verification: "self-verifying in which the current device does not yet trust the master key"
await logIntoElement(page, credentials); await logIntoElement(page, homeserver, credentials);
// Launch the verification request between alice and the bot // Launch the verification request between alice and the bot
const verificationRequest = await initiateAliceVerificationRequest(page); const verificationRequest = await initiateAliceVerificationRequest(page);
@@ -118,7 +137,7 @@ test.describe("Device verification", { tag: "@no-webkit" }, () => {
}); });
test("Verify device with Security Phrase during login", async ({ page, app, credentials, homeserver }) => { test("Verify device with Security Phrase during login", async ({ page, app, credentials, homeserver }) => {
await logIntoElement(page, credentials); await logIntoElement(page, homeserver, credentials);
// Select the security phrase // Select the security phrase
await page.locator(".mx_AuthPage").getByRole("button", { name: "Verify with Security Key or Phrase" }).click(); await page.locator(".mx_AuthPage").getByRole("button", { name: "Verify with Security Key or Phrase" }).click();
@@ -139,7 +158,7 @@ test.describe("Device verification", { tag: "@no-webkit" }, () => {
}); });
test("Verify device with Security Key during login", async ({ page, app, credentials, homeserver }) => { test("Verify device with Security Key during login", async ({ page, app, credentials, homeserver }) => {
await logIntoElement(page, credentials); await logIntoElement(page, homeserver, credentials);
// Select the security phrase // Select the security phrase
await page.locator(".mx_AuthPage").getByRole("button", { name: "Verify with Security Key or Phrase" }).click(); await page.locator(".mx_AuthPage").getByRole("button", { name: "Verify with Security Key or Phrase" }).click();
@@ -162,7 +181,7 @@ test.describe("Device verification", { tag: "@no-webkit" }, () => {
}); });
test("Handle incoming verification request with SAS", async ({ page, credentials, homeserver, toasts }) => { test("Handle incoming verification request with SAS", async ({ page, credentials, homeserver, toasts }) => {
await logIntoElement(page, credentials); await logIntoElement(page, homeserver, credentials);
/* Dismiss "Verify this device" */ /* Dismiss "Verify this device" */
const authPage = page.locator(".mx_AuthPage"); const authPage = page.locator(".mx_AuthPage");
@@ -193,17 +212,16 @@ test.describe("Device verification", { tag: "@no-webkit" }, () => {
/* on the bot side, wait for the verifier to exist ... */ /* on the bot side, wait for the verifier to exist ... */
const verifier = await awaitVerifier(botVerificationRequest); const verifier = await awaitVerifier(botVerificationRequest);
// ... confirm ... // ... confirm ...
void botVerificationRequest.evaluate((verificationRequest) => verificationRequest.verifier.verify()); botVerificationRequest.evaluate((verificationRequest) => verificationRequest.verifier.verify());
// ... and then check the emoji match // ... and then check the emoji match
await doTwoWaySasVerification(page, verifier); await doTwoWaySasVerification(page, verifier);
/* And we're all done! */ /* And we're all done! */
const infoDialog = page.locator(".mx_InfoDialog"); const infoDialog = page.locator(".mx_InfoDialog");
await infoDialog.getByRole("button", { name: "They match" }).click(); await infoDialog.getByRole("button", { name: "They match" }).click();
// We don't assert the full string as the device name is unset on Synapse but set to the user ID on Dendrite await expect(
await expect(infoDialog.getByText(`You've successfully verified`)).toContainText( infoDialog.getByText(`You've successfully verified (${aliceBotClient.credentials.deviceId})!`),
`(${aliceBotClient.credentials.deviceId})`, ).toBeVisible();
);
await infoDialog.getByRole("button", { name: "Got it" }).click(); await infoDialog.getByRole("button", { name: "Got it" }).click();
}); });
}); });

View File

@@ -2,7 +2,7 @@
Copyright 2024 New Vector Ltd. Copyright 2024 New Vector Ltd.
Copyright 2022-2024 The Matrix.org Foundation C.I.C. Copyright 2022-2024 The Matrix.org Foundation C.I.C.
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
Please see LICENSE files in the repository root for full details. Please see LICENSE files in the repository root for full details.
*/ */
@@ -53,8 +53,6 @@ test.describe("Cryptography", function () {
// Even though Alice has seen Bob's join event, Bob may not have done so yet. Wait for the sync to arrive. // Even though Alice has seen Bob's join event, Bob may not have done so yet. Wait for the sync to arrive.
await bob.awaitRoomMembership(testRoomId); await bob.awaitRoomMembership(testRoomId);
await app.client.network.setupRoute();
}); });
test("should show the correct shield on e2e events", async ({ test("should show the correct shield on e2e events", async ({
@@ -66,9 +64,6 @@ test.describe("Cryptography", function () {
// Bob has a second, not cross-signed, device // Bob has a second, not cross-signed, device
const bobSecondDevice = await createSecondBotDevice(page, homeserver, bob); const bobSecondDevice = await createSecondBotDevice(page, homeserver, bob);
// Dismiss the toast nagging us to set up recovery otherwise it gets in the way of clicking the room list
await page.getByRole("button", { name: "Not now" }).click();
await bob.sendEvent(testRoomId, null, "m.room.encrypted", { await bob.sendEvent(testRoomId, null, "m.room.encrypted", {
algorithm: "m.megolm.v1.aes-sha2", algorithm: "m.megolm.v1.aes-sha2",
ciphertext: "the bird is in the hand", ciphertext: "the bird is in the hand",
@@ -138,7 +133,8 @@ test.describe("Cryptography", function () {
"Encrypted by a device not verified by its owner.", "Encrypted by a device not verified by its owner.",
); );
/* Should show a red padlock for a message from an unverified device. /* In legacy crypto: should show a grey padlock for a message from a deleted device.
* In rust crypto: should show a red padlock for a message from an unverified device.
* Rust crypto remembers the verification state of the sending device, so it will know that the device was * Rust crypto remembers the verification state of the sending device, so it will know that the device was
* unverified, even if it gets deleted. */ * unverified, even if it gets deleted. */
// bob deletes his second device // bob deletes his second device
@@ -172,7 +168,9 @@ test.describe("Cryptography", function () {
await expect(lastE2eIcon).toHaveClass(/mx_EventTile_e2eIcon_warning/); await expect(lastE2eIcon).toHaveClass(/mx_EventTile_e2eIcon_warning/);
await lastE2eIcon.focus(); await lastE2eIcon.focus();
await expect(await app.getTooltipForElement(lastE2eIcon)).toContainText( await expect(await app.getTooltipForElement(lastE2eIcon)).toContainText(
"Encrypted by a device not verified by its owner.", workerInfo.project.name === "Legacy Crypto"
? "Encrypted by an unknown or deleted device."
: "Encrypted by a device not verified by its owner.",
); );
}); });
@@ -210,7 +208,7 @@ test.describe("Cryptography", function () {
window.localStorage.clear(); window.localStorage.clear();
}); });
await page.reload(); await page.reload();
await logIntoElement(page, aliceCredentials, securityKey); await logIntoElement(page, homeserver, aliceCredentials, securityKey);
/* go back to the test room and find Bob's message again */ /* go back to the test room and find Bob's message again */
await app.viewRoomById(testRoomId); await app.viewRoomById(testRoomId);

View File

@@ -1,7 +1,7 @@
/* /*
Copyright 2024 New Vector Ltd. Copyright 2024 New Vector Ltd.
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
Please see LICENSE files in the repository root for full details. Please see LICENSE files in the repository root for full details.
*/ */
@@ -11,7 +11,6 @@ import { bootstrapCrossSigningForClient } from "../../pages/client.ts";
/** Tests for the "invisible crypto" behaviour -- i.e., when the "exclude insecure devices" setting is enabled */ /** Tests for the "invisible crypto" behaviour -- i.e., when the "exclude insecure devices" setting is enabled */
test.describe("Invisible cryptography", () => { test.describe("Invisible cryptography", () => {
test.slow();
test.use({ test.use({
displayName: "Alice", displayName: "Alice",
botCreateOpts: { displayName: "Bob" }, botCreateOpts: { displayName: "Bob" },

View File

@@ -2,18 +2,16 @@
Copyright 2024 New Vector Ltd. Copyright 2024 New Vector Ltd.
Copyright 2024 The Matrix.org Foundation C.I.C. Copyright 2024 The Matrix.org Foundation C.I.C.
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
Please see LICENSE files in the repository root for full details. Please see LICENSE files in the repository root for full details.
*/ */
import { test, expect } from "../../element-web-test"; import { test, expect } from "../../element-web-test";
import { createRoom, enableKeyBackup, logIntoElement, sendMessageInCurrentRoom } from "./utils"; import { createRoom, enableKeyBackup, logIntoElement, sendMessageInCurrentRoom } from "./utils";
import { isDendrite } from "../../plugins/homeserver/dendrite";
test.describe("Logout tests", () => { test.describe("Logout tests", () => {
test.skip(isDendrite, "Dendrite lacks support for MSC3967 so requires additional auth here");
test.beforeEach(async ({ page, homeserver, credentials }) => { test.beforeEach(async ({ page, homeserver, credentials }) => {
await logIntoElement(page, credentials); await logIntoElement(page, homeserver, credentials);
}); });
test("Ask to set up recovery on logout if not setup", async ({ page, app }) => { test("Ask to set up recovery on logout if not setup", async ({ page, app }) => {

View File

@@ -2,19 +2,16 @@
Copyright 2024 New Vector Ltd. Copyright 2024 New Vector Ltd.
Copyright 2023, 2024 The Matrix.org Foundation C.I.C. Copyright 2023, 2024 The Matrix.org Foundation C.I.C.
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
Please see LICENSE files in the repository root for full details. Please see LICENSE files in the repository root for full details.
*/ */
import path from "path"; import path from "path";
import { readFile } from "node:fs/promises"; import { readFile } from "node:fs/promises";
import { expect, test } from "../../element-web-test"; import { expect, test as base } from "../../element-web-test";
test.describe("migration", { tag: "@no-webkit" }, function () {
test.use({
displayName: "Alice",
const test = base.extend({
// Replace the `user` fixture with one which populates the indexeddb data before starting the app. // Replace the `user` fixture with one which populates the indexeddb data before starting the app.
user: async ({ context, pageWithCredentials: page, credentials }, use) => { user: async ({ context, pageWithCredentials: page, credentials }, use) => {
await page.route(`/test_indexeddb_cryptostore_dump/*`, async (route, request) => { await page.route(`/test_indexeddb_cryptostore_dump/*`, async (route, request) => {
@@ -28,7 +25,11 @@ test.describe("migration", { tag: "@no-webkit" }, function () {
}, },
}); });
test.describe("migration", function () {
test.use({ displayName: "Alice" });
test("Should support migration from legacy crypto", async ({ context, user, page }, workerInfo) => { test("Should support migration from legacy crypto", async ({ context, user, page }, workerInfo) => {
test.skip(workerInfo.project.name === "Legacy Crypto", "This test only works with Rust crypto.");
test.slow(); test.slow();
// We should see a migration progress bar // We should see a migration progress bar

View File

@@ -2,7 +2,7 @@
Copyright 2024 New Vector Ltd. Copyright 2024 New Vector Ltd.
Copyright 2023, 2024 The Matrix.org Foundation C.I.C. Copyright 2023, 2024 The Matrix.org Foundation C.I.C.
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
Please see LICENSE files in the repository root for full details. Please see LICENSE files in the repository root for full details.
*/ */

View File

@@ -2,13 +2,12 @@
Copyright 2024 New Vector Ltd. Copyright 2024 New Vector Ltd.
Copyright 2023 The Matrix.org Foundation C.I.C. Copyright 2023 The Matrix.org Foundation C.I.C.
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
Please see LICENSE files in the repository root for full details. Please see LICENSE files in the repository root for full details.
*/ */
import { type Preset, type Visibility } from "matrix-js-sdk/src/matrix"; import { type Preset, type Visibility } from "matrix-js-sdk/src/matrix";
import type { Page } from "@playwright/test";
import { test, expect } from "../../element-web-test"; import { test, expect } from "../../element-web-test";
import { doTwoWaySasVerification, awaitVerifier } from "./utils"; import { doTwoWaySasVerification, awaitVerifier } from "./utils";
import { Client } from "../../pages/client"; import { Client } from "../../pages/client";
@@ -39,8 +38,6 @@ test.describe("User verification", () => {
toasts, toasts,
room: { roomId: dmRoomId }, room: { roomId: dmRoomId },
}) => { }) => {
await waitForDeviceKeys(page);
// once Alice has joined, Bob starts the verification // once Alice has joined, Bob starts the verification
const bobVerificationRequest = await bob.evaluateHandle( const bobVerificationRequest = await bob.evaluateHandle(
async (client, { dmRoomId, aliceCredentials }) => { async (client, { dmRoomId, aliceCredentials }) => {
@@ -74,7 +71,7 @@ test.describe("User verification", () => {
/* on the bot side, wait for the verifier to exist ... */ /* on the bot side, wait for the verifier to exist ... */
const botVerifier = await awaitVerifier(bobVerificationRequest); const botVerifier = await awaitVerifier(bobVerificationRequest);
// ... confirm ... // ... confirm ...
void botVerifier.evaluate((verifier) => verifier.verify()); botVerifier.evaluate((verifier) => verifier.verify());
// ... and then check the emoji match // ... and then check the emoji match
await doTwoWaySasVerification(page, botVerifier); await doTwoWaySasVerification(page, botVerifier);
@@ -90,8 +87,6 @@ test.describe("User verification", () => {
toasts, toasts,
room: { roomId: dmRoomId }, room: { roomId: dmRoomId },
}) => { }) => {
await waitForDeviceKeys(page);
// once Alice has joined, Bob starts the verification // once Alice has joined, Bob starts the verification
const bobVerificationRequest = await bob.evaluateHandle( const bobVerificationRequest = await bob.evaluateHandle(
async (client, { dmRoomId, aliceCredentials }) => { async (client, { dmRoomId, aliceCredentials }) => {
@@ -154,15 +149,3 @@ async function createDMRoom(client: Client, userId: string): Promise<string> {
], ],
}); });
} }
/**
* Wait until we get the other user's device keys.
* In newer rust-crypto versions, the verification request will be ignored if we
* don't have the sender's device keys.
*/
async function waitForDeviceKeys(page: Page): Promise<void> {
await expect(page.getByRole("button", { name: "Avatar" })).toBeVisible();
const avatar = await page.getByRole("button", { name: "Avatar" });
await avatar.click();
await expect(page.getByText("1 session")).toBeVisible();
}

View File

@@ -2,7 +2,7 @@
Copyright 2024 New Vector Ltd. Copyright 2024 New Vector Ltd.
Copyright 2023 The Matrix.org Foundation C.I.C. Copyright 2023 The Matrix.org Foundation C.I.C.
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
Please see LICENSE files in the repository root for full details. Please see LICENSE files in the repository root for full details.
*/ */
@@ -12,7 +12,6 @@ import type { ICreateRoomOpts, MatrixClient } from "matrix-js-sdk/src/matrix";
import type { import type {
CryptoEvent, CryptoEvent,
EmojiMapping, EmojiMapping,
GeneratedSecretStorageKey,
ShowSasCallbacks, ShowSasCallbacks,
VerificationRequest, VerificationRequest,
Verifier, Verifier,
@@ -23,46 +22,6 @@ import { Client } from "../../pages/client";
import { ElementAppPage } from "../../pages/ElementAppPage"; import { ElementAppPage } from "../../pages/ElementAppPage";
import { Bot } from "../../pages/bot"; import { Bot } from "../../pages/bot";
/**
* Create a bot client using the supplied credentials, and wait for the key backup to be ready.
* @param page - the playwright `page` fixture
* @param homeserver - the homeserver to use
* @param credentials - the credentials to use for the bot client
*/
export async function createBot(
page: Page,
homeserver: HomeserverInstance,
credentials: Credentials,
): Promise<{ botClient: Bot; recoveryKey: GeneratedSecretStorageKey; expectedBackupVersion: string }> {
// Visit the login page of the app, to load the matrix sdk
await page.goto("/#/login");
// wait for the page to load
await page.waitForSelector(".mx_AuthPage", { timeout: 30000 });
// Create a new bot client
const botClient = new Bot(page, homeserver, {
bootstrapCrossSigning: true,
bootstrapSecretStorage: true,
});
botClient.setCredentials(credentials);
// Backup is prepared in the background. Poll until it is ready.
const botClientHandle = await botClient.prepareClient();
let expectedBackupVersion: string;
await expect
.poll(async () => {
expectedBackupVersion = await botClientHandle.evaluate((cli) =>
cli.getCrypto()!.getActiveSessionBackupVersion(),
);
return expectedBackupVersion;
})
.not.toBe(null);
const recoveryKey = await botClient.getRecoveryKey();
return { botClient, recoveryKey, expectedBackupVersion };
}
/** /**
* wait for the given client to receive an incoming verification request, and automatically accept it * wait for the given client to receive an incoming verification request, and automatically accept it
* *
@@ -100,7 +59,7 @@ export function handleSasVerification(verifier: JSHandle<Verifier>): Promise<Emo
return new Promise<EmojiMapping[]>((resolve) => { return new Promise<EmojiMapping[]>((resolve) => {
const onShowSas = (event: ShowSasCallbacks) => { const onShowSas = (event: ShowSasCallbacks) => {
verifier.off("show_sas" as VerifierEvent, onShowSas); verifier.off("show_sas" as VerifierEvent, onShowSas);
void event.confirm(); event.confirm();
resolve(event.sas.emoji); resolve(event.sas.emoji);
}; };
@@ -179,9 +138,22 @@ export async function checkDeviceIsConnectedKeyBackup(
* *
* If a `securityKey` is given, verifies the new device using the key. * If a `securityKey` is given, verifies the new device using the key.
*/ */
export async function logIntoElement(page: Page, credentials: Credentials, securityKey?: string) { export async function logIntoElement(
page: Page,
homeserver: HomeserverInstance,
credentials: Credentials,
securityKey?: string,
) {
await page.goto("/#/login"); await page.goto("/#/login");
// select homeserver
await page.getByRole("button", { name: "Edit" }).click();
await page.getByRole("textbox", { name: "Other homeserver" }).fill(homeserver.config.baseUrl);
await page.getByRole("button", { name: "Continue", exact: true }).click();
// wait for the dialog to go away
await expect(page.locator(".mx_ServerPickerDialog")).not.toBeVisible();
await page.getByRole("textbox", { name: "Username" }).fill(credentials.userId); await page.getByRole("textbox", { name: "Username" }).fill(credentials.userId);
await page.getByPlaceholder("Password").fill(credentials.password); await page.getByPlaceholder("Password").fill(credentials.password);
await page.getByRole("button", { name: "Sign in" }).click(); await page.getByRole("button", { name: "Sign in" }).click();
@@ -248,7 +220,11 @@ export async function doTwoWaySasVerification(page: Page, verifier: JSHandle<Ver
for (let i = 0; i < emojis.length; i++) { for (let i = 0; i < emojis.length; i++) {
const emoji = emojis[i]; const emoji = emojis[i];
const emojiBlock = emojiBlocks.nth(i); const emojiBlock = emojiBlocks.nth(i);
await expect(emojiBlock).toHaveText(emoji[0] + emoji[1]); const textContent = await emojiBlock.textContent();
// VerificationShowSas munges the case of the emoji descriptions returned by the js-sdk before
// displaying them. Once we drop support for legacy crypto, that code can go away, and so can the
// case-munging here.
expect(textContent.toLowerCase()).toEqual(emoji[0] + emoji[1].toLowerCase());
} }
} }
@@ -354,7 +330,7 @@ export async function autoJoin(client: Client) {
await client.evaluate((cli) => { await client.evaluate((cli) => {
cli.on(window.matrixcs.RoomMemberEvent.Membership, (event, member) => { cli.on(window.matrixcs.RoomMemberEvent.Membership, (event, member) => {
if (member.membership === "invite" && member.userId === cli.getUserId()) { if (member.membership === "invite" && member.userId === cli.getUserId()) {
void cli.joinRoom(member.roomId); cli.joinRoom(member.roomId);
} }
}); });
}); });
@@ -413,25 +389,3 @@ export async function createSecondBotDevice(page: Page, homeserver: HomeserverIn
await bobSecondDevice.prepareClient(); await bobSecondDevice.prepareClient();
return bobSecondDevice; return bobSecondDevice;
} }
/**
* Remove the cached secrets from the indexedDB
* This is a workaround to simulate the case where the secrets are not cached.
*/
export async function deleteCachedSecrets(page: Page) {
await page.evaluate(async () => {
const removeCachedSecrets = new Promise((resolve) => {
const request = window.indexedDB.open("matrix-js-sdk::matrix-sdk-crypto");
request.onsuccess = (event: Event & { target: { result: IDBDatabase } }) => {
const db = event.target.result;
const request = db.transaction("core", "readwrite").objectStore("core").delete("private_identity");
request.onsuccess = () => {
db.close();
resolve(undefined);
};
};
});
await removeCachedSecrets;
});
await page.reload();
}

View File

@@ -1,39 +0,0 @@
/*
Copyright 2024 New Vector Ltd.
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
Please see LICENSE files in the repository root for full details.
*/
import { APIRequestContext } from "playwright-core";
import { KeyBackupInfo } from "matrix-js-sdk/src/crypto-api";
import { HomeserverInstance } from "../plugins/homeserver";
import { ClientServerApi } from "../plugins/utils/api.ts";
/**
* A small subset of the Client-Server API used to manipulate the state of the
* account on the homeserver independently of the client under test.
*/
export class TestClientServerAPI extends ClientServerApi {
public constructor(
request: APIRequestContext,
homeserver: HomeserverInstance,
private accessToken: string,
) {
super(homeserver.baseUrl);
this.setRequest(request);
}
public async getCurrentBackupInfo(): Promise<KeyBackupInfo | null> {
return this.request("GET", `/v3/room_keys/version`, this.accessToken);
}
/**
* Calls the API directly to delete the given backup version
* @param version The version to delete
*/
public async deleteBackupVersion(version: string): Promise<void> {
await this.request("DELETE", `/v3/room_keys/version/${version}`, this.accessToken);
}
}

View File

@@ -2,7 +2,7 @@
Copyright 2024 New Vector Ltd. Copyright 2024 New Vector Ltd.
Copyright 2022 The Matrix.org Foundation C.I.C. Copyright 2022 The Matrix.org Foundation C.I.C.
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
Please see LICENSE files in the repository root for full details. Please see LICENSE files in the repository root for full details.
*/ */
@@ -12,7 +12,6 @@ import type { EventType, IContent, ISendEventResponse, MsgType, Visibility } fro
import { expect, test } from "../../element-web-test"; import { expect, test } from "../../element-web-test";
import { ElementAppPage } from "../../pages/ElementAppPage"; import { ElementAppPage } from "../../pages/ElementAppPage";
import { SettingLevel } from "../../../src/settings/SettingLevel"; import { SettingLevel } from "../../../src/settings/SettingLevel";
import { isDendrite } from "../../plugins/homeserver/dendrite";
async function sendEvent(app: ElementAppPage, roomId: string): Promise<ISendEventResponse> { async function sendEvent(app: ElementAppPage, roomId: string): Promise<ISendEventResponse> {
return app.client.sendEvent(roomId, null, "m.room.message" as EventType, { return app.client.sendEvent(roomId, null, "m.room.message" as EventType, {
@@ -32,8 +31,6 @@ function mkPadding(n: number): IContent {
} }
test.describe("Editing", () => { test.describe("Editing", () => {
test.skip(isDendrite, "due to a Dendrite bug https://github.com/element-hq/dendrite/issues/3488");
// Edit "Message" // Edit "Message"
const editLastMessage = async (page: Page, edit: string) => { const editLastMessage = async (page: Page, edit: string) => {
const eventTile = page.locator(".mx_RoomView_MessageList .mx_EventTile_last"); const eventTile = page.locator(".mx_RoomView_MessageList .mx_EventTile_last");

View File

@@ -2,7 +2,7 @@
Copyright 2024 New Vector Ltd. Copyright 2024 New Vector Ltd.
Copyright 2024 The Matrix.org Foundation C.I.C. Copyright 2024 The Matrix.org Foundation C.I.C.
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
Please see LICENSE files in the repository root for full details. Please see LICENSE files in the repository root for full details.
*/ */

View File

@@ -2,44 +2,29 @@
Copyright 2024 New Vector Ltd. Copyright 2024 New Vector Ltd.
Copyright 2024 The Matrix.org Foundation C.I.C. Copyright 2024 The Matrix.org Foundation C.I.C.
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
Please see LICENSE files in the repository root for full details. Please see LICENSE files in the repository root for full details.
*/ */
import { expect, test as base } from "../../element-web-test"; import { expect, test } from "../../element-web-test";
import { selectHomeserver } from "../utils"; import { selectHomeserver } from "../utils";
import { emailHomeserver } from "../../plugins/homeserver/synapse/emailHomeserver.ts";
import { isDendrite } from "../../plugins/homeserver/dendrite";
import { Credentials } from "../../plugins/homeserver";
const username = "user1234";
// this has to be password-like enough to please zxcvbn. Needless to say it's just from pwgen.
const password = "oETo7MPf0o";
const email = "user@nowhere.dummy"; const email = "user@nowhere.dummy";
const test = base.extend<{ credentials: Pick<Credentials, "username" | "password"> }>({
// eslint-disable-next-line no-empty-pattern
credentials: async ({}, use, testInfo) => {
await use({
username: `user_${testInfo.testId}`,
// this has to be password-like enough to please zxcvbn. Needless to say it's just from pwgen.
password: "oETo7MPf0o",
});
},
});
test.use(emailHomeserver);
test.use({
config: {
// The only thing that we really *need* (otherwise Element refuses to load) is a default homeserver.
// We point that to a guaranteed-invalid domain.
default_server_config: {
"m.homeserver": {
base_url: "https://server.invalid",
},
},
},
});
test.describe("Forgot Password", () => { test.describe("Forgot Password", () => {
test.skip(isDendrite, "not yet wired up"); test.use({
startHomeserverOpts: ({ mailhog }, use) =>
use({
template: "email",
variables: {
SMTP_HOST: "host.containers.internal",
SMTP_PORT: mailhog.instance.smtpPort,
},
}),
});
test("renders properly", { tag: "@screenshot" }, async ({ page, homeserver }) => { test("renders properly", { tag: "@screenshot" }, async ({ page, homeserver }) => {
await page.goto("/"); await page.goto("/");
@@ -47,25 +32,22 @@ test.describe("Forgot Password", () => {
await page.getByRole("link", { name: "Sign in" }).click(); await page.getByRole("link", { name: "Sign in" }).click();
// need to select a homeserver at this stage, before entering the forgot password flow // need to select a homeserver at this stage, before entering the forgot password flow
await selectHomeserver(page, homeserver.baseUrl); await selectHomeserver(page, homeserver.config.baseUrl);
await page.getByRole("button", { name: "Forgot password?" }).click(); await page.getByRole("button", { name: "Forgot password?" }).click();
await expect(page.getByRole("main")).toMatchScreenshot("forgot-password.png"); await expect(page.getByRole("main")).toMatchScreenshot("forgot-password.png");
}); });
test( test("renders email verification dialog properly", { tag: "@screenshot" }, async ({ page, homeserver }) => {
"renders email verification dialog properly", const user = await homeserver.registerUser(username, password);
{ tag: "@screenshot" },
async ({ page, homeserver, credentials }) => {
const user = await homeserver.registerUser(credentials.username, credentials.password);
await homeserver.setThreepid(user.userId, "email", email); await homeserver.setThreepid(user.userId, "email", email);
await page.goto("/"); await page.goto("/");
await page.getByRole("link", { name: "Sign in" }).click(); await page.getByRole("link", { name: "Sign in" }).click();
await selectHomeserver(page, homeserver.baseUrl); await selectHomeserver(page, homeserver.config.baseUrl);
await page.getByRole("button", { name: "Forgot password?" }).click(); await page.getByRole("button", { name: "Forgot password?" }).click();
@@ -75,14 +57,13 @@ test.describe("Forgot Password", () => {
await page.getByRole("button", { name: "Next" }).click(); await page.getByRole("button", { name: "Next" }).click();
await page.getByRole("textbox", { name: "New Password", exact: true }).fill(credentials.password); await page.getByRole("textbox", { name: "New Password", exact: true }).fill(password);
await page.getByRole("textbox", { name: "Confirm new password", exact: true }).fill(credentials.password); await page.getByRole("textbox", { name: "Confirm new password", exact: true }).fill(password);
await page.getByRole("button", { name: "Reset password" }).click(); await page.getByRole("button", { name: "Reset password" }).click();
await expect(page.getByRole("button", { name: "Resend" })).toBeInViewport(); await expect(page.getByRole("button", { name: "Resend" })).toBeInViewport();
await expect(page.locator(".mx_Dialog")).toMatchScreenshot("forgot-password-verify-email.png"); await expect(page.locator(".mx_Dialog")).toMatchScreenshot("forgot-password-verify-email.png");
}, });
);
}); });

View File

@@ -2,14 +2,13 @@
Copyright 2024 New Vector Ltd. Copyright 2024 New Vector Ltd.
Copyright 2022, 2023 The Matrix.org Foundation C.I.C. Copyright 2022, 2023 The Matrix.org Foundation C.I.C.
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
Please see LICENSE files in the repository root for full details. Please see LICENSE files in the repository root for full details.
*/ */
import type { Page } from "@playwright/test"; import type { Page } from "@playwright/test";
import { test, expect } from "../../element-web-test"; import { test, expect } from "../../element-web-test";
import { openIntegrationManager } from "./utils"; import { openIntegrationManager } from "./utils";
import type { UserWidget } from "../../../src/utils/WidgetUtils-types.ts";
const ROOM_NAME = "Integration Manager Test"; const ROOM_NAME = "Integration Manager Test";
@@ -93,7 +92,7 @@ test.describe("Integration Manager: Get OpenID Token", () => {
}, },
}, },
id: "integration-manager", id: "integration-manager",
} as unknown as UserWidget, },
}); });
// Succeed when checking the token is valid // Succeed when checking the token is valid

View File

@@ -2,14 +2,13 @@
Copyright 2024 New Vector Ltd. Copyright 2024 New Vector Ltd.
Copyright 2022, 2023 The Matrix.org Foundation C.I.C. Copyright 2022, 2023 The Matrix.org Foundation C.I.C.
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
Please see LICENSE files in the repository root for full details. Please see LICENSE files in the repository root for full details.
*/ */
import type { Page } from "@playwright/test"; import type { Page } from "@playwright/test";
import { test, expect } from "../../element-web-test"; import { test, expect } from "../../element-web-test";
import { openIntegrationManager } from "./utils"; import { openIntegrationManager } from "./utils";
import type { UserWidget } from "../../../src/utils/WidgetUtils-types.ts";
const ROOM_NAME = "Integration Manager Test"; const ROOM_NAME = "Integration Manager Test";
const USER_DISPLAY_NAME = "Alice"; const USER_DISPLAY_NAME = "Alice";
@@ -69,13 +68,29 @@ async function sendActionFromIntegrationManager(
await iframe.getByRole("button", { name: "Press to send action" }).click(); await iframe.getByRole("button", { name: "Press to send action" }).click();
} }
async function clickUntilGone(page: Page, selector: string, attempt = 0) {
if (attempt === 11) {
throw new Error("clickUntilGone attempt count exceeded");
}
await page.locator(selector).last().click();
const count = await page.locator(selector).count();
if (count > 0) {
return clickUntilGone(page, selector, ++attempt);
}
}
async function expectKickedMessage(page: Page, shouldExist: boolean) { async function expectKickedMessage(page: Page, shouldExist: boolean) {
await expect(async () => { // Expand any event summaries, we can't use a click multiple here because clicking one might de-render others
await page.locator(".mx_GenericEventListSummary_toggle[aria-expanded=false]").last().click(); // This is quite horrible but seems the most stable way of clicking 0-N buttons,
// one at a time with a full re-evaluation after each click
await clickUntilGone(page, ".mx_GenericEventListSummary_toggle[aria-expanded=false]");
// Check for the event message (or lack thereof)
await expect(page.getByText(`${USER_DISPLAY_NAME} removed ${BOT_DISPLAY_NAME}: ${KICK_REASON}`)).toBeVisible({ await expect(page.getByText(`${USER_DISPLAY_NAME} removed ${BOT_DISPLAY_NAME}: ${KICK_REASON}`)).toBeVisible({
visible: shouldExist, visible: shouldExist,
}); });
}).toPass();
} }
test.describe("Integration Manager: Kick", () => { test.describe("Integration Manager: Kick", () => {
@@ -121,7 +136,7 @@ test.describe("Integration Manager: Kick", () => {
}, },
}, },
id: "integration-manager", id: "integration-manager",
} as unknown as UserWidget, },
}); });
// Succeed when checking the token is valid // Succeed when checking the token is valid

View File

@@ -2,14 +2,13 @@
Copyright 2024 New Vector Ltd. Copyright 2024 New Vector Ltd.
Copyright 2022, 2023 The Matrix.org Foundation C.I.C. Copyright 2022, 2023 The Matrix.org Foundation C.I.C.
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
Please see LICENSE files in the repository root for full details. Please see LICENSE files in the repository root for full details.
*/ */
import type { Page } from "@playwright/test"; import type { Page } from "@playwright/test";
import { test, expect } from "../../element-web-test"; import { test, expect } from "../../element-web-test";
import { openIntegrationManager } from "./utils"; import { openIntegrationManager } from "./utils";
import type { UserWidget } from "../../../src/utils/WidgetUtils-types.ts";
const ROOM_NAME = "Integration Manager Test"; const ROOM_NAME = "Integration Manager Test";
@@ -108,7 +107,7 @@ test.describe("Integration Manager: Read Events", () => {
}, },
}, },
id: "integration-manager", id: "integration-manager",
} as unknown as UserWidget, },
}); });
// Succeed when checking the token is valid // Succeed when checking the token is valid

View File

@@ -2,14 +2,13 @@
Copyright 2024 New Vector Ltd. Copyright 2024 New Vector Ltd.
Copyright 2022, 2023 The Matrix.org Foundation C.I.C. Copyright 2022, 2023 The Matrix.org Foundation C.I.C.
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
Please see LICENSE files in the repository root for full details. Please see LICENSE files in the repository root for full details.
*/ */
import type { Page } from "@playwright/test"; import type { Page } from "@playwright/test";
import { test, expect } from "../../element-web-test"; import { test, expect } from "../../element-web-test";
import { openIntegrationManager } from "./utils"; import { openIntegrationManager } from "./utils";
import type { UserWidget } from "../../../src/utils/WidgetUtils-types.ts";
const ROOM_NAME = "Integration Manager Test"; const ROOM_NAME = "Integration Manager Test";
@@ -114,7 +113,7 @@ test.describe("Integration Manager: Send Event", () => {
}, },
}, },
id: "integration-manager", id: "integration-manager",
} as unknown as UserWidget, },
}); });
// Succeed when checking the token is valid // Succeed when checking the token is valid

View File

@@ -2,7 +2,7 @@
Copyright 2024 New Vector Ltd. Copyright 2024 New Vector Ltd.
Copyright 2022, 2023 The Matrix.org Foundation C.I.C. Copyright 2022, 2023 The Matrix.org Foundation C.I.C.
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
Please see LICENSE files in the repository root for full details. Please see LICENSE files in the repository root for full details.
*/ */

View File

@@ -3,7 +3,7 @@ Copyright 2024 New Vector Ltd.
Copyright 2023 Suguru Hirahara Copyright 2023 Suguru Hirahara
Copyright 2023 The Matrix.org Foundation C.I.C. Copyright 2023 The Matrix.org Foundation C.I.C.
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
Please see LICENSE files in the repository root for full details. Please see LICENSE files in the repository root for full details.
*/ */

View File

@@ -2,17 +2,15 @@
Copyright 2024 New Vector Ltd. Copyright 2024 New Vector Ltd.
Copyright 2022, 2023 The Matrix.org Foundation C.I.C. Copyright 2022, 2023 The Matrix.org Foundation C.I.C.
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
Please see LICENSE files in the repository root for full details. Please see LICENSE files in the repository root for full details.
*/ */
import { test, expect } from "../../element-web-test"; import { test, expect } from "../../element-web-test";
import { waitForRoom } from "../utils"; import { waitForRoom } from "../utils";
import { Filter } from "../../pages/Spotlight"; import { Filter } from "../../pages/Spotlight";
import { isDendrite } from "../../plugins/homeserver/dendrite";
test.describe("Create Knock Room", () => { test.describe("Create Knock Room", () => {
test.skip(isDendrite, "Dendrite does not have support for knocking");
test.use({ test.use({
displayName: "Alice", displayName: "Alice",
labsFlags: ["feature_ask_to_join"], labsFlags: ["feature_ask_to_join"],
@@ -81,7 +79,6 @@ test.describe("Create Knock Room", () => {
const spotlightDialog = await app.openSpotlight(); const spotlightDialog = await app.openSpotlight();
await spotlightDialog.filter(Filter.PublicRooms); await spotlightDialog.filter(Filter.PublicRooms);
await spotlightDialog.search("Cyber");
await expect(spotlightDialog.results.nth(0)).toContainText("Cybersecurity"); await expect(spotlightDialog.results.nth(0)).toContainText("Cybersecurity");
}); });
}); });

View File

@@ -4,7 +4,7 @@ Copyright 2023 Mikhail Aheichyk
Copyright 2023 Nordeck IT + Consulting GmbH. Copyright 2023 Nordeck IT + Consulting GmbH.
Copyright 2023 The Matrix.org Foundation C.I.C. Copyright 2023 The Matrix.org Foundation C.I.C.
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
Please see LICENSE files in the repository root for full details. Please see LICENSE files in the repository root for full details.
*/ */
@@ -13,10 +13,8 @@ import { type Visibility } from "matrix-js-sdk/src/matrix";
import { test, expect } from "../../element-web-test"; import { test, expect } from "../../element-web-test";
import { waitForRoom } from "../utils"; import { waitForRoom } from "../utils";
import { Filter } from "../../pages/Spotlight"; import { Filter } from "../../pages/Spotlight";
import { isDendrite } from "../../plugins/homeserver/dendrite";
test.describe("Knock Into Room", () => { test.describe("Knock Into Room", () => {
test.skip(isDendrite, "Dendrite does not have support for knocking");
test.use({ test.use({
displayName: "Alice", displayName: "Alice",
labsFlags: ["feature_ask_to_join"], labsFlags: ["feature_ask_to_join"],
@@ -284,7 +282,6 @@ test.describe("Knock Into Room", () => {
const spotlightDialog = await app.openSpotlight(); const spotlightDialog = await app.openSpotlight();
await spotlightDialog.filter(Filter.PublicRooms); await spotlightDialog.filter(Filter.PublicRooms);
await spotlightDialog.search("Cyber");
await expect(spotlightDialog.results.nth(0)).toContainText("Cybersecurity"); await expect(spotlightDialog.results.nth(0)).toContainText("Cybersecurity");
await spotlightDialog.results.nth(0).click(); await spotlightDialog.results.nth(0).click();

View File

@@ -4,16 +4,14 @@ Copyright 2023 Mikhail Aheichyk
Copyright 2023 Nordeck IT + Consulting GmbH. Copyright 2023 Nordeck IT + Consulting GmbH.
Copyright 2023 The Matrix.org Foundation C.I.C. Copyright 2023 The Matrix.org Foundation C.I.C.
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
Please see LICENSE files in the repository root for full details. Please see LICENSE files in the repository root for full details.
*/ */
import { test, expect } from "../../element-web-test"; import { test, expect } from "../../element-web-test";
import { waitForRoom } from "../utils"; import { waitForRoom } from "../utils";
import { isDendrite } from "../../plugins/homeserver/dendrite";
test.describe("Manage Knocks", () => { test.describe("Manage Knocks", () => {
test.skip(isDendrite, "Dendrite does not have support for knocking");
test.use({ test.use({
displayName: "Alice", displayName: "Alice",
labsFlags: ["feature_ask_to_join"], labsFlags: ["feature_ask_to_join"],
@@ -52,7 +50,7 @@ test.describe("Manage Knocks", () => {
}); });
test("should deny knock using bar", async ({ page, app, bot, room }) => { test("should deny knock using bar", async ({ page, app, bot, room }) => {
await bot.knockRoom(room.roomId); bot.knockRoom(room.roomId);
const roomKnocksBar = page.locator(".mx_RoomKnocksBar"); const roomKnocksBar = page.locator(".mx_RoomKnocksBar");
await expect(roomKnocksBar.getByRole("heading", { name: "Asking to join" })).toBeVisible(); await expect(roomKnocksBar.getByRole("heading", { name: "Asking to join" })).toBeVisible();

View File

@@ -2,7 +2,7 @@
Copyright 2024 New Vector Ltd. Copyright 2024 New Vector Ltd.
Copyright 2023 The Matrix.org Foundation C.I.C. Copyright 2023 The Matrix.org Foundation C.I.C.
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
Please see LICENSE files in the repository root for full details. Please see LICENSE files in the repository root for full details.
*/ */
@@ -10,12 +10,8 @@ import { Bot } from "../../pages/bot";
import type { Locator, Page } from "@playwright/test"; import type { Locator, Page } from "@playwright/test";
import type { ElementAppPage } from "../../pages/ElementAppPage"; import type { ElementAppPage } from "../../pages/ElementAppPage";
import { test, expect } from "../../element-web-test"; import { test, expect } from "../../element-web-test";
import { Credentials } from "../../plugins/homeserver";
import { isDendrite } from "../../plugins/homeserver/dendrite";
test.describe("Lazy Loading", () => { test.describe("Lazy Loading", () => {
test.skip(isDendrite, "due to a Dendrite bug https://github.com/element-hq/dendrite/issues/3488");
const charlies: Bot[] = []; const charlies: Bot[] = [];
test.use({ test.use({
@@ -29,28 +25,21 @@ test.describe("Lazy Loading", () => {
}); });
}); });
test.beforeEach(async ({ page, homeserver, user, bot, app }) => { test.beforeEach(async ({ page, homeserver, user, bot }) => {
for (let i = 1; i <= 10; i++) { for (let i = 1; i <= 10; i++) {
const displayName = `Charly #${i}`; const displayName = `Charly #${i}`;
const bot = new Bot(page, homeserver, { displayName, startClient: false, autoAcceptInvites: false }); const bot = new Bot(page, homeserver, { displayName, startClient: false, autoAcceptInvites: false });
charlies.push(bot); charlies.push(bot);
} }
await app.client.network.setupRoute();
}); });
const name = "Lazy Loading Test"; const name = "Lazy Loading Test";
const alias = "#lltest:localhost";
const charlyMsg1 = "hi bob!"; const charlyMsg1 = "hi bob!";
const charlyMsg2 = "how's it going??"; const charlyMsg2 = "how's it going??";
let roomId: string; let roomId: string;
async function setupRoomWithBobAliceAndCharlies( async function setupRoomWithBobAliceAndCharlies(page: Page, app: ElementAppPage, bob: Bot, charlies: Bot[]) {
page: Page,
app: ElementAppPage,
user: Credentials,
bob: Bot,
charlies: Bot[],
) {
const alias = `#lltest:${user.homeServer}`;
const visibility = await page.evaluate(() => (window as any).matrixcs.Visibility.Public); const visibility = await page.evaluate(() => (window as any).matrixcs.Visibility.Public);
roomId = await bob.createRoom({ roomId = await bob.createRoom({
name, name,
@@ -88,7 +77,7 @@ test.describe("Lazy Loading", () => {
} }
function getMemberInMemberlist(page: Page, name: string): Locator { function getMemberInMemberlist(page: Page, name: string): Locator {
return page.locator(".mx_MemberListView .mx_MemberTileView_name").filter({ hasText: name }); return page.locator(".mx_MemberList .mx_EntityTile_name").filter({ hasText: name });
} }
async function checkMemberList(page: Page, charlies: Bot[]) { async function checkMemberList(page: Page, charlies: Bot[]) {
@@ -105,13 +94,7 @@ test.describe("Lazy Loading", () => {
} }
} }
async function joinCharliesWhileAliceIsOffline( async function joinCharliesWhileAliceIsOffline(page: Page, app: ElementAppPage, charlies: Bot[]) {
page: Page,
app: ElementAppPage,
user: Credentials,
charlies: Bot[],
) {
const alias = `#lltest:${user.homeServer}`;
await app.client.network.goOffline(); await app.client.network.goOffline();
for (const charly of charlies) { for (const charly of charlies) {
await charly.joinRoom(alias); await charly.joinRoom(alias);
@@ -123,19 +106,19 @@ test.describe("Lazy Loading", () => {
await app.client.waitForNextSync(); await app.client.waitForNextSync();
} }
test("should handle lazy loading properly even when offline", async ({ page, app, bot, user }) => { test("should handle lazy loading properly even when offline", async ({ page, app, bot }) => {
test.slow(); test.slow();
const charly1to5 = charlies.slice(0, 5); const charly1to5 = charlies.slice(0, 5);
const charly6to10 = charlies.slice(5); const charly6to10 = charlies.slice(5);
// Set up room with alice, bob & charlies 1-5 // Set up room with alice, bob & charlies 1-5
await setupRoomWithBobAliceAndCharlies(page, app, user, bot, charly1to5); await setupRoomWithBobAliceAndCharlies(page, app, bot, charly1to5);
// Alice should see 2 messages from every charly with the correct display name // Alice should see 2 messages from every charly with the correct display name
await checkPaginatedDisplayNames(app, charly1to5); await checkPaginatedDisplayNames(app, charly1to5);
await openMemberlist(app); await openMemberlist(app);
await checkMemberList(page, charly1to5); await checkMemberList(page, charly1to5);
await joinCharliesWhileAliceIsOffline(page, app, user, charly6to10); await joinCharliesWhileAliceIsOffline(page, app, charly6to10);
await checkMemberList(page, charly6to10); await checkMemberList(page, charly6to10);
for (const charly of charlies) { for (const charly of charlies) {

View File

@@ -2,7 +2,7 @@
Copyright 2024 New Vector Ltd. Copyright 2024 New Vector Ltd.
Copyright 2023 Suguru Hirahara Copyright 2023 Suguru Hirahara
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
Please see LICENSE files in the repository root for full details. Please see LICENSE files in the repository root for full details.
*/ */

View File

@@ -2,7 +2,7 @@
Copyright 2024 New Vector Ltd. Copyright 2024 New Vector Ltd.
Copyright 2022 The Matrix.org Foundation C.I.C. Copyright 2022 The Matrix.org Foundation C.I.C.
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
Please see LICENSE files in the repository root for full details. Please see LICENSE files in the repository root for full details.
*/ */
@@ -10,8 +10,7 @@ import { Locator, Page } from "@playwright/test";
import { test, expect } from "../../element-web-test"; import { test, expect } from "../../element-web-test";
// Firefox headless lacks WebGL support https://bugzilla.mozilla.org/show_bug.cgi?id=1375585 test.describe("Location sharing", () => {
test.describe("Location sharing", { tag: "@no-firefox" }, () => {
const selectLocationShareTypeOption = (page: Page, shareType: string): Locator => { const selectLocationShareTypeOption = (page: Page, shareType: string): Locator => {
return page.getByTestId(`share-location-option-${shareType}`); return page.getByTestId(`share-location-option-${shareType}`);
}; };

View File

@@ -2,19 +2,18 @@
Copyright 2024 New Vector Ltd. Copyright 2024 New Vector Ltd.
Copyright 2022 The Matrix.org Foundation C.I.C. Copyright 2022 The Matrix.org Foundation C.I.C.
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
Please see LICENSE files in the repository root for full details. Please see LICENSE files in the repository root for full details.
*/ */
import { test, expect } from "../../element-web-test"; import { test, expect } from "../../element-web-test";
import { consentHomeserver } from "../../plugins/homeserver/synapse/consentHomeserver.ts";
test.use(consentHomeserver); test.describe("Consent", () => {
test.use({ test.use({
startHomeserverOpts: "consent",
displayName: "Bob", displayName: "Bob",
}); });
test.describe("Consent", () => {
test("should prompt the user to consent to terms when server deems it necessary", async ({ test("should prompt the user to consent to terms when server deems it necessary", async ({
context, context,
page, page,

View File

@@ -1,29 +0,0 @@
/*
Copyright 2024 New Vector Ltd.
Copyright 2023 The Matrix.org Foundation C.I.C.
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
Please see LICENSE files in the repository root for full details.
*/
import { test } from "../../element-web-test";
import { doTokenRegistration } from "./utils";
import { isDendrite } from "../../plugins/homeserver/dendrite";
import { legacyOAuthHomeserver } from "../../plugins/homeserver/synapse/legacyOAuthHomeserver.ts";
test.use(legacyOAuthHomeserver);
// tests for old-style SSO login, in which we exchange tokens with Synapse, and Synapse talks to an auth server
test.describe("SSO login", () => {
test.skip(isDendrite, "does not yet support SSO");
test("logs in with SSO and lands on the home screen", async ({ page, homeserver }, testInfo) => {
// If this test fails with a screen showing "Timeout connecting to remote server", it is most likely due to
// your firewall settings: Synapse is unable to reach the OIDC server.
//
// If you are using ufw, try something like:
// sudo ufw allow in on docker0
//
await doTokenRegistration(page, homeserver, testInfo);
});
});

View File

@@ -2,19 +2,18 @@
Copyright 2024 New Vector Ltd. Copyright 2024 New Vector Ltd.
Copyright 2023 The Matrix.org Foundation C.I.C. Copyright 2023 The Matrix.org Foundation C.I.C.
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
Please see LICENSE files in the repository root for full details. Please see LICENSE files in the repository root for full details.
*/ */
import { Page } from "playwright-core"; import { Page } from "playwright-core";
import { expect, test } from "../../element-web-test"; import { expect, test } from "../../element-web-test";
import { doTokenRegistration } from "./utils";
import { isDendrite } from "../../plugins/homeserver/dendrite";
import { selectHomeserver } from "../utils"; import { selectHomeserver } from "../utils";
import { Credentials, HomeserverInstance } from "../../plugins/homeserver"; import { Credentials, HomeserverInstance } from "../../plugins/homeserver";
import { consentHomeserver } from "../../plugins/homeserver/synapse/consentHomeserver.ts";
import { isDendrite } from "../../plugins/homeserver/dendrite";
// This test requires fixed credentials for the device signing keys below to work
const username = "user1234"; const username = "user1234";
const password = "p4s5W0rD"; const password = "p4s5W0rD";
@@ -69,55 +68,26 @@ const DEVICE_SIGNING_KEYS_BODY = {
}, },
}; };
async function login(page: Page, homeserver: HomeserverInstance, credentials: Credentials) { async function login(page: Page, homeserver: HomeserverInstance) {
await page.getByRole("link", { name: "Sign in" }).click(); await page.getByRole("link", { name: "Sign in" }).click();
await selectHomeserver(page, homeserver.baseUrl); await selectHomeserver(page, homeserver.config.baseUrl);
await page.getByRole("textbox", { name: "Username" }).fill(credentials.username); await page.getByRole("textbox", { name: "Username" }).fill(username);
await page.getByPlaceholder("Password").fill(credentials.password); await page.getByPlaceholder("Password").fill(password);
await page.getByRole("button", { name: "Sign in" }).click(); await page.getByRole("button", { name: "Sign in" }).click();
} }
// This test suite uses the same userId for all tests in the suite
// due to DEVICE_SIGNING_KEYS_BODY being specific to that userId,
// so we restart the Synapse container to make it forget everything.
test.use(consentHomeserver);
test.use({
config: {
// The only thing that we really *need* (otherwise Element refuses to load) is a default homeserver.
// We point that to a guaranteed-invalid domain.
default_server_config: {
"m.homeserver": {
base_url: "https://server.invalid",
},
},
},
context: async ({ context, homeserver }, use) => {
// Restart the homeserver to wipe its in-memory db so we can reuse the same user ID without cross-signing prompts
await homeserver.restart();
await use(context);
},
credentials: async ({ context, homeserver }, use) => {
const displayName = "Dave";
const credentials = await homeserver.registerUser(username, password, displayName);
console.log(`Registered test user @user:localhost with displayname ${displayName}`);
await use({
...credentials,
displayName,
});
// Restart the homeserver to wipe its in-memory db so we can reuse the same user ID without cross-signing prompts
await homeserver.restart();
},
});
test.describe("Login", () => { test.describe("Login", () => {
test.describe("Password login", () => { test.describe("Password login", () => {
test.skip(isDendrite, "Dendrite lacks support for MSC3967 so requires additional auth here"); test.use({ startHomeserverOpts: "consent" });
let creds: Credentials;
test.beforeEach(async ({ homeserver }) => {
creds = await homeserver.registerUser(username, password);
});
test("Loads the welcome page by default; then logs in with an existing account and lands on the home screen", async ({ test("Loads the welcome page by default; then logs in with an existing account and lands on the home screen", async ({
credentials,
page, page,
homeserver, homeserver,
checkA11y, checkA11y,
@@ -131,7 +101,7 @@ test.describe("Login", () => {
await page.getByRole("link", { name: "Sign in" }).click(); await page.getByRole("link", { name: "Sign in" }).click();
// first pick the homeserver, as otherwise the user picker won't be visible // first pick the homeserver, as otherwise the user picker won't be visible
await selectHomeserver(page, homeserver.baseUrl); await selectHomeserver(page, homeserver.config.baseUrl);
await page.getByRole("button", { name: "Edit" }).click(); await page.getByRole("button", { name: "Edit" }).click();
@@ -144,23 +114,23 @@ test.describe("Login", () => {
await expect(page.locator(".mx_ServerPicker_server")).toHaveText("server.invalid"); await expect(page.locator(".mx_ServerPicker_server")).toHaveText("server.invalid");
// switch back to the custom homeserver // switch back to the custom homeserver
await selectHomeserver(page, homeserver.baseUrl); await selectHomeserver(page, homeserver.config.baseUrl);
await expect(page.getByRole("textbox", { name: "Username" })).toBeVisible(); await expect(page.getByRole("textbox", { name: "Username" })).toBeVisible();
// Disabled because flaky - see https://github.com/vector-im/element-web/issues/24688 // Disabled because flaky - see https://github.com/vector-im/element-web/issues/24688
// cy.percySnapshot("Login"); // cy.percySnapshot("Login");
await checkA11y(); await checkA11y();
await page.getByRole("textbox", { name: "Username" }).fill(credentials.username); await page.getByRole("textbox", { name: "Username" }).fill(username);
await page.getByPlaceholder("Password").fill(credentials.password); await page.getByPlaceholder("Password").fill(password);
await page.getByRole("button", { name: "Sign in" }).click(); await page.getByRole("button", { name: "Sign in" }).click();
await expect(page).toHaveURL(/\/#\/home$/); await expect(page).toHaveURL(/\/#\/home$/);
}); });
test("Follows the original link after login", async ({ page, homeserver, credentials }) => { test("Follows the original link after login", async ({ page, homeserver }) => {
await page.goto("/#/room/!room:id"); // should redirect to the welcome page await page.goto("/#/room/!room:id"); // should redirect to the welcome page
await login(page, homeserver, credentials); await login(page, homeserver);
await expect(page).toHaveURL(/\/#\/room\/!room:id$/); await expect(page).toHaveURL(/\/#\/room\/!room:id$/);
await expect(page.getByRole("button", { name: "Join the discussion" })).toBeVisible(); await expect(page.getByRole("button", { name: "Join the discussion" })).toBeVisible();
@@ -171,19 +141,18 @@ test.describe("Login", () => {
page, page,
homeserver, homeserver,
request, request,
credentials,
}) => { }) => {
const res = await request.post(`${homeserver.baseUrl}/_matrix/client/v3/keys/device_signing/upload`, { const res = await request.post(
headers: { Authorization: `Bearer ${credentials.accessToken}` }, `${homeserver.config.baseUrl}/_matrix/client/v3/keys/device_signing/upload`,
data: DEVICE_SIGNING_KEYS_BODY, { headers: { Authorization: `Bearer ${creds.accessToken}` }, data: DEVICE_SIGNING_KEYS_BODY },
}); );
if (res.status() / 100 !== 2) { if (res.status() / 100 !== 2) {
console.log("Uploading dummy keys failed", await res.json()); console.log("Uploading dummy keys failed", await res.json());
} }
expect(res.status() / 100).toEqual(2); expect(res.status() / 100).toEqual(2);
await page.goto("/"); await page.goto("/");
await login(page, homeserver, credentials); await login(page, homeserver);
await expect(page.getByRole("heading", { name: "Verify this device", level: 1 })).toBeVisible(); await expect(page.getByRole("heading", { name: "Verify this device", level: 1 })).toBeVisible();
@@ -201,14 +170,10 @@ test.describe("Login", () => {
page, page,
homeserver, homeserver,
request, request,
credentials,
}) => { }) => {
const res = await request.post( const res = await request.post(
`${homeserver.baseUrl}/_matrix/client/v3/keys/device_signing/upload`, `${homeserver.config.baseUrl}/_matrix/client/v3/keys/device_signing/upload`,
{ { headers: { Authorization: `Bearer ${creds.accessToken}` }, data: DEVICE_SIGNING_KEYS_BODY },
headers: { Authorization: `Bearer ${credentials.accessToken}` },
data: DEVICE_SIGNING_KEYS_BODY,
},
); );
if (res.status() / 100 !== 2) { if (res.status() / 100 !== 2) {
console.log("Uploading dummy keys failed", await res.json()); console.log("Uploading dummy keys failed", await res.json());
@@ -216,7 +181,7 @@ test.describe("Login", () => {
expect(res.status() / 100).toEqual(2); expect(res.status() / 100).toEqual(2);
await page.goto("/"); await page.goto("/");
await login(page, homeserver, credentials); await login(page, homeserver);
await expect(page.getByRole("heading", { name: "Verify this device", level: 1 })).toBeVisible(); await expect(page.getByRole("heading", { name: "Verify this device", level: 1 })).toBeVisible();
@@ -235,15 +200,11 @@ test.describe("Login", () => {
page, page,
homeserver, homeserver,
request, request,
credentials,
}) => { }) => {
console.log(`uid ${credentials.userId} body`, DEVICE_SIGNING_KEYS_BODY); console.log(`uid ${creds.userId} body`, DEVICE_SIGNING_KEYS_BODY);
const res = await request.post( const res = await request.post(
`${homeserver.baseUrl}/_matrix/client/v3/keys/device_signing/upload`, `${homeserver.config.baseUrl}/_matrix/client/v3/keys/device_signing/upload`,
{ { headers: { Authorization: `Bearer ${creds.accessToken}` }, data: DEVICE_SIGNING_KEYS_BODY },
headers: { Authorization: `Bearer ${credentials.accessToken}` },
data: DEVICE_SIGNING_KEYS_BODY,
},
); );
if (res.status() / 100 !== 2) { if (res.status() / 100 !== 2) {
console.log("Uploading dummy keys failed", await res.json()); console.log("Uploading dummy keys failed", await res.json());
@@ -251,9 +212,9 @@ test.describe("Login", () => {
expect(res.status() / 100).toEqual(2); expect(res.status() / 100).toEqual(2);
await page.goto("/"); await page.goto("/");
await login(page, homeserver, credentials); await login(page, homeserver);
const h1 = page.getByRole("heading", { name: "Verify this device", level: 1 }); const h1 = await page.getByRole("heading", { name: "Verify this device", level: 1 });
await expect(h1).toBeVisible(); await expect(h1).toBeVisible();
await expect(h1.locator(".mx_CompleteSecurity_skip")).toHaveCount(0); await expect(h1.locator(".mx_CompleteSecurity_skip")).toHaveCount(0);
@@ -262,7 +223,32 @@ test.describe("Login", () => {
}); });
}); });
// tests for old-style SSO login, in which we exchange tokens with Synapse, and Synapse talks to an auth server
test.describe("SSO login", () => {
test.skip(isDendrite, "does not yet support SSO");
test.use({
startHomeserverOpts: ({ oAuthServer }, use) =>
use({
template: "default",
oAuthServerPort: oAuthServer.port,
}),
});
test("logs in with SSO and lands on the home screen", async ({ page, homeserver }) => {
// If this test fails with a screen showing "Timeout connecting to remote server", it is most likely due to
// your firewall settings: Synapse is unable to reach the OIDC server.
//
// If you are using ufw, try something like:
// sudo ufw allow in on docker0
//
await doTokenRegistration(page, homeserver);
});
});
test.describe("logout", () => { test.describe("logout", () => {
test.use({ startHomeserverOpts: "consent" });
test("should go to login page on logout", async ({ page, user }) => { test("should go to login page on logout", async ({ page, user }) => {
await page.getByRole("button", { name: "User menu" }).click(); await page.getByRole("button", { name: "User menu" }).click();
await expect(page.getByText(user.displayName, { exact: true })).toBeVisible(); await expect(page.getByText(user.displayName, { exact: true })).toBeVisible();
@@ -274,4 +260,29 @@ test.describe("Login", () => {
await expect(page).toHaveURL(/\/#\/login$/); await expect(page).toHaveURL(/\/#\/login$/);
}); });
}); });
test.describe("logout with logout_redirect_url", () => {
test.use({
startHomeserverOpts: "consent",
config: {
// We redirect to decoder-ring because it's a predictable page that isn't Element itself.
// We could use example.org, matrix.org, or something else, however this puts dependency of external
// infrastructure on our tests. In the same vein, we don't really want to figure out how to ship a
// `test-landing.html` page when running with an uncontrolled Element (via `yarn start`).
// Using the decoder-ring is just as fine, and we can search for strategic names.
logout_redirect_url: "/decoder-ring/",
},
});
test("should respect logout_redirect_url", async ({ page, user }) => {
await page.getByRole("button", { name: "User menu" }).click();
await expect(page.getByText(user.displayName, { exact: true })).toBeVisible();
// give a change for the outstanding requests queue to settle before logging out
await page.waitForTimeout(2000);
await page.locator(".mx_UserMenu_contextMenu").getByRole("menuitem", { name: "Sign out" }).click();
await expect(page).toHaveURL(/\/decoder-ring\/$/);
});
});
}); });

View File

@@ -1,35 +0,0 @@
/*
Copyright 2024 New Vector Ltd.
Copyright 2023 The Matrix.org Foundation C.I.C.
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
Please see LICENSE files in the repository root for full details.
*/
import { expect, test } from "../../element-web-test";
import { consentHomeserver } from "../../plugins/homeserver/synapse/consentHomeserver.ts";
test.use(consentHomeserver);
test.use({
config: {
// We redirect to decoder-ring because it's a predictable page that isn't Element itself.
// We could use example.org, matrix.org, or something else, however this puts dependency of external
// infrastructure on our tests. In the same vein, we don't really want to figure out how to ship a
// `test-landing.html` page when running with an uncontrolled Element (via `yarn start`).
// Using the decoder-ring is just as fine, and we can search for strategic names.
logout_redirect_url: "/decoder-ring/",
},
});
test.describe("logout with logout_redirect_url", () => {
test("should respect logout_redirect_url", async ({ page, user }) => {
await page.getByRole("button", { name: "User menu" }).click();
await expect(page.getByText(user.displayName, { exact: true })).toBeVisible();
// give a change for the outstanding requests queue to settle before logging out
await page.waitForTimeout(2000);
await page.locator(".mx_UserMenu_contextMenu").getByRole("menuitem", { name: "Sign out" }).click();
await expect(page).toHaveURL(/\/decoder-ring\/$/);
});
});

View File

@@ -2,7 +2,7 @@
Copyright 2024 New Vector Ltd. Copyright 2024 New Vector Ltd.
Copyright 2024 The Matrix.org Foundation C.I.C. Copyright 2024 The Matrix.org Foundation C.I.C.
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
Please see LICENSE files in the repository root for full details. Please see LICENSE files in the repository root for full details.
*/ */
@@ -13,7 +13,7 @@ test.describe("Overwrite login action", () => {
// This seems terminally flakey: https://github.com/element-hq/element-web/issues/27363 // This seems terminally flakey: https://github.com/element-hq/element-web/issues/27363
// I tried verious things to try & deflake it, to no avail: https://github.com/matrix-org/matrix-react-sdk/pull/12506 // I tried verious things to try & deflake it, to no avail: https://github.com/matrix-org/matrix-react-sdk/pull/12506
test.skip("Try replace existing login with new one", async ({ page, app, credentials, homeserver }) => { test.skip("Try replace existing login with new one", async ({ page, app, credentials, homeserver }) => {
await logIntoElement(page, credentials); await logIntoElement(page, homeserver, credentials);
const userMenu = await app.openUserMenu(); const userMenu = await app.openUserMenu();
await expect(userMenu.getByText(credentials.userId)).toBeVisible(); await expect(userMenu.getByText(credentials.userId)).toBeVisible();
@@ -24,7 +24,7 @@ test.describe("Overwrite login action", () => {
expect(credentials.userId).not.toBe(bobRegister.userId); expect(credentials.userId).not.toBe(bobRegister.userId);
const clientCredentials /* IMatrixClientCreds */ = { const clientCredentials /* IMatrixClientCreds */ = {
homeserverUrl: homeserver.baseUrl, homeserverUrl: homeserver.config.baseUrl,
...bobRegister, ...bobRegister,
}; };

View File

@@ -2,27 +2,28 @@
Copyright 2024 New Vector Ltd. Copyright 2024 New Vector Ltd.
Copyright 2023 The Matrix.org Foundation C.I.C. Copyright 2023 The Matrix.org Foundation C.I.C.
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
Please see LICENSE files in the repository root for full details. Please see LICENSE files in the repository root for full details.
*/ */
import { test, expect } from "../../element-web-test"; import { Page } from "@playwright/test";
import { interceptRequestsWithSoftLogout } from "./utils";
import { test, expect } from "../../element-web-test";
import { doTokenRegistration } from "./utils";
import { Credentials } from "../../plugins/homeserver";
import { isDendrite } from "../../plugins/homeserver/dendrite";
test.describe("Soft logout", () => {
test.use({ test.use({
displayName: "Alice", displayName: "Alice",
config: { startHomeserverOpts: ({ oAuthServer }, use) =>
// The only thing that we really *need* (otherwise Element refuses to load) is a default homeserver. use({
// We point that to a guaranteed-invalid domain. template: "default",
default_server_config: { oAuthServerPort: oAuthServer.port,
"m.homeserver": { }),
base_url: "https://server.invalid",
},
},
},
}); });
test.describe("Soft logout with password user", () => { test.describe("with password user", () => {
test("shows the soft-logout page when a request fails, and allows a re-login", async ({ page, user }) => { test("shows the soft-logout page when a request fails, and allows a re-login", async ({ page, user }) => {
await interceptRequestsWithSoftLogout(page, user); await interceptRequestsWithSoftLogout(page, user);
await expect(page.getByText("You're signed out")).toBeVisible(); await expect(page.getByText("You're signed out")).toBeVisible();
@@ -31,13 +32,91 @@ test.describe("Soft logout with password user", () => {
// back to the welcome page // back to the welcome page
await expect(page).toHaveURL(/\/#\/home/); await expect(page).toHaveURL(/\/#\/home/);
await expect(page.getByRole("heading", { name: "Now, let's help you get started", exact: true })).toBeVisible(); await expect(page.getByRole("heading", { name: `Welcome ${user.userId}`, exact: true })).toBeVisible();
}); });
test("still shows the soft-logout page when the page is reloaded after a soft-logout", async ({ page, user }) => { test("still shows the soft-logout page when the page is reloaded after a soft-logout", async ({
page,
user,
}) => {
await interceptRequestsWithSoftLogout(page, user); await interceptRequestsWithSoftLogout(page, user);
await expect(page.getByText("You're signed out")).toBeVisible(); await expect(page.getByText("You're signed out")).toBeVisible();
await page.reload(); await page.reload();
await expect(page.getByText("You're signed out")).toBeVisible(); await expect(page.getByText("You're signed out")).toBeVisible();
}); });
}); });
test.describe("with SSO user", () => {
test.skip(isDendrite, "does not yet support SSO");
test.use({
user: async ({ page, homeserver }, use) => {
const user = await doTokenRegistration(page, homeserver);
// Eventually, we should end up at the home screen.
await expect(page).toHaveURL(/\/#\/home$/);
await expect(page.getByRole("heading", { name: "Welcome Alice", exact: true })).toBeVisible();
await use(user);
},
});
test("shows the soft-logout page when a request fails, and allows a re-login", async ({ page, user }) => {
await expect(page.getByRole("heading", { name: "Welcome Alice", exact: true })).toBeVisible();
await interceptRequestsWithSoftLogout(page, user);
await expect(page.getByText("You're signed out")).toBeVisible();
await page.getByRole("button", { name: "Continue with OAuth test" }).click();
// click the submit button
await page.getByRole("button", { name: "Submit" }).click();
// Synapse prompts us to grant permission to Element
await expect(page.getByRole("heading", { name: "Continue to your account" })).toBeVisible();
await page.getByRole("link", { name: "Continue" }).click();
// back to the welcome page
await expect(page).toHaveURL(/\/#\/home$/);
await expect(page.getByRole("heading", { name: "Welcome Alice", exact: true })).toBeVisible();
});
});
});
/**
* Intercept calls to /sync and have them fail with a soft-logout
*
* Any further requests to /sync with the same access token are blocked.
*/
async function interceptRequestsWithSoftLogout(page: Page, user: Credentials): Promise<void> {
await page.route("**/_matrix/client/*/sync*", async (route, req) => {
const accessToken = await req.headerValue("Authorization");
// now, if the access token on this request matches the expired one, block it
if (accessToken === `Bearer ${user.accessToken}`) {
console.log("Intercepting request with soft-logged-out access token");
await route.fulfill({
status: 401,
json: {
errcode: "M_UNKNOWN_TOKEN",
error: "Soft logout",
soft_logout: true,
},
});
return;
}
// otherwise, pass through as normal
await route.continue();
});
const promise = page.waitForResponse((resp) => resp.url().includes("/sync") && resp.status() === 401);
// do something to make the active /sync return: create a new room
await page.evaluate(() => {
// don't wait for this to complete: it probably won't, because of the broken sync
window.mxMatrixClientPeg.get().createRoom({});
});
await promise;
}

View File

@@ -1,59 +0,0 @@
/*
Copyright 2024 New Vector Ltd.
Copyright 2023 The Matrix.org Foundation C.I.C.
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial
Please see LICENSE files in the repository root for full details.
*/
import { test, expect } from "../../element-web-test";
import { doTokenRegistration, interceptRequestsWithSoftLogout } from "./utils";
import { legacyOAuthHomeserver } from "../../plugins/homeserver/synapse/legacyOAuthHomeserver.ts";
test.use({
displayName: "Alice",
config: {
// The only thing that we really *need* (otherwise Element refuses to load) is a default homeserver.
// We point that to a guaranteed-invalid domain.
default_server_config: {
"m.homeserver": {
base_url: "https://server.invalid",
},
},
},
});
test.use(legacyOAuthHomeserver);
test.describe("Soft logout with SSO user", () => {
test.use({
user: async ({ page, homeserver }, use, testInfo) => {
const user = await doTokenRegistration(page, homeserver, testInfo);
// Eventually, we should end up at the home screen.
await expect(page).toHaveURL(/\/#\/home$/);
await expect(page.getByRole("heading", { name: "Welcome Alice", exact: true })).toBeVisible();
await use(user);
},
});
test("shows the soft-logout page when a request fails, and allows a re-login", async ({ page, user }) => {
await expect(page.getByRole("heading", { name: "Welcome Alice", exact: true })).toBeVisible();
await interceptRequestsWithSoftLogout(page, user);
await expect(page.getByText("You're signed out")).toBeVisible();
await page.getByRole("button", { name: "Continue with OAuth test" }).click();
// click the submit button
await page.getByRole("button", { name: "Submit" }).click();
// Synapse prompts us to grant permission to Element
await expect(page.getByRole("heading", { name: "Continue to your account" })).toBeVisible();
await page.getByRole("link", { name: "Continue" }).click();
// back to the welcome page
await expect(page).toHaveURL(/\/#\/home$/);
await expect(page.getByRole("heading", { name: "Welcome Alice", exact: true })).toBeVisible();
});
});

View File

@@ -2,11 +2,11 @@
Copyright 2024 New Vector Ltd. Copyright 2024 New Vector Ltd.
Copyright 2023 The Matrix.org Foundation C.I.C. Copyright 2023 The Matrix.org Foundation C.I.C.
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
Please see LICENSE files in the repository root for full details. Please see LICENSE files in the repository root for full details.
*/ */
import { Page, expect, TestInfo } from "@playwright/test"; import { Page, expect } from "@playwright/test";
import { Credentials, HomeserverInstance } from "../../plugins/homeserver"; import { Credentials, HomeserverInstance } from "../../plugins/homeserver";
@@ -15,13 +15,12 @@ import { Credentials, HomeserverInstance } from "../../plugins/homeserver";
export async function doTokenRegistration( export async function doTokenRegistration(
page: Page, page: Page,
homeserver: HomeserverInstance, homeserver: HomeserverInstance,
testInfo: TestInfo,
): Promise<Credentials & { displayName: string }> { ): Promise<Credentials & { displayName: string }> {
await page.goto("/#/login"); await page.goto("/#/login");
await page.getByRole("button", { name: "Edit" }).click(); await page.getByRole("button", { name: "Edit" }).click();
await page.getByRole("textbox", { name: "Other homeserver" }).fill(homeserver.baseUrl); await page.getByRole("textbox", { name: "Other homeserver" }).fill(homeserver.config.baseUrl);
await page.getByRole("button", { name: "Continue", exact: true }).click(); await page.getByRole("button", { name: "Continue" }).click();
// wait for the dialog to go away // wait for the dialog to go away
await expect(page.locator(".mx_ServerPickerDialog")).toHaveCount(0); await expect(page.locator(".mx_ServerPickerDialog")).toHaveCount(0);
@@ -36,7 +35,7 @@ export async function doTokenRegistration(
// Synapse prompts us to pick a user ID // Synapse prompts us to pick a user ID
await expect(page.getByRole("heading", { name: "Create your account" })).toBeVisible(); await expect(page.getByRole("heading", { name: "Create your account" })).toBeVisible();
await page.getByRole("textbox", { name: "Username (required)" }).fill(`alice_${testInfo.testId}`); await page.getByRole("textbox", { name: "Username (required)" }).fill("alice");
// wait for username validation to start, and complete // wait for username validation to start, and complete
await expect(page.locator("#field-username-output")).toHaveText(""); await expect(page.locator("#field-username-output")).toHaveText("");
@@ -57,44 +56,5 @@ export async function doTokenRegistration(
homeServer: window.mxMatrixClientPeg.get().getHomeserverUrl(), homeServer: window.mxMatrixClientPeg.get().getHomeserverUrl(),
password: null, password: null,
displayName: "Alice", displayName: "Alice",
username: window.mxMatrixClientPeg.get().getUserIdLocalpart(),
})); }));
} }
/**
* Intercept calls to /sync and have them fail with a soft-logout
*
* Any further requests to /sync with the same access token are blocked.
*/
export async function interceptRequestsWithSoftLogout(page: Page, user: Credentials): Promise<void> {
await page.route("**/_matrix/client/*/sync*", async (route, req) => {
const accessToken = await req.headerValue("Authorization");
// now, if the access token on this request matches the expired one, block it
if (accessToken === `Bearer ${user.accessToken}`) {
console.log("Intercepting request with soft-logged-out access token");
await route.fulfill({
status: 401,
json: {
errcode: "M_UNKNOWN_TOKEN",
error: "Soft logout",
soft_logout: true,
},
});
return;
}
// otherwise, pass through as normal
await route.continue();
});
const promise = page.waitForResponse((resp) => resp.url().includes("/sync") && resp.status() === 401);
// do something to make the active /sync return: create a new room
await page.evaluate(() => {
// don't wait for this to complete: it probably won't, because of the broken sync
void window.mxMatrixClientPeg.get().createRoom({});
});
await promise;
}

View File

@@ -2,7 +2,7 @@
Copyright 2024 New Vector Ltd. Copyright 2024 New Vector Ltd.
Copyright 2024 The Matrix.org Foundation C.I.C. Copyright 2024 The Matrix.org Foundation C.I.C.
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
Please see LICENSE files in the repository root for full details. Please see LICENSE files in the repository root for full details.
*/ */
@@ -58,16 +58,6 @@ async function editMessage(page: Page, message: Locator, newMsg: string): Promis
await editComposer.press("Enter"); await editComposer.press("Enter");
} }
const screenshotOptions = (page?: Page) => ({
mask: page ? [page.locator(".mx_MessageTimestamp")] : undefined,
// Hide the jump to bottom button in the timeline to avoid flakiness
css: `
.mx_JumpToBottomButton {
display: none !important;
}
`,
});
test.describe("Message rendering", () => { test.describe("Message rendering", () => {
[ [
{ direction: "ltr", displayName: "Quentin" }, { direction: "ltr", displayName: "Quentin" },
@@ -89,10 +79,9 @@ test.describe("Message rendering", () => {
await page.goto(`#/room/${room.roomId}`); await page.goto(`#/room/${room.roomId}`);
const msgTile = await sendMessage(page, "Hello, world!"); const msgTile = await sendMessage(page, "Hello, world!");
await expect(msgTile).toMatchScreenshot( await expect(msgTile).toMatchScreenshot(`basic-message-ltr-${direction}displayname.png`, {
`basic-message-ltr-${direction}displayname.png`, mask: [page.locator(".mx_MessageTimestamp")],
screenshotOptions(page), });
);
}, },
); );
@@ -100,17 +89,14 @@ test.describe("Message rendering", () => {
await page.goto(`#/room/${room.roomId}`); await page.goto(`#/room/${room.roomId}`);
const msgTile = await sendMessage(page, "/me lays an egg"); const msgTile = await sendMessage(page, "/me lays an egg");
await expect(msgTile).toMatchScreenshot(`emote-ltr-${direction}displayname.png`, screenshotOptions()); await expect(msgTile).toMatchScreenshot(`emote-ltr-${direction}displayname.png`);
}); });
test("should render an LTR rich text emote", async ({ page, user, app, room }) => { test("should render an LTR rich text emote", async ({ page, user, app, room }) => {
await page.goto(`#/room/${room.roomId}`); await page.goto(`#/room/${room.roomId}`);
const msgTile = await sendMessage(page, "/me lays a *free range* egg"); const msgTile = await sendMessage(page, "/me lays a *free range* egg");
await expect(msgTile).toMatchScreenshot( await expect(msgTile).toMatchScreenshot(`emote-rich-ltr-${direction}displayname.png`);
`emote-rich-ltr-${direction}displayname.png`,
screenshotOptions(),
);
}); });
test("should render an edited LTR message", async ({ page, user, app, room }) => { test("should render an edited LTR message", async ({ page, user, app, room }) => {
@@ -120,10 +106,9 @@ test.describe("Message rendering", () => {
await editMessage(page, msgTile, "Hello, universe!"); await editMessage(page, msgTile, "Hello, universe!");
await expect(msgTile).toMatchScreenshot( await expect(msgTile).toMatchScreenshot(`edited-message-ltr-${direction}displayname.png`, {
`edited-message-ltr-${direction}displayname.png`, mask: [page.locator(".mx_MessageTimestamp")],
screenshotOptions(page), });
);
}); });
test("should render a reply of a LTR message", async ({ page, user, app, room }) => { test("should render a reply of a LTR message", async ({ page, user, app, room }) => {
@@ -137,37 +122,32 @@ test.describe("Message rendering", () => {
]); ]);
await replyMessage(page, msgTile, "response to multiline message"); await replyMessage(page, msgTile, "response to multiline message");
await expect(msgTile).toMatchScreenshot( await expect(msgTile).toMatchScreenshot(`reply-message-ltr-${direction}displayname.png`, {
`reply-message-ltr-${direction}displayname.png`, mask: [page.locator(".mx_MessageTimestamp")],
screenshotOptions(page), });
);
}); });
test("should render a basic RTL text message", async ({ page, user, app, room }) => { test("should render a basic RTL text message", async ({ page, user, app, room }) => {
await page.goto(`#/room/${room.roomId}`); await page.goto(`#/room/${room.roomId}`);
const msgTile = await sendMessage(page, "مرحبا بالعالم!"); const msgTile = await sendMessage(page, "مرحبا بالعالم!");
await expect(msgTile).toMatchScreenshot( await expect(msgTile).toMatchScreenshot(`basic-message-rtl-${direction}displayname.png`, {
`basic-message-rtl-${direction}displayname.png`, mask: [page.locator(".mx_MessageTimestamp")],
screenshotOptions(page), });
);
}); });
test("should render an RTL emote", async ({ page, user, app, room }) => { test("should render an RTL emote", async ({ page, user, app, room }) => {
await page.goto(`#/room/${room.roomId}`); await page.goto(`#/room/${room.roomId}`);
const msgTile = await sendMessage(page, "/me يضع بيضة"); const msgTile = await sendMessage(page, "/me يضع بيضة");
await expect(msgTile).toMatchScreenshot(`emote-rtl-${direction}displayname.png`, screenshotOptions()); await expect(msgTile).toMatchScreenshot(`emote-rtl-${direction}displayname.png`);
}); });
test("should render a richtext RTL emote", async ({ page, user, app, room }) => { test("should render a richtext RTL emote", async ({ page, user, app, room }) => {
await page.goto(`#/room/${room.roomId}`); await page.goto(`#/room/${room.roomId}`);
const msgTile = await sendMessage(page, "/me أضع بيضة *حرة النطاق*"); const msgTile = await sendMessage(page, "/me أضع بيضة *حرة النطاق*");
await expect(msgTile).toMatchScreenshot( await expect(msgTile).toMatchScreenshot(`emote-rich-rtl-${direction}displayname.png`);
`emote-rich-rtl-${direction}displayname.png`,
screenshotOptions(),
);
}); });
test("should render an edited RTL message", async ({ page, user, app, room }) => { test("should render an edited RTL message", async ({ page, user, app, room }) => {
@@ -177,10 +157,9 @@ test.describe("Message rendering", () => {
await editMessage(page, msgTile, "مرحبا بالكون!"); await editMessage(page, msgTile, "مرحبا بالكون!");
await expect(msgTile).toMatchScreenshot( await expect(msgTile).toMatchScreenshot(`edited-message-rtl-${direction}displayname.png`, {
`edited-message-rtl-${direction}displayname.png`, mask: [page.locator(".mx_MessageTimestamp")],
screenshotOptions(page), });
);
}); });
test("should render a reply of a RTL message", async ({ page, user, app, room }) => { test("should render a reply of a RTL message", async ({ page, user, app, room }) => {
@@ -194,10 +173,9 @@ test.describe("Message rendering", () => {
]); ]);
await replyMessage(page, msgTile, "مرحبا بالعالم!"); await replyMessage(page, msgTile, "مرحبا بالعالم!");
await expect(msgTile).toMatchScreenshot( await expect(msgTile).toMatchScreenshot(`reply-message-trl-${direction}displayname.png`, {
`reply-message-trl-${direction}displayname.png`, mask: [page.locator(".mx_MessageTimestamp")],
screenshotOptions(page), });
);
}); });
}); });
}); });

View File

@@ -2,14 +2,68 @@
Copyright 2024 New Vector Ltd. Copyright 2024 New Vector Ltd.
Copyright 2023 The Matrix.org Foundation C.I.C. Copyright 2023 The Matrix.org Foundation C.I.C.
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
Please see LICENSE files in the repository root for full details. Please see LICENSE files in the repository root for full details.
*/ */
import { API, Messages } from "mailhog"; import { API, Messages } from "mailhog";
import { Page } from "@playwright/test"; import { Page } from "@playwright/test";
import { expect } from "../../element-web-test"; import { test as base, expect } from "../../element-web-test";
import { MatrixAuthenticationService } from "../../plugins/matrix-authentication-service";
import { StartHomeserverOpts } from "../../plugins/homeserver";
export const test = base.extend<{
masPrepare: MatrixAuthenticationService;
mas: MatrixAuthenticationService;
}>({
// There's a bit of a chicken and egg problem between MAS & Synapse where they each need to know how to reach each other
// so spinning up a MAS is split into the prepare & start stage: prepare mas -> homeserver -> start mas to disentangle this.
masPrepare: async ({ context }, use) => {
const mas = new MatrixAuthenticationService(context);
await mas.prepare();
await use(mas);
},
mas: [
async ({ masPrepare: mas, homeserver, mailhog }, use, testInfo) => {
await mas.start(homeserver, mailhog.instance);
await use(mas);
await mas.stop(testInfo);
},
{ auto: true },
],
startHomeserverOpts: async ({ masPrepare }, use) => {
await use({
template: "mas-oidc",
variables: {
MAS_PORT: masPrepare.port,
},
});
},
config: async ({ homeserver, startHomeserverOpts, context }, use) => {
const issuer = `http://localhost:${(startHomeserverOpts as StartHomeserverOpts).variables["MAS_PORT"]}/`;
const wellKnown = {
"m.homeserver": {
base_url: homeserver.config.baseUrl,
},
"org.matrix.msc2965.authentication": {
issuer,
account: `${issuer}account`,
},
};
// Ensure org.matrix.msc2965.authentication is in well-known
await context.route("https://localhost/.well-known/matrix/client", async (route) => {
await route.fulfill({ json: wellKnown });
});
await use({
default_server_config: wellKnown,
});
},
});
export { expect };
export async function registerAccountMas( export async function registerAccountMas(
page: Page, page: Page,
@@ -33,7 +87,7 @@ export async function registerAccountMas(
expect(messages.items).toHaveLength(1); expect(messages.items).toHaveLength(1);
}).toPass(); }).toPass();
expect(messages.items[0].to).toEqual(`${username} <${email}>`); expect(messages.items[0].to).toEqual(`${username} <${email}>`);
const [, code] = messages.items[0].text.match(/Your verification code to confirm this email address is: (\d{6})/); const [code] = messages.items[0].text.match(/(\d{6})/);
await page.getByRole("textbox", { name: "6-digit code" }).fill(code); await page.getByRole("textbox", { name: "6-digit code" }).fill(code);
await page.getByRole("button", { name: "Continue" }).click(); await page.getByRole("button", { name: "Continue" }).click();

View File

@@ -0,0 +1,34 @@
/*
Copyright 2024 New Vector Ltd.
Copyright 2023 The Matrix.org Foundation C.I.C.
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
Please see LICENSE files in the repository root for full details.
*/
import { test, expect, registerAccountMas } from ".";
import { isDendrite } from "../../plugins/homeserver/dendrite";
test.describe("OIDC Aware", () => {
test.skip(isDendrite, "does not yet support MAS");
test.slow(); // trace recording takes a while here
test("can register an account and manage it", async ({ context, page, homeserver, mailhog, app }) => {
await page.goto("/#/login");
await page.getByRole("button", { name: "Continue" }).click();
await registerAccountMas(page, mailhog.api, "alice", "alice@email.com", "Pa$sW0rD!");
// Eventually, we should end up at the home screen.
await expect(page).toHaveURL(/\/#\/home$/, { timeout: 10000 });
await expect(page.getByRole("heading", { name: "Welcome alice", exact: true })).toBeVisible();
// Open settings and navigate to account management
await app.settings.openUserSettings("Account");
const newPagePromise = context.waitForEvent("page");
await page.getByRole("button", { name: "Manage account" }).click();
// Assert new tab opened
const newPage = await newPagePromise;
await expect(newPage.getByText("Primary email")).toBeVisible();
});
});

View File

@@ -2,43 +2,35 @@
Copyright 2024 New Vector Ltd. Copyright 2024 New Vector Ltd.
Copyright 2023 The Matrix.org Foundation C.I.C. Copyright 2023 The Matrix.org Foundation C.I.C.
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
Please see LICENSE files in the repository root for full details. Please see LICENSE files in the repository root for full details.
*/ */
import { test, expect } from "../../element-web-test.ts"; import { test, expect, registerAccountMas } from ".";
import { registerAccountMas } from "."; import { isDendrite } from "../../plugins/homeserver/dendrite";
import { ElementAppPage } from "../../pages/ElementAppPage.ts"; import { ElementAppPage } from "../../pages/ElementAppPage.ts";
import { masHomeserver } from "../../plugins/homeserver/synapse/masHomeserver.ts";
test.use(masHomeserver); test.describe("OIDC Native", () => {
test.describe("OIDC Native", { tag: ["@no-firefox", "@no-webkit"] }, () => { test.skip(isDendrite, "does not yet support MAS");
test.slow(); // trace recording takes a while here test.slow(); // trace recording takes a while here
test("can register the oauth2 client and an account", async ({ test.use({
context, labsFlags: ["feature_oidc_native_flow"],
page, });
homeserver,
mailhogClient,
mas,
}, testInfo) => {
await page.clock.install();
const tokenUri = `${mas.baseUrl}/oauth2/token`; test("can register the oauth2 client and an account", async ({ context, page, homeserver, mailhog, mas }) => {
const tokenUri = `http://localhost:${mas.port}/oauth2/token`;
const tokenApiPromise = page.waitForRequest( const tokenApiPromise = page.waitForRequest(
(request) => request.url() === tokenUri && request.postDataJSON()["grant_type"] === "authorization_code", (request) => request.url() === tokenUri && request.postDataJSON()["grant_type"] === "authorization_code",
); );
await page.goto("/#/login"); await page.goto("/#/login");
await page.getByRole("button", { name: "Continue" }).click(); await page.getByRole("button", { name: "Continue" }).click();
await registerAccountMas(page, mailhog.api, "alice", "alice@email.com", "Pa$sW0rD!");
const userId = `alice_${testInfo.testId}`;
await registerAccountMas(page, mailhogClient, userId, "alice@email.com", "Pa$sW0rD!");
// Eventually, we should end up at the home screen. // Eventually, we should end up at the home screen.
await expect(page).toHaveURL(/\/#\/home$/, { timeout: 10000 }); await expect(page).toHaveURL(/\/#\/home$/, { timeout: 10000 });
await expect(page.getByRole("heading", { name: `Welcome ${userId}`, exact: true })).toBeVisible(); await expect(page.getByRole("heading", { name: "Welcome alice", exact: true })).toBeVisible();
await page.clock.runFor(20000); // run the timer so we see the token request
const tokenApiRequest = await tokenApiPromise; const tokenApiRequest = await tokenApiPromise;
expect(tokenApiRequest.postDataJSON()["grant_type"]).toBe("authorization_code"); expect(tokenApiRequest.postDataJSON()["grant_type"]).toBe("authorization_code");
@@ -53,15 +45,15 @@ test.describe("OIDC Native", { tag: ["@no-firefox", "@no-webkit"] }, () => {
// Assert MAS sees the session as OIDC Native // Assert MAS sees the session as OIDC Native
const newPage = await newPagePromise; const newPage = await newPagePromise;
await newPage.getByText("Devices").click(); await newPage.getByText("Sessions").click();
await newPage.getByText(deviceId).click(); await newPage.getByText(deviceId).click();
await expect(newPage.getByText("Element")).toBeVisible(); await expect(newPage.getByText("Element")).toBeVisible();
await expect(newPage.getByText("oauth2_session:")).toBeVisible();
await expect(newPage.getByText("http://localhost:8080/")).toBeVisible(); await expect(newPage.getByText("http://localhost:8080/")).toBeVisible();
await expect(newPage).toHaveURL(/\/oauth2_session/);
await newPage.close(); await newPage.close();
// Assert logging out revokes both tokens // Assert logging out revokes both tokens
const revokeUri = `${mas.baseUrl}/oauth2/revoke`; const revokeUri = `http://localhost:${mas.port}/oauth2/revoke`;
const revokeAccessTokenPromise = page.waitForRequest( const revokeAccessTokenPromise = page.waitForRequest(
(request) => request.url() === revokeUri && request.postDataJSON()["token_type_hint"] === "access_token", (request) => request.url() === revokeUri && request.postDataJSON()["token_type_hint"] === "access_token",
); );

View File

@@ -3,25 +3,22 @@ Copyright 2024 New Vector Ltd.
Copyright 2023 Ahmad Kadri Copyright 2023 Ahmad Kadri
Copyright 2023 Nordeck IT + Consulting GmbH. Copyright 2023 Nordeck IT + Consulting GmbH.
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
Please see LICENSE files in the repository root for full details. Please see LICENSE files in the repository root for full details.
*/ */
import { test as base, expect } from "../../element-web-test"; import { test as base, expect } from "../../element-web-test";
import { Credentials } from "../../plugins/homeserver"; import { Credentials } from "../../plugins/homeserver";
import { isDendrite } from "../../plugins/homeserver/dendrite";
const test = base.extend<{ const test = base.extend<{
user2?: Credentials; user2?: Credentials;
}>({}); }>({});
test.describe("1:1 chat room", () => { test.describe("1:1 chat room", () => {
test.skip(isDendrite, "due to a Dendrite bug https://github.com/element-hq/dendrite/issues/3492");
test.use({ test.use({
displayName: "Jeff", displayName: "Jeff",
user2: async ({ homeserver }, use, testInfo) => { user2: async ({ homeserver }, use) => {
const credentials = await homeserver.registerUser(`user2_${testInfo.testId}`, "p4s5W0rD", "Timmy"); const credentials = await homeserver.registerUser("user1234", "p4s5W0rD", "Timmy");
await use(credentials); await use(credentials);
}, },
}); });

View File

@@ -2,7 +2,7 @@
Copyright 2024 New Vector Ltd. Copyright 2024 New Vector Ltd.
Copyright 2023 The Matrix.org Foundation C.I.C. Copyright 2023 The Matrix.org Foundation C.I.C.
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
Please see LICENSE files in the repository root for full details. Please see LICENSE files in the repository root for full details.
*/ */
@@ -31,7 +31,7 @@ test.describe("permalinks", () => {
await charlotte.prepareClient(); await charlotte.prepareClient();
// We don't use a bot for danielle as we want a stable MXID. // We don't use a bot for danielle as we want a stable MXID.
const danielleId = `@danielle:${user.homeServer}`; const danielleId = "@danielle:localhost";
const room1Id = await app.client.createRoom({ name: room1Name }); const room1Id = await app.client.createRoom({ name: room1Name });
const room2Id = await app.client.createRoom({ name: room2Name }); const room2Id = await app.client.createRoom({ name: room2Name });

View File

@@ -2,7 +2,7 @@
* Copyright 2024 New Vector Ltd. * Copyright 2024 New Vector Ltd.
* Copyright 2024 The Matrix.org Foundation C.I.C. * Copyright 2024 The Matrix.org Foundation C.I.C.
* *
* SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial * SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
* Please see LICENSE files in the repository root for full details. * Please see LICENSE files in the repository root for full details.
*/ */
@@ -13,8 +13,6 @@ import { Client } from "../../pages/client";
import { ElementAppPage } from "../../pages/ElementAppPage"; import { ElementAppPage } from "../../pages/ElementAppPage";
import { Bot } from "../../pages/bot"; import { Bot } from "../../pages/bot";
type RoomRef = { name: string; roomId: string };
/** /**
* Set up for pinned message tests. * Set up for pinned message tests.
*/ */
@@ -49,7 +47,7 @@ export class Helpers {
* @param room - the name of the room to send messages into * @param room - the name of the room to send messages into
* @param messages - the list of messages to send, these can be strings or implementations of MessageSpec like `editOf` * @param messages - the list of messages to send, these can be strings or implementations of MessageSpec like `editOf`
*/ */
async receiveMessages(room: RoomRef, messages: string[]) { async receiveMessages(room: string | { name: string }, messages: string[]) {
await this.sendMessageAsClient(this.bot, room, messages); await this.sendMessageAsClient(this.bot, room, messages);
} }
@@ -57,8 +55,9 @@ export class Helpers {
* Use the supplied client to send messages or perform actions as specified by * Use the supplied client to send messages or perform actions as specified by
* the supplied {@link Message} items. * the supplied {@link Message} items.
*/ */
private async sendMessageAsClient(cli: Client, room: RoomRef, messages: string[]) { private async sendMessageAsClient(cli: Client, roomName: string | { name: string }, messages: string[]) {
const roomId = room.roomId; const room = await this.findRoomByName(typeof roomName === "string" ? roomName : roomName.name);
const roomId = await room.evaluate((room) => room.roomId);
for (const message of messages) { for (const message of messages) {
await cli.sendMessage(roomId, { body: message, msgtype: "m.text" }); await cli.sendMessage(roomId, { body: message, msgtype: "m.text" });
@@ -74,11 +73,22 @@ export class Helpers {
} }
} }
/**
* Find a room by its name
* @param roomName
* @private
*/
private async findRoomByName(roomName: string) {
return this.app.client.evaluateHandle((cli, roomName) => {
return cli.getRooms().find((r) => r.name === roomName);
}, roomName);
}
/** /**
* Open the room with the supplied name. * Open the room with the supplied name.
*/ */
async goTo(room: RoomRef) { async goTo(room: string | { name: string }) {
await this.app.viewRoomByName(room.name); await this.app.viewRoomByName(typeof room === "string" ? room : room.name);
} }
/** /**

View File

@@ -2,7 +2,7 @@
* Copyright 2024 New Vector Ltd. * Copyright 2024 New Vector Ltd.
* Copyright 2024 The Matrix.org Foundation C.I.C. * Copyright 2024 The Matrix.org Foundation C.I.C.
* *
* SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial * SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
* Please see LICENSE files in the repository root for full details. * Please see LICENSE files in the repository root for full details.
*/ */

View File

@@ -2,7 +2,7 @@
Copyright 2024 New Vector Ltd. Copyright 2024 New Vector Ltd.
Copyright 2023 The Matrix.org Foundation C.I.C. Copyright 2023 The Matrix.org Foundation C.I.C.
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
Please see LICENSE files in the repository root for full details. Please see LICENSE files in the repository root for full details.
*/ */
import { test, expect } from "../../element-web-test"; import { test, expect } from "../../element-web-test";
@@ -134,7 +134,7 @@ test.describe("Poll history", () => {
await expect(dialog.getByText(pollParams2.title)).toBeAttached(); await expect(dialog.getByText(pollParams2.title)).toBeAttached();
await expect(dialog.getByText(pollParams1.title)).toBeAttached(); await expect(dialog.getByText(pollParams1.title)).toBeAttached();
await dialog.getByText("Active polls").click(); dialog.getByText("Active polls").click();
// no more active polls // no more active polls
await expect(page.getByText("There are no active polls in this room")).toBeAttached(); await expect(page.getByText("There are no active polls in this room")).toBeAttached();

View File

@@ -2,7 +2,7 @@
Copyright 2024 New Vector Ltd. Copyright 2024 New Vector Ltd.
Copyright 2023 The Matrix.org Foundation C.I.C. Copyright 2023 The Matrix.org Foundation C.I.C.
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
Please see LICENSE files in the repository root for full details. Please see LICENSE files in the repository root for full details.
*/ */
@@ -11,11 +11,8 @@ import { Bot } from "../../pages/bot";
import { SettingLevel } from "../../../src/settings/SettingLevel"; import { SettingLevel } from "../../../src/settings/SettingLevel";
import { Layout } from "../../../src/settings/enums/Layout"; import { Layout } from "../../../src/settings/enums/Layout";
import type { Locator, Page } from "@playwright/test"; import type { Locator, Page } from "@playwright/test";
import { isDendrite } from "../../plugins/homeserver/dendrite";
test.describe("Polls", () => { test.describe("Polls", () => {
test.skip(isDendrite, "due to a Dendrite bug https://github.com/element-hq/dendrite/issues/3492");
type CreatePollOptions = { type CreatePollOptions = {
title: string; title: string;
options: string[]; options: string[];

View File

@@ -2,7 +2,7 @@
Copyright 2024 New Vector Ltd. Copyright 2024 New Vector Ltd.
Copyright 2023 The Matrix.org Foundation C.I.C. Copyright 2023 The Matrix.org Foundation C.I.C.
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
Please see LICENSE files in the repository root for full details. Please see LICENSE files in the repository root for full details.
*/ */

View File

@@ -2,18 +2,15 @@
Copyright 2024 New Vector Ltd. Copyright 2024 New Vector Ltd.
Copyright 2023 The Matrix.org Foundation C.I.C. Copyright 2023 The Matrix.org Foundation C.I.C.
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
Please see LICENSE files in the repository root for full details. Please see LICENSE files in the repository root for full details.
*/ */
/* See readme.md for tips on writing these tests. */ /* See readme.md for tips on writing these tests. */
import { test } from "."; import { test } from ".";
import { isDendrite } from "../../plugins/homeserver/dendrite";
test.describe("Read receipts", { tag: "@mergequeue" }, () => { test.describe("Read receipts", { tag: "@mergequeue" }, () => {
test.skip(isDendrite, "due to Dendrite bug https://github.com/element-hq/dendrite/issues/2970");
test.describe("editing messages", () => { test.describe("editing messages", () => {
test.describe("in threads", () => { test.describe("in threads", () => {
test("An edit of a threaded message makes the room unread", async ({ test("An edit of a threaded message makes the room unread", async ({

View File

@@ -2,18 +2,15 @@
Copyright 2024 New Vector Ltd. Copyright 2024 New Vector Ltd.
Copyright 2023 The Matrix.org Foundation C.I.C. Copyright 2023 The Matrix.org Foundation C.I.C.
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
Please see LICENSE files in the repository root for full details. Please see LICENSE files in the repository root for full details.
*/ */
/* See readme.md for tips on writing these tests. */ /* See readme.md for tips on writing these tests. */
import { test } from "."; import { test } from ".";
import { isDendrite } from "../../plugins/homeserver/dendrite";
test.describe("Read receipts", { tag: "@mergequeue" }, () => { test.describe("Read receipts", { tag: "@mergequeue" }, () => {
test.skip(isDendrite, "due to Dendrite bug https://github.com/element-hq/dendrite/issues/2970");
test.describe("editing messages", () => { test.describe("editing messages", () => {
test.describe("in the main timeline", () => { test.describe("in the main timeline", () => {
test("Editing a message leaves a room read", async ({ roomAlpha: room1, roomBeta: room2, util, msg }) => { test("Editing a message leaves a room read", async ({ roomAlpha: room1, roomBeta: room2, util, msg }) => {

View File

@@ -2,18 +2,15 @@
Copyright 2024 New Vector Ltd. Copyright 2024 New Vector Ltd.
Copyright 2023 The Matrix.org Foundation C.I.C. Copyright 2023 The Matrix.org Foundation C.I.C.
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
Please see LICENSE files in the repository root for full details. Please see LICENSE files in the repository root for full details.
*/ */
/* See readme.md for tips on writing these tests. */ /* See readme.md for tips on writing these tests. */
import { test } from "."; import { test } from ".";
import { isDendrite } from "../../plugins/homeserver/dendrite";
test.describe("Read receipts", { tag: "@mergequeue" }, () => { test.describe("Read receipts", { tag: "@mergequeue" }, () => {
test.skip(isDendrite, "due to Dendrite bug https://github.com/element-hq/dendrite/issues/2970");
test.describe("editing messages", () => { test.describe("editing messages", () => {
test.describe("thread roots", () => { test.describe("thread roots", () => {
test("An edit of a thread root leaves the room read", async ({ test("An edit of a thread root leaves the room read", async ({

View File

@@ -2,19 +2,15 @@
Copyright 2024 New Vector Ltd. Copyright 2024 New Vector Ltd.
Copyright 2023 The Matrix.org Foundation C.I.C. Copyright 2023 The Matrix.org Foundation C.I.C.
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
Please see LICENSE files in the repository root for full details. Please see LICENSE files in the repository root for full details.
*/ */
/* See readme.md for tips on writing these tests. */ /* See readme.md for tips on writing these tests. */
import { customEvent, many, test } from "."; import { customEvent, many, test } from ".";
import { isDendrite } from "../../plugins/homeserver/dendrite";
test.describe("Read receipts", { tag: "@mergequeue" }, () => { test.describe("Read receipts", { tag: "@mergequeue" }, () => {
test.skip(isDendrite, "due to Dendrite bug https://github.com/element-hq/dendrite/issues/2970");
test.slow();
test.describe("Ignored events", () => { test.describe("Ignored events", () => {
test("If all events after receipt are unimportant, the room is read", async ({ test("If all events after receipt are unimportant, the room is read", async ({
roomAlpha: room1, roomAlpha: room1,
@@ -124,7 +120,7 @@ test.describe("Read receipts", { tag: "@mergequeue" }, () => {
await util.assertUnread(room2, 40); await util.assertUnread(room2, 40);
// When I jump to a message in the middle and page up // When I jump to a message in the middle and page up
await msg.jumpTo(room2, "x\ny\nz\nMsg0020"); await msg.jumpTo(room2.name, "x\ny\nz\nMsg0020");
await util.pageUp(); await util.pageUp();
// Then the room is still unread // Then the room is still unread

View File

@@ -2,7 +2,7 @@
Copyright 2024 New Vector Ltd. Copyright 2024 New Vector Ltd.
Copyright 2023 The Matrix.org Foundation C.I.C. Copyright 2023 The Matrix.org Foundation C.I.C.
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
Please see LICENSE files in the repository root for full details. Please see LICENSE files in the repository root for full details.
*/ */
@@ -13,8 +13,6 @@ import { Bot } from "../../pages/bot";
import { Client } from "../../pages/client"; import { Client } from "../../pages/client";
import { ElementAppPage } from "../../pages/ElementAppPage"; import { ElementAppPage } from "../../pages/ElementAppPage";
type RoomRef = { name: string; roomId: string };
/** /**
* Set up for a read receipt test: * Set up for a read receipt test:
* - Create a user with the supplied name * - Create a user with the supplied name
@@ -24,9 +22,9 @@ type RoomRef = { name: string; roomId: string };
*/ */
export const test = base.extend<{ export const test = base.extend<{
roomAlphaName?: string; roomAlphaName?: string;
roomAlpha: RoomRef; roomAlpha: { name: string; roomId: string };
roomBetaName?: string; roomBetaName?: string;
roomBeta: RoomRef; roomBeta: { name: string; roomId: string };
msg: MessageBuilder; msg: MessageBuilder;
util: Helpers; util: Helpers;
}>({ }>({
@@ -250,13 +248,12 @@ export class MessageBuilder {
/** /**
* Find and display a message. * Find and display a message.
* *
* @param roomRef the ref of the room to look inside * @param roomName the name of the room to look inside
* @param message the content of the message to fine * @param message the content of the message to fine
* @param includeThreads look for messages inside threads, not just the main timeline * @param includeThreads look for messages inside threads, not just the main timeline
*/ */
async jumpTo(roomRef: RoomRef, message: string, includeThreads = false) { async jumpTo(roomName: string, message: string, includeThreads = false) {
const room = await this.helpers.findRoomById(roomRef.roomId); const room = await this.helpers.findRoomByName(roomName);
expect(room).toBeTruthy();
const foundMessage = await this.getMessage(room, message, includeThreads); const foundMessage = await this.getMessage(room, message, includeThreads);
const roomId = await room.evaluate((room) => room.roomId); const roomId = await room.evaluate((room) => room.roomId);
const foundMessageId = await foundMessage.evaluate((ev) => ev.getId()); const foundMessageId = await foundMessage.evaluate((ev) => ev.getId());
@@ -336,10 +333,9 @@ class Helpers {
* Use the supplied client to send messages or perform actions as specified by * Use the supplied client to send messages or perform actions as specified by
* the supplied {@link Message} items. * the supplied {@link Message} items.
*/ */
async sendMessageAsClient(cli: Client, roomRef: RoomRef, messages: Message[]) { async sendMessageAsClient(cli: Client, roomName: string | { name: string }, messages: Message[]) {
const roomId = roomRef.roomId; const room = await this.findRoomByName(typeof roomName === "string" ? roomName : roomName.name);
const room = await this.findRoomById(roomId); const roomId = await room.evaluate((room) => room.roomId);
expect(room).toBeTruthy();
for (const message of messages) { for (const message of messages) {
if (typeof message === "string") { if (typeof message === "string") {
@@ -363,7 +359,7 @@ class Helpers {
/** /**
* Open the room with the supplied name. * Open the room with the supplied name.
*/ */
async goTo(room: RoomRef) { async goTo(room: string | { name: string }) {
await this.app.viewRoomByName(typeof room === "string" ? room : room.name); await this.app.viewRoomByName(typeof room === "string" ? room : room.name);
} }
@@ -427,16 +423,17 @@ class Helpers {
}); });
} }
getRoomListTile(label: string) { getRoomListTile(room: string | { name: string }) {
return this.page.getByRole("treeitem", { name: new RegExp("^" + label) }); const roomName = typeof room === "string" ? room : room.name;
return this.page.getByRole("treeitem", { name: new RegExp("^" + roomName) });
} }
/** /**
* Click the "Mark as Read" context menu item on the room with the supplied name * Click the "Mark as Read" context menu item on the room with the supplied name
* in the room list. * in the room list.
*/ */
async markAsRead(room: RoomRef) { async markAsRead(room: string | { name: string }) {
await this.getRoomListTile(room.name).click({ button: "right" }); await this.getRoomListTile(room).click({ button: "right" });
await this.page.getByText("Mark as read").click(); await this.page.getByText("Mark as read").click();
} }
@@ -444,8 +441,8 @@ class Helpers {
* Assert that the room with the supplied name is "read" in the room list - i.g. * Assert that the room with the supplied name is "read" in the room list - i.g.
* has not dot or count of unread messages. * has not dot or count of unread messages.
*/ */
async assertRead(room: RoomRef) { async assertRead(room: string | { name: string }) {
const tile = this.getRoomListTile(room.name); const tile = this.getRoomListTile(room);
await expect(tile.locator(".mx_NotificationBadge_dot")).not.toBeVisible(); await expect(tile.locator(".mx_NotificationBadge_dot")).not.toBeVisible();
await expect(tile.locator(".mx_NotificationBadge_count")).not.toBeVisible(); await expect(tile.locator(".mx_NotificationBadge_count")).not.toBeVisible();
} }
@@ -455,7 +452,7 @@ class Helpers {
* (In practice, this just waits a short while to allow any unread marker to * (In practice, this just waits a short while to allow any unread marker to
* appear, and then asserts that the room is read.) * appear, and then asserts that the room is read.)
*/ */
async assertStillRead(room: RoomRef) { async assertStillRead(room: string | { name: string }) {
await this.page.waitForTimeout(200); await this.page.waitForTimeout(200);
await this.assertRead(room); await this.assertRead(room);
} }
@@ -465,8 +462,8 @@ class Helpers {
* @param room - the name of the room to check * @param room - the name of the room to check
* @param count - the numeric count to assert, or if "." specified then a bold/dot (no count) state is asserted * @param count - the numeric count to assert, or if "." specified then a bold/dot (no count) state is asserted
*/ */
async assertUnread(room: RoomRef, count: number | ".") { async assertUnread(room: string | { name: string }, count: number | ".") {
const tile = this.getRoomListTile(room.name); const tile = this.getRoomListTile(room);
if (count === ".") { if (count === ".") {
await expect(tile.locator(".mx_NotificationBadge_dot")).toBeVisible(); await expect(tile.locator(".mx_NotificationBadge_dot")).toBeVisible();
} else { } else {
@@ -481,8 +478,8 @@ class Helpers {
* @param room - the name of the room to check * @param room - the name of the room to check
* @param lessThan - the number of unread messages that is too many * @param lessThan - the number of unread messages that is too many
*/ */
async assertUnreadLessThan(room: RoomRef, lessThan: number) { async assertUnreadLessThan(room: string | { name: string }, lessThan: number) {
const tile = this.getRoomListTile(room.name); const tile = this.getRoomListTile(room);
// https://playwright.dev/docs/test-assertions#expectpoll // https://playwright.dev/docs/test-assertions#expectpoll
// .toBeLessThan doesn't have a retry mechanism, so we use .poll // .toBeLessThan doesn't have a retry mechanism, so we use .poll
await expect await expect
@@ -499,8 +496,8 @@ class Helpers {
* @param room - the name of the room to check * @param room - the name of the room to check
* @param greaterThan - the number of unread messages that is too few * @param greaterThan - the number of unread messages that is too few
*/ */
async assertUnreadGreaterThan(room: RoomRef, greaterThan: number) { async assertUnreadGreaterThan(room: string | { name: string }, greaterThan: number) {
const tile = this.getRoomListTile(room.name); const tile = this.getRoomListTile(room);
// https://playwright.dev/docs/test-assertions#expectpoll // https://playwright.dev/docs/test-assertions#expectpoll
// .toBeGreaterThan doesn't have a retry mechanism, so we use .poll // .toBeGreaterThan doesn't have a retry mechanism, so we use .poll
await expect await expect
@@ -534,10 +531,10 @@ class Helpers {
}); });
} }
async findRoomById(roomId: string): Promise<JSHandle<Room>> { async findRoomByName(roomName: string): Promise<JSHandle<Room>> {
return this.app.client.evaluateHandle((cli, roomId) => { return this.app.client.evaluateHandle((cli, roomName) => {
return cli.getRooms().find((r) => r.roomId === roomId); return cli.getRooms().find((r) => r.name === roomName);
}, roomId); }, roomName);
} }
private async getThreadListTile(rootMessage: string) { private async getThreadListTile(rootMessage: string) {
@@ -581,7 +578,7 @@ class Helpers {
* @param room - the name of the room to send messages into * @param room - the name of the room to send messages into
* @param messages - the list of messages to send, these can be strings or implementations of MessageSpec like `editOf` * @param messages - the list of messages to send, these can be strings or implementations of MessageSpec like `editOf`
*/ */
async receiveMessages(room: RoomRef, messages: Message[]) { async receiveMessages(room: string | { name: string }, messages: Message[]) {
await this.sendMessageAsClient(this.bot, room, messages); await this.sendMessageAsClient(this.bot, room, messages);
} }

View File

@@ -2,7 +2,7 @@
Copyright 2024 New Vector Ltd. Copyright 2024 New Vector Ltd.
Copyright 2023 The Matrix.org Foundation C.I.C. Copyright 2023 The Matrix.org Foundation C.I.C.
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
Please see LICENSE files in the repository root for full details. Please see LICENSE files in the repository root for full details.
*/ */

View File

@@ -2,7 +2,7 @@
Copyright 2024 New Vector Ltd. Copyright 2024 New Vector Ltd.
Copyright 2023 The Matrix.org Foundation C.I.C. Copyright 2023 The Matrix.org Foundation C.I.C.
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
Please see LICENSE files in the repository root for full details. Please see LICENSE files in the repository root for full details.
*/ */

Some files were not shown because too many files have changed in this diff Show More