@element-hq/element-web-playwright-common 2.3.0 → 3.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 +14 -8
- package/README.md +2 -2
- package/docker-entrypoint.sh +1 -8
- package/lib/expect/axe.d.ts +1 -1
- package/lib/expect/axe.d.ts.map +1 -1
- package/lib/expect/screenshot.d.ts +1 -1
- package/lib/expect/screenshot.d.ts.map +1 -1
- package/lib/fixtures/axe.d.ts +2 -2
- package/lib/fixtures/axe.d.ts.map +1 -1
- package/lib/fixtures/services.d.ts.map +1 -1
- package/lib/fixtures/services.js +2 -22
- package/lib/fixtures/user.d.ts +2 -2
- package/lib/fixtures/user.d.ts.map +1 -1
- package/lib/flaky-reporter.d.ts +24 -0
- package/lib/flaky-reporter.d.ts.map +1 -0
- package/lib/flaky-reporter.js +153 -0
- package/lib/stale-screenshot-reporter.d.ts +2 -1
- package/lib/stale-screenshot-reporter.d.ts.map +1 -1
- package/lib/stale-screenshot-reporter.js +13 -5
- package/lib/testcontainers/index.d.ts +2 -1
- package/lib/testcontainers/index.d.ts.map +1 -1
- package/lib/testcontainers/index.js +2 -1
- package/lib/testcontainers/mas.d.ts +5 -2
- package/lib/testcontainers/mas.d.ts.map +1 -1
- package/lib/testcontainers/mas.js +14 -2
- package/lib/testcontainers/postgres.d.ts +5 -0
- package/lib/testcontainers/postgres.d.ts.map +1 -0
- package/lib/testcontainers/postgres.js +31 -0
- package/lib/testcontainers/synapse.d.ts +6 -0
- package/lib/testcontainers/synapse.d.ts.map +1 -1
- package/lib/testcontainers/synapse.js +17 -1
- package/package.json +9 -10
- package/playwright-screenshots.sh +33 -126
- package/project.json +38 -0
- package/src/fixtures/services.ts +3 -22
- package/src/flaky-reporter.ts +188 -0
- package/src/stale-screenshot-reporter.ts +14 -4
- package/src/testcontainers/index.ts +2 -0
- package/src/testcontainers/mas.ts +21 -0
- package/src/testcontainers/postgres.ts +40 -0
- package/src/testcontainers/synapse.ts +24 -1
- package/tsconfig.json +8 -3
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2026 Element Creations Ltd.
|
|
3
|
+
|
|
4
|
+
SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
|
|
5
|
+
Please see LICENSE files in the repository root for full details.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { PostgreSqlContainer, type StartedPostgreSqlContainer } from "@testcontainers/postgresql";
|
|
9
|
+
import { type StartedNetwork } from "testcontainers";
|
|
10
|
+
|
|
11
|
+
import { type Logger } from "../utils/logger.js";
|
|
12
|
+
|
|
13
|
+
export async function makePostgres(
|
|
14
|
+
network: StartedNetwork,
|
|
15
|
+
logger: Logger,
|
|
16
|
+
name = "postgres",
|
|
17
|
+
): Promise<StartedPostgreSqlContainer> {
|
|
18
|
+
const container = await new PostgreSqlContainer("postgres:13.3-alpine")
|
|
19
|
+
.withNetwork(network)
|
|
20
|
+
.withNetworkAliases(name)
|
|
21
|
+
.withLogConsumer(logger.getConsumer(name))
|
|
22
|
+
.withTmpFs({
|
|
23
|
+
"/dev/shm/pgdata/data": "",
|
|
24
|
+
})
|
|
25
|
+
.withEnvironment({
|
|
26
|
+
PG_DATA: "/dev/shm/pgdata/data",
|
|
27
|
+
})
|
|
28
|
+
.withCommand([
|
|
29
|
+
"-c",
|
|
30
|
+
"shared_buffers=128MB",
|
|
31
|
+
"-c",
|
|
32
|
+
`fsync=off`,
|
|
33
|
+
"-c",
|
|
34
|
+
`synchronous_commit=off`,
|
|
35
|
+
"-c",
|
|
36
|
+
"full_page_writes=off",
|
|
37
|
+
])
|
|
38
|
+
.start();
|
|
39
|
+
return container;
|
|
40
|
+
}
|
|
@@ -184,6 +184,14 @@ const DEFAULT_CONFIG = {
|
|
|
184
184
|
},
|
|
185
185
|
room_list_publication_rules: [{ action: "allow" }],
|
|
186
186
|
modules: [] as Array<{ module: string; config?: Record<string, unknown> }>,
|
|
187
|
+
matrix_authentication_service: undefined as
|
|
188
|
+
| undefined
|
|
189
|
+
| {
|
|
190
|
+
enabled?: boolean;
|
|
191
|
+
endpoint?: string;
|
|
192
|
+
secret?: string | null;
|
|
193
|
+
secret_path?: string | null;
|
|
194
|
+
},
|
|
187
195
|
};
|
|
188
196
|
|
|
189
197
|
/**
|
|
@@ -278,7 +286,22 @@ export class SynapseContainer extends GenericContainer implements HomeserverCont
|
|
|
278
286
|
}
|
|
279
287
|
|
|
280
288
|
public withMatrixAuthenticationService(mas?: StartedMatrixAuthenticationServiceContainer): this {
|
|
281
|
-
|
|
289
|
+
if (mas) {
|
|
290
|
+
this.mas = mas;
|
|
291
|
+
this.withConfig({
|
|
292
|
+
matrix_authentication_service: {
|
|
293
|
+
enabled: true,
|
|
294
|
+
endpoint: `http://${mas.getHostname()}:8080/`,
|
|
295
|
+
secret: mas.sharedSecret,
|
|
296
|
+
},
|
|
297
|
+
// Must be disabled when using MAS.
|
|
298
|
+
password_config: {
|
|
299
|
+
enabled: false,
|
|
300
|
+
},
|
|
301
|
+
// Must be disabled when using MAS.
|
|
302
|
+
enable_registration: false,
|
|
303
|
+
});
|
|
304
|
+
}
|
|
282
305
|
return this;
|
|
283
306
|
}
|
|
284
307
|
|
package/tsconfig.json
CHANGED
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "http://json.schemastore.org/tsconfig",
|
|
3
|
-
"extends": "../../tsconfig.json",
|
|
4
3
|
"compilerOptions": {
|
|
4
|
+
"target": "esnext",
|
|
5
|
+
"lib": ["dom", "es2022", "esnext"],
|
|
6
|
+
"esModuleInterop": true,
|
|
7
|
+
"strict": true,
|
|
8
|
+
"declaration": true,
|
|
5
9
|
"outDir": "lib",
|
|
6
10
|
"declarationMap": true,
|
|
7
|
-
"module": "
|
|
8
|
-
"moduleResolution": "
|
|
11
|
+
"module": "es2022",
|
|
12
|
+
"moduleResolution": "bundler",
|
|
13
|
+
"types": [],
|
|
9
14
|
"allowImportingTsExtensions": false
|
|
10
15
|
},
|
|
11
16
|
"include": ["src"]
|