@element-hq/element-web-playwright-common 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Dockerfile +9 -0
- package/README.md +28 -0
- package/lib/element-web-test.d.ts +26 -0
- package/lib/element-web-test.d.ts.map +1 -0
- package/lib/element-web-test.js +54 -0
- package/lib/expect/axe.d.ts +11 -0
- package/lib/expect/axe.d.ts.map +1 -0
- package/lib/expect/axe.js +22 -0
- package/lib/expect/index.d.ts +6 -0
- package/lib/expect/index.d.ts.map +1 -0
- package/lib/expect/index.js +10 -0
- package/lib/expect/screenshot.d.ts +14 -0
- package/lib/expect/screenshot.d.ts.map +1 -0
- package/lib/expect/screenshot.js +48 -0
- package/lib/expect/toHaveNoViolations.d.ts +11 -0
- package/lib/expect/toHaveNoViolations.d.ts.map +1 -0
- package/lib/expect/toHaveNoViolations.js +22 -0
- package/lib/expect/toMatchScreenshot.d.ts +13 -0
- package/lib/expect/toMatchScreenshot.d.ts.map +1 -0
- package/lib/expect/toMatchScreenshot.js +44 -0
- package/lib/expect/toPassAxeCheck.d.ts +7 -0
- package/lib/expect/toPassAxeCheck.d.ts.map +1 -0
- package/lib/expect/toPassAxeCheck.js +22 -0
- package/lib/fixtures/axe.d.ts +8 -0
- package/lib/fixtures/axe.d.ts.map +1 -0
- package/lib/fixtures/axe.js +15 -0
- package/lib/fixtures/index.d.ts +10 -0
- package/lib/fixtures/index.d.ts.map +1 -0
- package/lib/fixtures/index.js +10 -0
- package/lib/fixtures/services.d.ts +57 -0
- package/lib/fixtures/services.d.ts.map +1 -0
- package/lib/fixtures/services.js +114 -0
- package/lib/fixtures/user.d.ts +31 -0
- package/lib/fixtures/user.d.ts.map +1 -0
- package/lib/fixtures/user.js +47 -0
- package/lib/index.d.ts +35 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +54 -0
- package/lib/logger.d.ts +10 -0
- package/lib/logger.d.ts.map +1 -0
- package/lib/logger.js +59 -0
- package/lib/playwright.d.ts +2 -0
- package/lib/playwright.d.ts.map +1 -0
- package/lib/playwright.js +1 -0
- package/lib/testcontainers/HomeserverContainer.d.ts +70 -0
- package/lib/testcontainers/HomeserverContainer.d.ts.map +1 -0
- package/lib/testcontainers/HomeserverContainer.js +7 -0
- package/lib/testcontainers/index.d.ts +5 -0
- package/lib/testcontainers/index.d.ts.map +1 -0
- package/lib/testcontainers/index.js +9 -0
- package/lib/testcontainers/mailpit.d.ts +33 -0
- package/lib/testcontainers/mailpit.d.ts.map +1 -0
- package/lib/testcontainers/mailpit.js +52 -0
- package/lib/testcontainers/mas.d.ts +182 -0
- package/lib/testcontainers/mas.d.ts.map +1 -0
- package/lib/testcontainers/mas.js +311 -0
- package/lib/testcontainers/synapse.d.ts +229 -0
- package/lib/testcontainers/synapse.d.ts.map +1 -0
- package/lib/testcontainers/synapse.js +383 -0
- package/lib/utils/api.d.ts +49 -0
- package/lib/utils/api.d.ts.map +1 -0
- package/lib/utils/api.js +73 -0
- package/lib/utils/logger.d.ts +25 -0
- package/lib/utils/logger.d.ts.map +1 -0
- package/lib/utils/logger.js +74 -0
- package/lib/utils/object.d.ts +8 -0
- package/lib/utils/object.d.ts.map +1 -0
- package/lib/utils/object.js +15 -0
- package/lib/utils/port.d.ts +5 -0
- package/lib/utils/port.d.ts.map +1 -0
- package/lib/utils/port.js +20 -0
- package/lib/utils/rand.d.ts +6 -0
- package/lib/utils/rand.d.ts.map +1 -0
- package/lib/utils/rand.js +15 -0
- package/package.json +30 -0
- package/playwright-screenshots.sh +53 -0
- package/src/@types/playwright-core.d.ts +12 -0
- package/src/expect/axe.ts +37 -0
- package/src/expect/index.ts +21 -0
- package/src/expect/screenshot.ts +79 -0
- package/src/fixtures/axe.ts +22 -0
- package/src/fixtures/index.ts +15 -0
- package/src/fixtures/services.ts +188 -0
- package/src/fixtures/user.ts +93 -0
- package/src/index.ts +92 -0
- package/src/testcontainers/HomeserverContainer.ts +87 -0
- package/src/testcontainers/index.ts +15 -0
- package/src/testcontainers/mailpit.ts +62 -0
- package/src/testcontainers/mas.ts +382 -0
- package/src/testcontainers/synapse.ts +493 -0
- package/src/utils/api.ts +113 -0
- package/src/utils/logger.ts +79 -0
- package/src/utils/object.ts +16 -0
- package/src/utils/port.ts +22 -0
- package/src/utils/rand.ts +17 -0
- package/tsconfig.json +10 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2024-2025 New Vector Ltd.
|
|
3
|
+
Copyright 2022 The Matrix.org Foundation C.I.C.
|
|
4
|
+
|
|
5
|
+
SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
|
|
6
|
+
Please see LICENSE files in the repository root for full details.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import * as net from "node:net";
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Get a free networking port on the system.
|
|
13
|
+
*/
|
|
14
|
+
export async function getFreePort(): Promise<number> {
|
|
15
|
+
return new Promise<number>((resolve) => {
|
|
16
|
+
const srv = net.createServer();
|
|
17
|
+
srv.listen(0, () => {
|
|
18
|
+
const port = (<net.AddressInfo>srv.address()).port;
|
|
19
|
+
srv.close(() => resolve(port));
|
|
20
|
+
});
|
|
21
|
+
});
|
|
22
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2024-2025 New Vector Ltd.
|
|
3
|
+
Copyright 2023 The Matrix.org Foundation C.I.C.
|
|
4
|
+
|
|
5
|
+
SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
|
|
6
|
+
Please see LICENSE files in the repository root for full details.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import crypto from "node:crypto";
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Generate a random base64 string of the given number of bytes.
|
|
13
|
+
* @param numBytes - The number of bytes to generate.
|
|
14
|
+
*/
|
|
15
|
+
export function randB64Bytes(numBytes: number): string {
|
|
16
|
+
return crypto.randomBytes(numBytes).toString("base64").replace(/=*$/, "");
|
|
17
|
+
}
|