@applitools/eyes-playwright 1.30.1 → 1.31.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/CHANGELOG.md +41 -0
- package/dist/fixture/cli.js +13 -13
- package/dist/fixture/defaults/eyesConfiguration.js +3 -4
- package/dist/fixture/getEyes.js +7 -1
- package/dist/fixture/images/link.svg +0 -1
- package/dist/fixture/index.js +7 -3
- package/dist/fixture/reportRenderer.js +343 -60
- package/dist/fixture/reporterStyle.css +14 -4
- package/package.json +5 -5
- package/types/index.d.ts +279 -261
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,46 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.31.0](https://github.com/Applitools-Dev/sdk/compare/js/eyes-playwright-v1.30.3...js/eyes-playwright@1.31.0) (2024-11-11)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* add playwright fixture ([#2412](https://github.com/Applitools-Dev/sdk/issues/2412)) ([0632e93](https://github.com/Applitools-Dev/sdk/commit/0632e93dd7f53029a8c5f4230d22a05abf5fefd4))
|
|
9
|
+
* handle retries on the custom html report for playwright ([#2597](https://github.com/Applitools-Dev/sdk/issues/2597)) ([0a93555](https://github.com/Applitools-Dev/sdk/commit/0a935551f5dc939352de700ca904c83f578a1113))
|
|
10
|
+
* html report for playwright ([#2576](https://github.com/Applitools-Dev/sdk/issues/2576)) ([f93f164](https://github.com/Applitools-Dev/sdk/commit/f93f164a289f5676bcc9d650e5e3d90b8e6a6920))
|
|
11
|
+
* offline execution ([#2528](https://github.com/Applitools-Dev/sdk/issues/2528)) ([e6c3b9e](https://github.com/Applitools-Dev/sdk/commit/e6c3b9e3315203027551da3bfdecf90490edd029))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Bug Fixes
|
|
15
|
+
|
|
16
|
+
* ignore browser config with classic ([#2620](https://github.com/Applitools-Dev/sdk/issues/2620)) ([6098078](https://github.com/Applitools-Dev/sdk/commit/6098078baea000bbad0f1b42edbfc5489ab4eaf2))
|
|
17
|
+
* playwright fixture feedback ([#2617](https://github.com/Applitools-Dev/sdk/issues/2617)) ([8440631](https://github.com/Applitools-Dev/sdk/commit/8440631280c9a0e79ea2d973656e4c6fd9fb6bc5))
|
|
18
|
+
* playwright fixture run-example cli ([7243c7a](https://github.com/Applitools-Dev/sdk/commit/7243c7a88673fda2df3536d9efd60d371c1ff835))
|
|
19
|
+
* trigger playwright release ([1d3ea3e](https://github.com/Applitools-Dev/sdk/commit/1d3ea3e4d2059c12d8013f04c18f5facffbc5846))
|
|
20
|
+
* trigger release ([c97dbfc](https://github.com/Applitools-Dev/sdk/commit/c97dbfc89245f374917702a867b87f2794155e54))
|
|
21
|
+
* trigger release ([88c4f81](https://github.com/Applitools-Dev/sdk/commit/88c4f812bd92eae61ee8ebbee5da0d64ad8c8859))
|
|
22
|
+
* tunnel client ([670b184](https://github.com/Applitools-Dev/sdk/commit/670b1843ce43347d97e19fa02f8bc630332ff414))
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### Code Refactoring
|
|
26
|
+
|
|
27
|
+
* start linting "no-floating-promises" (wip) ([#2539](https://github.com/Applitools-Dev/sdk/issues/2539)) ([51b91cb](https://github.com/Applitools-Dev/sdk/commit/51b91cb15603f7d68e4bd6a16eb0f80e3f380295))
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
### Dependencies
|
|
31
|
+
|
|
32
|
+
* @applitools/eyes bumped to 1.26.4
|
|
33
|
+
#### Bug Fixes
|
|
34
|
+
|
|
35
|
+
* organize configuration alphabetically and add getters and setters ([684490d](https://github.com/Applitools-Dev/sdk/commit/684490d8d85d1dd0f07bafdcc38febfcf7c58d08))
|
|
36
|
+
|
|
37
|
+
## [1.30.2](https://github.com/Applitools-Dev/sdk/compare/js/eyes-playwright@1.30.1...js/eyes-playwright@1.30.2) (2024-10-31)
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
### Bug Fixes
|
|
41
|
+
|
|
42
|
+
* playwright fixture run-example cli ([7243c7a](https://github.com/Applitools-Dev/sdk/commit/7243c7a88673fda2df3536d9efd60d371c1ff835))
|
|
43
|
+
|
|
3
44
|
## [1.30.1](https://github.com/Applitools-Dev/sdk/compare/js/eyes-playwright@1.30.0...js/eyes-playwright@1.30.1) (2024-10-31)
|
|
4
45
|
|
|
5
46
|
|
package/dist/fixture/cli.js
CHANGED
|
@@ -165,23 +165,23 @@ async function runExample() {
|
|
|
165
165
|
async function writeTmpPlaywrightConfig() {
|
|
166
166
|
if (!playwrightTmpExists) {
|
|
167
167
|
const playwrighConfig = await fs_1.promises.readFile('./playwright.config.ts', 'utf-8');
|
|
168
|
-
const apikeyMatch = playwrighConfig.match(/apiKey: (
|
|
168
|
+
const apikeyMatch = playwrighConfig.match(/apiKey: ([^,]+)/);
|
|
169
169
|
const apiKey = apikeyMatch ? apikeyMatch[1] : undefined;
|
|
170
|
-
const serverUrlMatch = playwrighConfig.match(/serverUrl: (
|
|
170
|
+
const serverUrlMatch = playwrighConfig.match(/serverUrl: ([^,]+)/);
|
|
171
171
|
const serverUrl = serverUrlMatch ? serverUrlMatch[1] : undefined;
|
|
172
172
|
const playwrightTmpConfig = `import { defineConfig, devices } from '@playwright/test';
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
}
|
|
173
|
+
import { EyesFixture } from '@applitools/eyes-playwright/fixture';
|
|
174
|
+
export default defineConfig<EyesFixture>({
|
|
175
|
+
testDir: '.',
|
|
176
|
+
outputDir: './test-results',
|
|
177
|
+
reporter: [['@applitools/eyes-playwright/reporter', {open: 'always', outputFolder: './eyes-playwright-report'}]],
|
|
178
|
+
use: {
|
|
179
|
+
eyesConfig: {
|
|
180
|
+
apiKey: ${apiKey !== null && apiKey !== void 0 ? apiKey : ''},
|
|
181
|
+
serverUrl: ${serverUrl !== null && serverUrl !== void 0 ? serverUrl : ''}
|
|
183
182
|
}
|
|
184
|
-
}
|
|
183
|
+
}
|
|
184
|
+
})`;
|
|
185
185
|
await fs_1.promises.writeFile(playwrightTmpConfigPath, playwrightTmpConfig);
|
|
186
186
|
}
|
|
187
187
|
}
|
|
@@ -42,18 +42,17 @@ function addBatchDefaults({ configuration }) {
|
|
|
42
42
|
return batch;
|
|
43
43
|
}
|
|
44
44
|
function getFinalEyesConfiguration({ playwrightConfig = {}, projectConfig = {}, eyesConfig = {}, testInfo, }) {
|
|
45
|
-
var _a, _b, _c
|
|
45
|
+
var _a, _b, _c;
|
|
46
46
|
const configuration = {
|
|
47
47
|
...playwrightConfig,
|
|
48
48
|
...projectConfig,
|
|
49
49
|
...eyesConfig,
|
|
50
50
|
};
|
|
51
51
|
(_a = configuration.appName) !== null && _a !== void 0 ? _a : (configuration.appName = 'My App');
|
|
52
|
-
(_b = configuration.
|
|
53
|
-
(_c = configuration.testName) !== null && _c !== void 0 ? _c : (configuration.testName = testInfo.titlePath.join(' > '));
|
|
52
|
+
(_b = configuration.testName) !== null && _b !== void 0 ? _b : (configuration.testName = testInfo.titlePath.slice(1).join(' > '));
|
|
54
53
|
configuration.properties = addConfigurationProperties({ properties: configuration.properties, testInfo });
|
|
55
54
|
configuration.batch = addBatchDefaults({ configuration });
|
|
56
|
-
(
|
|
55
|
+
(_c = configuration.stitchMode) !== null && _c !== void 0 ? _c : (configuration.stitchMode = 'CSS');
|
|
57
56
|
configuration.forceFullPageScreenshot = true;
|
|
58
57
|
const displayName = typeof configuration.displayName === 'function' ? configuration.displayName(testInfo) : configuration.displayName;
|
|
59
58
|
const testName = typeof configuration.testName === 'function' ? configuration.testName(testInfo) : configuration.testName;
|
package/dist/fixture/getEyes.js
CHANGED
|
@@ -19,6 +19,10 @@ async function getEyes({ testInfo, eyesConfig, eyesRunner, page, }) {
|
|
|
19
19
|
eyesConfig,
|
|
20
20
|
testInfo,
|
|
21
21
|
});
|
|
22
|
+
// TODO remove this once bug in eyes/core is fixed. The bug is that when passing browsersInfo with classic runner, a test with viewport size 0x0 is created for each browser configuration. It should just be ignored.
|
|
23
|
+
if (eyesRunner.type === 'classic' && configuration.browsersInfo) {
|
|
24
|
+
delete configuration.browsersInfo;
|
|
25
|
+
}
|
|
22
26
|
const eyes = new index_1.Eyes(eyesRunner, {
|
|
23
27
|
// batches are closed automatically after some time, and closing batch from one process might make another process to open a new batch when it's not neccessary.
|
|
24
28
|
// therefore, we decides to set dontCloseBatches to true. If the user wants to see a notification after the batch is closed, we expect them to use our
|
|
@@ -33,12 +37,14 @@ async function getEyes({ testInfo, eyesConfig, eyesRunner, page, }) {
|
|
|
33
37
|
eyes.closeAsync = makeStep('eyes.closeAsync (without exception)', eyes.closeAsync.bind(eyes));
|
|
34
38
|
await eyes.open(page, configuration.appName, configuration.testName);
|
|
35
39
|
page.__eyes = eyes;
|
|
40
|
+
eyesRunner.isUsed = true;
|
|
36
41
|
return eyes;
|
|
37
42
|
}
|
|
38
43
|
exports.getEyes = getEyes;
|
|
39
44
|
function makeStep(title, f, { box } = { box: true }) {
|
|
40
45
|
return (async (...args) => {
|
|
41
|
-
|
|
46
|
+
const stepTitle = typeof args[0] === 'string' ? `${title} - ${args[0]}` : title;
|
|
47
|
+
return test_1.test.step(stepTitle, async () => {
|
|
42
48
|
return await f(...args);
|
|
43
49
|
}, { box });
|
|
44
50
|
});
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox='0 0 16 16' width='16' height='16'>
|
|
2
|
-
<title>link</title>
|
|
3
2
|
<path fillRule='evenodd' d='M10.604 1h4.146a.25.25 0 01.25.25v4.146a.25.25 0 01-.427.177L13.03 4.03 9.28 7.78a.75.75 0 01-1.06-1.06l3.75-3.75-1.543-1.543A.25.25 0 0110.604 1zM3.75 2A1.75 1.75 0 002 3.75v8.5c0 .966.784 1.75 1.75 1.75h8.5A1.75 1.75 0 0014 12.25v-3.5a.75.75 0 00-1.5 0v3.5a.25.25 0 01-.25.25h-8.5a.25.25 0 01-.25-.25v-8.5a.25.25 0 01.25-.25h3.5a.75.75 0 000-1.5h-3.5z'></path>
|
|
4
3
|
</svg>
|
package/dist/fixture/index.js
CHANGED
|
@@ -40,7 +40,9 @@ exports.test = test_1.test.extend({
|
|
|
40
40
|
const eyesConfig = getEyesConfigForWorker(workerInfo);
|
|
41
41
|
const runner = eyesConfig.type === 'ufg' ? new index_1.VisualGridRunner(eyesConfig) : new index_1.ClassicRunner(eyesConfig);
|
|
42
42
|
await use(runner);
|
|
43
|
-
|
|
43
|
+
if (runner.isUsed) {
|
|
44
|
+
output(`Waiting on eyes results for worker #${workerInfo.parallelIndex}-${workerInfo.workerIndex} - it might take a while`);
|
|
45
|
+
}
|
|
44
46
|
try {
|
|
45
47
|
await Promise.all((_a = runner === null || runner === void 0 ? void 0 : runner.fixturePromises) !== null && _a !== void 0 ? _a : []);
|
|
46
48
|
await runner.getAllTestResults(eyesConfig.failTestsOnDiff === 'afterAll').catch(err => {
|
|
@@ -51,9 +53,11 @@ exports.test = test_1.test.extend({
|
|
|
51
53
|
}
|
|
52
54
|
finally {
|
|
53
55
|
const results = await runner.getAllTestResults(false);
|
|
54
|
-
|
|
56
|
+
if (runner.isUsed) {
|
|
57
|
+
output(outputDigest(workerInfo, results));
|
|
58
|
+
}
|
|
55
59
|
if (eyesConfig.afterAll) {
|
|
56
|
-
eyesConfig.afterAll(results.getAllResults());
|
|
60
|
+
await eyesConfig.afterAll(results.getAllResults());
|
|
57
61
|
}
|
|
58
62
|
}
|
|
59
63
|
},
|