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

Commit dbae856

Browse files
authored
Consolidate snapshots between Legacy & Rust crypto in the happy case (#11950)
* Consolidate snapshots between Legacy & Rust crypto in the happy case Signed-off-by: Michael Telatynski <[email protected]> * Improve user-onboarding-new screenshot Signed-off-by: Michael Telatynski <[email protected]> --------- Signed-off-by: Michael Telatynski <[email protected]>
1 parent d47f856 commit dbae856

13 files changed

+22
-7
lines changed

playwright.config.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,6 @@ export default defineConfig<TestOptions>({
4646
use: { crypto: "rust" },
4747
},
4848
],
49+
snapshotDir: "playwright/snapshots",
50+
snapshotPathTemplate: "{snapshotDir}/{testFilePath}/{arg}-{platform}{ext}",
4951
});

playwright/.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
/html-report/
33
/synapselogs/
44
# Only commit snapshots from Linux
5-
/e2e/*/*-snapshots/*.png
6-
!/e2e/*/*-snapshots/*-linux.png
5+
/snapshots/*/*.png
6+
!/snapshots/*/*-linux.png

playwright/Dockerfile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
FROM mcr.microsoft.com/playwright:v1.40.0-jammy
2+
3+
WORKDIR /work/matrix-react-sdk
4+
VOLUME ["/work/element-web/node_modules"]
5+
6+
RUN apt-get update && apt-get -y install docker.io
7+
8+
COPY docker-entrypoint.sh /opt/docker-entrypoint.sh
9+
ENTRYPOINT ["bash", "/opt/docker-entrypoint.sh"]

playwright/README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,12 @@ To update snapshots you will need to run Playwright on a Linux machine.
22
If you have access to docker then you can use the following:
33

44
```shell
5+
docker build playwright -t matrix-react-sdk-playwright
56
docker run \
67
--rm \
78
--network host \
89
-v $(pwd)/../:/work/ \
9-
-v playwright-ew-node-modules:/work/element-web/node_modules \
1010
-v /var/run/docker.sock:/var/run/docker.sock \
1111
-v /tmp/:/tmp/ \
12-
-w /work/matrix-react-sdk \
13-
-it mcr.microsoft.com/playwright:v1.40.0-jammy \
14-
sh -c "apt-get update && apt-get -y install docker.io && yarn --cwd ../element-web install && npx playwright test --update-snapshots --reporter line"
12+
-it matrix-react-sdk-playwright
1513
```

playwright/docker-entrypoint.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
yarn --cwd ../element-web install
6+
npx playwright test --update-snapshots --reporter line --project='Legacy Crypto' $1
-1.25 MB
Binary file not shown.

playwright/e2e/user-onboarding/user-onboarding-new.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ test.describe("User Onboarding (new user)", () => {
4545
await expect(
4646
page.getByRole("dialog").getByRole("heading", { level: 2, name: "Download Element" }),
4747
).toBeVisible();
48-
await expect(page.getByRole("dialog")).toHaveScreenshot();
48+
await expect(page.locator(".mx_Dialog")).toHaveScreenshot();
4949
});
5050

5151
test("using find friends action should increase progress", async ({ page, homeserver }) => {
-36.8 KB
Binary file not shown.
-36.8 KB
Binary file not shown.
-125 KB
Binary file not shown.

0 commit comments

Comments
 (0)