@o3r/testing 11.5.0-prerelease.24 → 11.5.0-prerelease.26
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/esm/package.json
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Prepare css rule to hide specific blocks
|
|
3
|
+
*
|
|
4
|
+
* Should be called only once during the visual test.
|
|
5
|
+
* @note: this function is evaluated in the context of the page and should not use external variables
|
|
6
|
+
* @param ignoreClass
|
|
7
|
+
*/
|
|
8
|
+
export declare function prepareVisualTesting(ignoreClass?: string): void;
|
|
9
|
+
/**
|
|
10
|
+
* Determine if the visual testing is enabled
|
|
11
|
+
*/
|
|
12
|
+
export declare function isVisualTestingEnabled(): boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Toggle the visual testing view : if it is active, will hide tagged components as grey blocks.
|
|
15
|
+
* @note: this function is evaluated in the context of the page and cannot use external code
|
|
16
|
+
* @param enabled
|
|
17
|
+
*/
|
|
18
|
+
export declare function toggleVisualTestingRender(enabled: boolean): void;
|
|
19
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/visual-test/utils.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,WAAW,SAAe,QAkB9D;AAED;;GAEG;AACH,wBAAgB,sBAAsB,YAGrC;AAED;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,OAAO,QAOzD"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Prepare css rule to hide specific blocks
|
|
3
|
+
*
|
|
4
|
+
* Should be called only once during the visual test.
|
|
5
|
+
* @note: this function is evaluated in the context of the page and should not use external variables
|
|
6
|
+
* @param ignoreClass
|
|
7
|
+
*/
|
|
8
|
+
export function prepareVisualTesting(ignoreClass = 'e2e-ignore') {
|
|
9
|
+
const visualTestingCss = document.createElement('style');
|
|
10
|
+
const visualTestingClass = 'visual-testing-render';
|
|
11
|
+
visualTestingCss.textContent = `
|
|
12
|
+
.${visualTestingClass} .${ignoreClass} {position: relative;}
|
|
13
|
+
|
|
14
|
+
.${visualTestingClass} .${ignoreClass}:before {
|
|
15
|
+
z-index: 999;
|
|
16
|
+
content: '';
|
|
17
|
+
width: 100%;
|
|
18
|
+
height: 100%;
|
|
19
|
+
background: grey;
|
|
20
|
+
position: absolute;
|
|
21
|
+
left: 0;
|
|
22
|
+
top: 0;
|
|
23
|
+
}`;
|
|
24
|
+
document.head.appendChild(visualTestingCss);
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Determine if the visual testing is enabled
|
|
28
|
+
*/
|
|
29
|
+
export function isVisualTestingEnabled() {
|
|
30
|
+
const visualTestingClass = 'visual-testing-render';
|
|
31
|
+
return document.body.classList.contains(visualTestingClass);
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Toggle the visual testing view : if it is active, will hide tagged components as grey blocks.
|
|
35
|
+
* @note: this function is evaluated in the context of the page and cannot use external code
|
|
36
|
+
* @param enabled
|
|
37
|
+
*/
|
|
38
|
+
export function toggleVisualTestingRender(enabled) {
|
|
39
|
+
const visualTestingClass = 'visual-testing-render';
|
|
40
|
+
if (enabled) {
|
|
41
|
+
document.body.classList.add(visualTestingClass);
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
document.body.classList.remove(visualTestingClass);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/visual-test/utils.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,UAAU,oBAAoB,CAAC,WAAW,GAAG,YAAY;IAC7D,MAAM,gBAAgB,GAAG,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;IACzD,MAAM,kBAAkB,GAAG,uBAAuB,CAAC;IACnD,gBAAgB,CAAC,WAAW,GAAG;OAC1B,kBAAkB,KAAK,WAAW;;OAElC,kBAAkB,KAAK,WAAW;;;;;;;;;IASrC,CAAC;IAEH,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,gBAAgB,CAAC,CAAC;AAC9C,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,sBAAsB;IACpC,MAAM,kBAAkB,GAAG,uBAAuB,CAAC;IACnD,OAAO,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,kBAAkB,CAAC,CAAC;AAC9D,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,yBAAyB,CAAC,OAAgB;IACxD,MAAM,kBAAkB,GAAG,uBAAuB,CAAC;IACnD,IAAI,OAAO,EAAE,CAAC;QACZ,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC;IAClD,CAAC;SAAM,CAAC;QACN,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC;IACrD,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@o3r/testing",
|
|
3
|
-
"version": "11.5.0-prerelease.
|
|
3
|
+
"version": "11.5.0-prerelease.26",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -21,7 +21,8 @@
|
|
|
21
21
|
"prepare:build:builders": "yarn cpy 'schematics/**/*.json' 'schematics/**/templates/**' dist/schematics && yarn cpy '{collection,migration}.json' dist",
|
|
22
22
|
"prepare:publish": "prepare-publish ./dist",
|
|
23
23
|
"build:schematics": "tsc -b tsconfig.schematics.json --pretty && yarn generate-cjs-manifest",
|
|
24
|
-
"build:tools": "tsc -b tsconfig.tools.json --pretty",
|
|
24
|
+
"build:tools": "tsc -b tsconfig.build.tools.json --pretty",
|
|
25
|
+
"build:utils": "tsc -b tsconfig.build.utils.json --pretty && node ./scripts/generate-esm-manifest.cjs",
|
|
25
26
|
"postbuild": "patch-package-json-main"
|
|
26
27
|
},
|
|
27
28
|
"exports": {
|
|
@@ -90,7 +91,8 @@
|
|
|
90
91
|
},
|
|
91
92
|
"./visual-test/utils": {
|
|
92
93
|
"types": "./visual-test/utils.d.ts",
|
|
93
|
-
"default": "./visual-test/utils.js"
|
|
94
|
+
"default": "./visual-test/utils.js",
|
|
95
|
+
"import": "./esm/visual-test/utils.js"
|
|
94
96
|
}
|
|
95
97
|
},
|
|
96
98
|
"peerDependencies": {
|
|
@@ -106,9 +108,9 @@
|
|
|
106
108
|
"@material/slider": "^14.0.0",
|
|
107
109
|
"@ngrx/store": "~18.0.0",
|
|
108
110
|
"@ngx-translate/core": "~15.0.0",
|
|
109
|
-
"@o3r/core": "^11.5.0-prerelease.
|
|
110
|
-
"@o3r/localization": "^11.5.0-prerelease.
|
|
111
|
-
"@o3r/schematics": "^11.5.0-prerelease.
|
|
111
|
+
"@o3r/core": "^11.5.0-prerelease.26",
|
|
112
|
+
"@o3r/localization": "^11.5.0-prerelease.26",
|
|
113
|
+
"@o3r/schematics": "^11.5.0-prerelease.26",
|
|
112
114
|
"@playwright/test": "~1.48.0",
|
|
113
115
|
"@schematics/angular": "~18.2.0",
|
|
114
116
|
"pixelmatch": "^5.2.1",
|
|
@@ -196,12 +198,12 @@
|
|
|
196
198
|
"@ngx-translate/core": "~15.0.0",
|
|
197
199
|
"@nx/eslint-plugin": "~19.5.0",
|
|
198
200
|
"@nx/jest": "~19.5.0",
|
|
199
|
-
"@o3r/build-helpers": "^11.5.0-prerelease.
|
|
200
|
-
"@o3r/core": "^11.5.0-prerelease.
|
|
201
|
-
"@o3r/eslint-plugin": "^11.5.0-prerelease.
|
|
202
|
-
"@o3r/localization": "^11.5.0-prerelease.
|
|
203
|
-
"@o3r/schematics": "^11.5.0-prerelease.
|
|
204
|
-
"@o3r/test-helpers": "^11.5.0-prerelease.
|
|
201
|
+
"@o3r/build-helpers": "^11.5.0-prerelease.26",
|
|
202
|
+
"@o3r/core": "^11.5.0-prerelease.26",
|
|
203
|
+
"@o3r/eslint-plugin": "^11.5.0-prerelease.26",
|
|
204
|
+
"@o3r/localization": "^11.5.0-prerelease.26",
|
|
205
|
+
"@o3r/schematics": "^11.5.0-prerelease.26",
|
|
206
|
+
"@o3r/test-helpers": "^11.5.0-prerelease.26",
|
|
205
207
|
"@playwright/test": "~1.48.0",
|
|
206
208
|
"@schematics/angular": "~18.2.0",
|
|
207
209
|
"@stylistic/eslint-plugin-ts": "~2.4.0",
|