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 <7t3chguy@gmail.com> * Improve user-onboarding-new screenshot Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --------- Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>pull/28217/head
|
@ -46,4 +46,6 @@ export default defineConfig<TestOptions>({
|
|||
use: { crypto: "rust" },
|
||||
},
|
||||
],
|
||||
snapshotDir: "playwright/snapshots",
|
||||
snapshotPathTemplate: "{snapshotDir}/{testFilePath}/{arg}-{platform}{ext}",
|
||||
});
|
||||
|
|
|
@ -2,5 +2,5 @@
|
|||
/html-report/
|
||||
/synapselogs/
|
||||
# Only commit snapshots from Linux
|
||||
/e2e/*/*-snapshots/*.png
|
||||
!/e2e/*/*-snapshots/*-linux.png
|
||||
/snapshots/*/*.png
|
||||
!/snapshots/*/*-linux.png
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
FROM mcr.microsoft.com/playwright:v1.40.0-jammy
|
||||
|
||||
WORKDIR /work/matrix-react-sdk
|
||||
VOLUME ["/work/element-web/node_modules"]
|
||||
|
||||
RUN apt-get update && apt-get -y install docker.io
|
||||
|
||||
COPY docker-entrypoint.sh /opt/docker-entrypoint.sh
|
||||
ENTRYPOINT ["bash", "/opt/docker-entrypoint.sh"]
|
|
@ -2,14 +2,12 @@ To update snapshots you will need to run Playwright on a Linux machine.
|
|||
If you have access to docker then you can use the following:
|
||||
|
||||
```shell
|
||||
docker build playwright -t matrix-react-sdk-playwright
|
||||
docker run \
|
||||
--rm \
|
||||
--network host \
|
||||
-v $(pwd)/../:/work/ \
|
||||
-v playwright-ew-node-modules:/work/element-web/node_modules \
|
||||
-v /var/run/docker.sock:/var/run/docker.sock \
|
||||
-v /tmp/:/tmp/ \
|
||||
-w /work/matrix-react-sdk \
|
||||
-it mcr.microsoft.com/playwright:v1.40.0-jammy \
|
||||
sh -c "apt-get update && apt-get -y install docker.io && yarn --cwd ../element-web install && npx playwright test --update-snapshots --reporter line"
|
||||
-it matrix-react-sdk-playwright
|
||||
```
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
yarn --cwd ../element-web install
|
||||
npx playwright test --update-snapshots --reporter line --project='Legacy Crypto' $1
|
Before Width: | Height: | Size: 1.3 MiB |
|
@ -45,7 +45,7 @@ test.describe("User Onboarding (new user)", () => {
|
|||
await expect(
|
||||
page.getByRole("dialog").getByRole("heading", { level: 2, name: "Download Element" }),
|
||||
).toBeVisible();
|
||||
await expect(page.getByRole("dialog")).toHaveScreenshot();
|
||||
await expect(page.locator(".mx_Dialog")).toHaveScreenshot();
|
||||
});
|
||||
|
||||
test("using find friends action should increase progress", async ({ page, homeserver }) => {
|
||||
|
|
Before Width: | Height: | Size: 37 KiB |
Before Width: | Height: | Size: 37 KiB |
Before Width: | Height: | Size: 124 KiB |
Before Width: | Height: | Size: 1.3 MiB After Width: | Height: | Size: 1.3 MiB |
After Width: | Height: | Size: 38 KiB |
Before Width: | Height: | Size: 124 KiB After Width: | Height: | Size: 124 KiB |