@element-hq/element-web-playwright-common 2.2.7 → 2.3.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/lib/expect/axe.d.ts +1 -1
- package/lib/expect/axe.d.ts.map +1 -1
- package/lib/fixtures/axe.d.ts +1 -1
- package/lib/fixtures/axe.d.ts.map +1 -1
- package/lib/fixtures/axe.js +1 -1
- package/lib/index.d.ts +10 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +11 -1
- package/package.json +2 -2
- package/src/expect/axe.ts +1 -1
- package/src/fixtures/axe.ts +1 -1
- package/src/index.ts +21 -1
package/lib/expect/axe.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ExpectMatcherState, type MatcherReturnType } from "@playwright/test";
|
|
2
|
-
import type AxeBuilder from "@axe-core/playwright";
|
|
2
|
+
import type { AxeBuilder } from "@axe-core/playwright";
|
|
3
3
|
export type Expectations = {
|
|
4
4
|
/**
|
|
5
5
|
* Assert that the given AxeBuilder instance has no violations.
|
package/lib/expect/axe.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"axe.d.ts","sourceRoot":"","sources":["../../src/expect/axe.ts"],"names":[],"mappings":"AAQA,OAAO,EAA8B,KAAK,kBAAkB,EAAE,KAAK,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAE/G,OAAO,KAAK,UAAU,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"axe.d.ts","sourceRoot":"","sources":["../../src/expect/axe.ts"],"names":[],"mappings":"AAQA,OAAO,EAA8B,KAAK,kBAAkB,EAAE,KAAK,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAE/G,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAEvD,MAAM,MAAM,YAAY,GAAG;IACvB;;;OAGG;IACH,kBAAkB,EAAE,CAAC,IAAI,EAAE,kBAAkB,EAAE,QAAQ,EAAE,UAAU,KAAK,OAAO,CAAC,iBAAiB,CAAC,CAAC;CACtG,CAAC;AAEF,eAAO,MAAM,MAAM,iDAgBjB,CAAC"}
|
package/lib/fixtures/axe.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import AxeBuilder from "@axe-core/playwright";
|
|
1
|
+
import { AxeBuilder } from "@axe-core/playwright";
|
|
2
2
|
export declare const test: import("@playwright/test").TestType<import("@playwright/test").PlaywrightTestArgs & import("@playwright/test").PlaywrightTestOptions & {
|
|
3
3
|
/**
|
|
4
4
|
* AxeBuilder instance for the current page
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"axe.d.ts","sourceRoot":"","sources":["../../src/fixtures/axe.ts"],"names":[],"mappings":"AASA,OAAO,UAAU,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"axe.d.ts","sourceRoot":"","sources":["../../src/fixtures/axe.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAIlD,eAAO,MAAM,IAAI;IACb;;OAEG;SACE,UAAU;wGAMjB,CAAC"}
|
package/lib/fixtures/axe.js
CHANGED
|
@@ -6,7 +6,7 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
|
|
|
6
6
|
Please see LICENSE files in the repository root for full details.
|
|
7
7
|
*/
|
|
8
8
|
import { test as base } from "@playwright/test";
|
|
9
|
-
import AxeBuilder from "@axe-core/playwright";
|
|
9
|
+
import { AxeBuilder } from "@axe-core/playwright";
|
|
10
10
|
// This fixture is useful for simple component library tests that won't want any extra services like a homeserver, so we
|
|
11
11
|
// explicitly avoid pulling anything more than playwright's base fixtures in.
|
|
12
12
|
export const test = base.extend({
|
package/lib/index.d.ts
CHANGED
|
@@ -27,6 +27,16 @@ export interface TestFixtures {
|
|
|
27
27
|
config: Partial<typeof CONFIG_JSON>;
|
|
28
28
|
labsFlags: string[];
|
|
29
29
|
disablePresence: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Whether the left panel should have its width fixed.
|
|
32
|
+
* This is done because the library that we use for rendering collapsible
|
|
33
|
+
* panels uses math to calculate the width which can sometimes leads to +/-1px
|
|
34
|
+
* difference. While this does not matter to the user, it can lead to screenshot
|
|
35
|
+
* tests failing.
|
|
36
|
+
* Defaults to true, should be set to false via {@link base.use} when you want to test the collapse
|
|
37
|
+
* behaviour.
|
|
38
|
+
*/
|
|
39
|
+
lockLeftPanelWidth: boolean;
|
|
30
40
|
}
|
|
31
41
|
export declare const test: import("playwright/test").TestType<import("playwright/test").PlaywrightTestArgs & import("playwright/test").PlaywrightTestOptions & {
|
|
32
42
|
axe: import("@axe-core/playwright").AxeBuilder;
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,KAAK,MAAM,IAAI,UAAU,EAAE,MAAM,oCAAoC,CAAC;AAK/E,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AAEnC,OAAO,EAAE,mCAAmC,EAAE,MAAM,oBAAoB,CAAC;AAQzE,MAAM,WAAW,MAAO,SAAQ,UAAU;IACtC,qBAAqB,EAAE;QACnB,cAAc,CAAC,EAAE;YACb,QAAQ,EAAE,MAAM,CAAC;YACjB,WAAW,CAAC,EAAE,MAAM,CAAC;SACxB,CAAC;QACF,mBAAmB,CAAC,EAAE;YAClB,QAAQ,EAAE,MAAM,CAAC;YACjB,WAAW,CAAC,EAAE,MAAM,CAAC;SACxB,CAAC;KACL,CAAC;IACF,yBAAyB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACpD,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC1C,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,EAAE,MAAM,CAAC,MA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AW,CAAC,CAAC;IAEpC,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,eAAe,EAAE,OAAO,CAAC;IACzB;;;;;;;;OAQG;IACH,kBAAkB,EAAE,OAAO,CAAC;CAC/B;AAED,eAAO,MAAM,IAAI;;;;;;;kNAmBf,CAAC;AAEH,OAAO,EAAE,MAAM,EAAE,KAAK,wBAAwB,EAAE,MAAM,mBAAmB,CAAC"}
|
package/lib/index.js
CHANGED
|
@@ -32,8 +32,18 @@ export const test = base.extend({
|
|
|
32
32
|
config: async ({}, use) => use({}),
|
|
33
33
|
labsFlags: async ({}, use) => use([]),
|
|
34
34
|
disablePresence: async ({}, use) => use(false),
|
|
35
|
-
|
|
35
|
+
lockLeftPanelWidth: true,
|
|
36
|
+
page: async ({ homeserver, context, page, config, labsFlags, disablePresence, lockLeftPanelWidth }, use) => {
|
|
36
37
|
await routeConfigJson(context, homeserver.baseUrl, config, labsFlags, disablePresence);
|
|
38
|
+
if (lockLeftPanelWidth) {
|
|
39
|
+
await page.addStyleTag({
|
|
40
|
+
content: `
|
|
41
|
+
#left-panel {
|
|
42
|
+
flex: 0 0 369.6875px !important;
|
|
43
|
+
}
|
|
44
|
+
`,
|
|
45
|
+
});
|
|
46
|
+
}
|
|
37
47
|
await use(page);
|
|
38
48
|
},
|
|
39
49
|
});
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@element-hq/element-web-playwright-common",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.3.0",
|
|
5
5
|
"license": "SEE LICENSE IN README.md",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@axe-core/playwright": "^4.10.1",
|
|
33
33
|
"@testcontainers/postgresql": "^11.0.0",
|
|
34
|
-
"glob": "^13.0.
|
|
34
|
+
"glob": "^13.0.5",
|
|
35
35
|
"lodash-es": "^4.17.23",
|
|
36
36
|
"mailpit-api": "^1.2.0",
|
|
37
37
|
"strip-ansi": "^7.1.0",
|
package/src/expect/axe.ts
CHANGED
|
@@ -8,7 +8,7 @@ Please see LICENSE files in the repository root for full details.
|
|
|
8
8
|
|
|
9
9
|
import { test, expect as baseExpect, type ExpectMatcherState, type MatcherReturnType } from "@playwright/test";
|
|
10
10
|
|
|
11
|
-
import type AxeBuilder from "@axe-core/playwright";
|
|
11
|
+
import type { AxeBuilder } from "@axe-core/playwright";
|
|
12
12
|
|
|
13
13
|
export type Expectations = {
|
|
14
14
|
/**
|
package/src/fixtures/axe.ts
CHANGED
|
@@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details.
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import { test as base } from "@playwright/test";
|
|
10
|
-
import AxeBuilder from "@axe-core/playwright";
|
|
10
|
+
import { AxeBuilder } from "@axe-core/playwright";
|
|
11
11
|
|
|
12
12
|
// This fixture is useful for simple component library tests that won't want any extra services like a homeserver, so we
|
|
13
13
|
// explicitly avoid pulling anything more than playwright's base fixtures in.
|
package/src/index.ts
CHANGED
|
@@ -66,6 +66,16 @@ export interface TestFixtures {
|
|
|
66
66
|
|
|
67
67
|
labsFlags: string[];
|
|
68
68
|
disablePresence: boolean;
|
|
69
|
+
/**
|
|
70
|
+
* Whether the left panel should have its width fixed.
|
|
71
|
+
* This is done because the library that we use for rendering collapsible
|
|
72
|
+
* panels uses math to calculate the width which can sometimes leads to +/-1px
|
|
73
|
+
* difference. While this does not matter to the user, it can lead to screenshot
|
|
74
|
+
* tests failing.
|
|
75
|
+
* Defaults to true, should be set to false via {@link base.use} when you want to test the collapse
|
|
76
|
+
* behaviour.
|
|
77
|
+
*/
|
|
78
|
+
lockLeftPanelWidth: boolean;
|
|
69
79
|
}
|
|
70
80
|
|
|
71
81
|
export const test = base.extend<TestFixtures>({
|
|
@@ -73,8 +83,18 @@ export const test = base.extend<TestFixtures>({
|
|
|
73
83
|
config: async ({}, use) => use({}),
|
|
74
84
|
labsFlags: async ({}, use) => use([]),
|
|
75
85
|
disablePresence: async ({}, use) => use(false),
|
|
76
|
-
|
|
86
|
+
lockLeftPanelWidth: true,
|
|
87
|
+
page: async ({ homeserver, context, page, config, labsFlags, disablePresence, lockLeftPanelWidth }, use) => {
|
|
77
88
|
await routeConfigJson(context, homeserver.baseUrl, config, labsFlags, disablePresence);
|
|
89
|
+
if (lockLeftPanelWidth) {
|
|
90
|
+
await page.addStyleTag({
|
|
91
|
+
content: `
|
|
92
|
+
#left-panel {
|
|
93
|
+
flex: 0 0 369.6875px !important;
|
|
94
|
+
}
|
|
95
|
+
`,
|
|
96
|
+
});
|
|
97
|
+
}
|
|
78
98
|
await use(page);
|
|
79
99
|
},
|
|
80
100
|
});
|