-
Notifications
You must be signed in to change notification settings - Fork 269
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update dependency playwright to v1.40.1 (#1242)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Michael Telatynski <[email protected]>
- Loading branch information
1 parent
ab7002e
commit c4e697e
Showing
15 changed files
with
220 additions
and
1,399 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
Copyright 2023 The Matrix.org Foundation C.I.C. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
import { defineConfig } from "@playwright/test"; | ||
|
||
export default defineConfig({ | ||
use: { | ||
viewport: { width: 1280, height: 720 }, | ||
video: "retain-on-failure", | ||
trace: "on-first-retry", | ||
}, | ||
testDir: "playwright/e2e", | ||
outputDir: "playwright/test-results", | ||
workers: 1, | ||
retries: process.env.CI ? 2 : 0, | ||
reporter: [["html", { outputFolder: "playwright/html-report" }]], | ||
snapshotDir: "playwright/snapshots", | ||
snapshotPathTemplate: "{snapshotDir}/{testFilePath}/{arg}-{platform}{ext}", | ||
timeout: 10 * 1000, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
/test-results/ | ||
/html-report/ | ||
# Only commit snapshots from Linux | ||
/snapshots/**/*.png | ||
!/snapshots/**/*-linux.png |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
FROM mcr.microsoft.com/playwright:v1.40.1-jammy | ||
|
||
WORKDIR /work/element-desktop | ||
|
||
RUN apt-get update && apt-get -y install xvfb | ||
|
||
USER 1000:1000 | ||
|
||
COPY docker-entrypoint.sh /opt/docker-entrypoint.sh | ||
ENTRYPOINT ["bash", "/opt/docker-entrypoint.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
echo "Starting Xvfb" | ||
Xvfb :99 -ac & | ||
sleep 2 | ||
|
||
export DISPLAY=:99 | ||
|
||
npx playwright test --update-snapshots --reporter line $1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* | ||
Copyright 2022 - 2023 The Matrix.org Foundation C.I.C. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
import { test, expect } from "../../element-desktop-test"; | ||
|
||
test.describe("App launch", () => { | ||
test("should launch and render the welcome view successfully", async ({ page }) => { | ||
await page.locator("#matrixchat").waitFor(); | ||
await page.locator(".mx_Welcome").waitFor(); | ||
await expect(page).toHaveURL("vector://vector/webapp/#/welcome"); | ||
await expect(page).toHaveScreenshot(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
/* | ||
Copyright 2023 The Matrix.org Foundation C.I.C. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
import { _electron as electron, test as base, expect as baseExpect, type ElectronApplication } from "@playwright/test"; | ||
import fs from "node:fs/promises"; | ||
import path from "node:path"; | ||
import os from "node:os"; | ||
|
||
export const test = base.extend<{ app: ElectronApplication; tmpDir: string }>({ | ||
// eslint-disable-next-line no-empty-pattern | ||
tmpDir: async ({}, use) => { | ||
const tmpDir = await fs.mkdtemp(path.join(os.tmpdir(), "element-desktop-tests-")); | ||
console.log("Using temp profile directory: ", tmpDir); | ||
await use(tmpDir); | ||
await fs.rm(tmpDir, { recursive: true }); | ||
}, | ||
app: async ({ tmpDir }, use) => { | ||
const args = ["--profile-dir", tmpDir]; | ||
|
||
const executablePath = process.env["ELEMENT_DESKTOP_EXECUTABLE"]; | ||
if (!executablePath) { | ||
// Unpackaged mode testing | ||
args.unshift("./lib/electron-main.js"); | ||
} | ||
|
||
const app = await electron.launch({ | ||
env: process.env, | ||
executablePath, | ||
args, | ||
}); | ||
|
||
await app.firstWindow(); | ||
await use(app); | ||
}, | ||
page: async ({ app }, use) => { | ||
const window = await app.firstWindow(); | ||
await use(window); | ||
await app.close().catch((e) => { | ||
console.error(e); | ||
}); | ||
}, | ||
}); | ||
|
||
export const expect = baseExpect; |
Binary file added
BIN
+1.16 MB
...s/App-launch-should-launch-and-render-the-welcome-view-successfully-1-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"compilerOptions": { | ||
"resolveJsonModule": true, | ||
"moduleResolution": "node", | ||
"esModuleInterop": true, | ||
"target": "es2017", | ||
"module": "es2022", | ||
"lib": ["ESNext", "es2021", "dom"] | ||
}, | ||
"include": ["**/*.ts"] | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.