@applitools/eyes-playwright 1.39.5 → 1.40.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 +82 -0
- package/dist/fixture/index.js +13 -4
- package/dist/fixture/reporter.js +50 -22
- package/dist/fixture/toHaveScreenshot.js +2 -2
- package/package.json +5 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,87 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.40.0](https://github.com/Applitools-Dev/sdk/compare/js/eyes-playwright@1.39.6...js/eyes-playwright@1.40.0) (2025-09-15)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* manual azure upload request ([#3222](https://github.com/Applitools-Dev/sdk/issues/3222)) ([a31e7c8](https://github.com/Applitools-Dev/sdk/commit/a31e7c81bb9596309a6d5035b8f780089d920e53))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Dependencies
|
|
12
|
+
|
|
13
|
+
* @applitools/core bumped to 4.47.0
|
|
14
|
+
#### Features
|
|
15
|
+
|
|
16
|
+
* update default concurrency ([#3230](https://github.com/Applitools-Dev/sdk/issues/3230)) ([f548cda](https://github.com/Applitools-Dev/sdk/commit/f548cda77d74b68890abc7c53f566b145e6484ba))
|
|
17
|
+
* @applitools/eyes bumped to 1.36.6
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
## [1.39.6](https://github.com/Applitools-Dev/sdk/compare/js/eyes-playwright@1.39.5...js/eyes-playwright@1.39.6) (2025-09-09)
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
### Bug Fixes
|
|
24
|
+
|
|
25
|
+
* update properties keys to not have special characters | FLD-3477 ([#3211](https://github.com/Applitools-Dev/sdk/issues/3211)) ([38aa7ab](https://github.com/Applitools-Dev/sdk/commit/38aa7ab3454ea55ef22f3c9a4792a6117f24b0a7))
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
### Dependencies
|
|
29
|
+
|
|
30
|
+
* @applitools/utils bumped to 1.12.0
|
|
31
|
+
#### Features
|
|
32
|
+
|
|
33
|
+
* enable canvas with webgl for autonomous | FLD 3515 ([#3197](https://github.com/Applitools-Dev/sdk/issues/3197)) ([23f22e5](https://github.com/Applitools-Dev/sdk/commit/23f22e517d52dc70f24093dfb21e072b9aa9fb60))
|
|
34
|
+
* @applitools/core bumped to 4.46.0
|
|
35
|
+
#### Features
|
|
36
|
+
|
|
37
|
+
* enable canvas with webgl for autonomous | FLD 3515 ([#3197](https://github.com/Applitools-Dev/sdk/issues/3197)) ([23f22e5](https://github.com/Applitools-Dev/sdk/commit/23f22e517d52dc70f24093dfb21e072b9aa9fb60))
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
#### Bug Fixes
|
|
41
|
+
|
|
42
|
+
* update offline test fixtures to use Google Fonts v12 ([#3215](https://github.com/Applitools-Dev/sdk/issues/3215)) ([ba8ef0c](https://github.com/Applitools-Dev/sdk/commit/ba8ef0c3b11a7f5e9e59a58f29fd5d60760a68ee))
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
* @applitools/logger bumped to 2.2.3
|
|
47
|
+
|
|
48
|
+
* @applitools/dom-snapshot bumped to 4.13.6
|
|
49
|
+
|
|
50
|
+
* @applitools/socket bumped to 1.3.4
|
|
51
|
+
|
|
52
|
+
* @applitools/req bumped to 1.8.3
|
|
53
|
+
|
|
54
|
+
* @applitools/image bumped to 1.2.3
|
|
55
|
+
|
|
56
|
+
* @applitools/dom-capture bumped to 11.6.4
|
|
57
|
+
|
|
58
|
+
* @applitools/driver bumped to 1.23.4
|
|
59
|
+
|
|
60
|
+
* @applitools/spec-driver-webdriver bumped to 1.4.4
|
|
61
|
+
|
|
62
|
+
* @applitools/spec-driver-selenium bumped to 1.7.4
|
|
63
|
+
|
|
64
|
+
* @applitools/spec-driver-playwright bumped to 1.7.4
|
|
65
|
+
|
|
66
|
+
* @applitools/spec-driver-puppeteer bumped to 1.6.4
|
|
67
|
+
|
|
68
|
+
* @applitools/screenshoter bumped to 3.12.4
|
|
69
|
+
|
|
70
|
+
* @applitools/nml-client bumped to 1.11.4
|
|
71
|
+
|
|
72
|
+
* @applitools/tunnel-client bumped to 1.11.1
|
|
73
|
+
|
|
74
|
+
* @applitools/ufg-client bumped to 1.17.3
|
|
75
|
+
|
|
76
|
+
* @applitools/core-base bumped to 1.27.3
|
|
77
|
+
|
|
78
|
+
* @applitools/ec-client bumped to 1.12.6
|
|
79
|
+
|
|
80
|
+
* @applitools/eyes bumped to 1.36.5
|
|
81
|
+
|
|
82
|
+
* @applitools/test-server bumped to 1.3.2
|
|
83
|
+
|
|
84
|
+
|
|
3
85
|
## [1.39.5](https://github.com/Applitools-Dev/sdk/compare/js/eyes-playwright@1.39.4...js/eyes-playwright@1.39.5) (2025-09-04)
|
|
4
86
|
|
|
5
87
|
|
package/dist/fixture/index.js
CHANGED
|
@@ -68,9 +68,15 @@ exports.test = test_1.test.extend({
|
|
|
68
68
|
await use();
|
|
69
69
|
const eyes = page.__eyes;
|
|
70
70
|
if (eyes) {
|
|
71
|
+
const logger = eyes
|
|
72
|
+
.getLogger()
|
|
73
|
+
.getLogger()
|
|
74
|
+
.extend({ tags: [`close-eyes-if-needed-${utils_1.general.shortid()}`] });
|
|
75
|
+
logger.log('Used reporters:', testInfo.config.reporter);
|
|
71
76
|
await eyes.closeAsync();
|
|
72
77
|
if (isUsingEyesReporter) {
|
|
73
|
-
|
|
78
|
+
logger.log('Using Eyes reporter. Writing results..');
|
|
79
|
+
await writeResultsWhenReady({ eyes, runner, testInfo, logger });
|
|
74
80
|
}
|
|
75
81
|
if (eyesConfig.failTestsOnDiff === 'afterEach') {
|
|
76
82
|
await eyes.getResults(true);
|
|
@@ -92,17 +98,20 @@ function outputDigest(workerInfo, results) {
|
|
|
92
98
|
function output(...args) {
|
|
93
99
|
console.log('👀', ...args);
|
|
94
100
|
}
|
|
95
|
-
async function writeResultsWhenReady({ eyes, runner, testInfo }) {
|
|
101
|
+
async function writeResultsWhenReady({ eyes, runner, testInfo, logger, }) {
|
|
96
102
|
var _a, _b;
|
|
97
103
|
const fixturePromises = ((_a = runner.fixturePromises) !== null && _a !== void 0 ? _a : (runner.fixturePromises = []));
|
|
104
|
+
logger = logger.extend({ tags: [`write-results-${utils_1.general.shortid()}`] });
|
|
98
105
|
const uuid = utils_1.general.guid();
|
|
106
|
+
const applitoolsIdentifier = `${uuid}|${(_b = eyes.getServerUrl()) !== null && _b !== void 0 ? _b : 'https://eyes.applitools.com'}|${eyes.getApiKey()}`;
|
|
99
107
|
await testInfo.attach('applitoolsIdentifier', {
|
|
100
|
-
body:
|
|
108
|
+
body: applitoolsIdentifier,
|
|
101
109
|
});
|
|
110
|
+
logger.log('Attached Applitools identifier:', applitoolsIdentifier);
|
|
102
111
|
fixturePromises.push(eyes
|
|
103
112
|
.getResults(false)
|
|
104
113
|
.then(async (testResults) => {
|
|
105
|
-
await reporter_1.InternalData.write({ testInfo, data: testResults, eyes, uuid });
|
|
114
|
+
await reporter_1.InternalData.write({ testInfo, data: testResults, eyes, uuid, logger });
|
|
106
115
|
})
|
|
107
116
|
.catch((e) => {
|
|
108
117
|
var _a;
|
package/dist/fixture/reporter.js
CHANGED
|
@@ -29,7 +29,6 @@ const path = __importStar(require("path"));
|
|
|
29
29
|
const req_1 = require("@applitools/req");
|
|
30
30
|
const utils = __importStar(require("@applitools/utils"));
|
|
31
31
|
const logger_1 = require("@applitools/logger");
|
|
32
|
-
const storage_blob_1 = require("@azure/storage-blob");
|
|
33
32
|
const playwrightPath = require.resolve('playwright');
|
|
34
33
|
const HtmlReporter = require(path.join(path.dirname(playwrightPath), '/lib/reporters/html')).default;
|
|
35
34
|
const pluginsFile = require.resolve('../../dist/fixture/reportRenderer.js');
|
|
@@ -111,13 +110,14 @@ const makeReporterRequest = (settings) => {
|
|
|
111
110
|
var _a;
|
|
112
111
|
const logger = getLogger(settings);
|
|
113
112
|
const req = (0, req_1.makeReq)({
|
|
113
|
+
expect: [200, 201],
|
|
114
114
|
baseUrl: (_a = settings.serverUrl) !== null && _a !== void 0 ? _a : 'https://eyes.applitools.com',
|
|
115
|
+
// API key header is set separately to avoid sending the key to Azure Blob Storage
|
|
115
116
|
headers: {
|
|
116
117
|
Accept: 'application/json',
|
|
117
118
|
'Content-Type': 'application/json',
|
|
118
119
|
'x-applitools-eyes-client': 'eyes-playwright-reporter',
|
|
119
120
|
'User-Agent': 'eyes-playwright-reporter',
|
|
120
|
-
'X-Eyes-Api-Key': settings.apiKey,
|
|
121
121
|
},
|
|
122
122
|
retry: [
|
|
123
123
|
{
|
|
@@ -144,51 +144,79 @@ const makeReporterRequest = (settings) => {
|
|
|
144
144
|
download,
|
|
145
145
|
};
|
|
146
146
|
async function upload(uuid, data) {
|
|
147
|
-
|
|
148
|
-
const
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
147
|
+
logger.log(`Uploading data for UUID: ${uuid}`);
|
|
148
|
+
const azureUrl = new URL(settings.uploadUrl);
|
|
149
|
+
const eyesUrl = new URL(settings.serverUrl);
|
|
150
|
+
try {
|
|
151
|
+
const [eyesResponse, azureResponse] = await Promise.all([
|
|
152
|
+
req(`/batch/${uuid}/report/${uuid}`, {
|
|
153
|
+
baseUrl: eyesUrl.origin,
|
|
154
|
+
method: 'POST',
|
|
155
|
+
headers: {
|
|
156
|
+
'X-Eyes-Api-Key': settings.apiKey,
|
|
157
|
+
},
|
|
158
|
+
}),
|
|
159
|
+
// Azure request headers - https://learn.microsoft.com/en-us/rest/api/storageservices/put-blob?tabs=microsoft-entra-id#request-headers-all-blob-types
|
|
160
|
+
// Required headers not explicitly set are added from query params in the uploadUrl - *important for authentication*
|
|
161
|
+
req(azureUrl, {
|
|
162
|
+
baseUrl: azureUrl.origin,
|
|
163
|
+
method: 'PUT',
|
|
164
|
+
headers: {
|
|
165
|
+
'x-ms-blob-type': 'BlockBlob',
|
|
166
|
+
'Content-Type': 'text/plain',
|
|
167
|
+
},
|
|
168
|
+
body: JSON.stringify(data),
|
|
169
|
+
}),
|
|
170
|
+
]);
|
|
171
|
+
const uploadResponse = {
|
|
172
|
+
respCreateUpload: await eyesResponse.json(),
|
|
173
|
+
respUpload: await azureResponse.text(),
|
|
174
|
+
};
|
|
175
|
+
logger.log('Data written successfully. Upload response:', uploadResponse);
|
|
176
|
+
return uploadResponse;
|
|
177
|
+
}
|
|
178
|
+
catch (error) {
|
|
179
|
+
logger.error(`Failed to upload data: ${error}`);
|
|
180
|
+
throw error;
|
|
181
|
+
}
|
|
158
182
|
}
|
|
159
183
|
async function download(uuid) {
|
|
160
184
|
const response = await req(`/batch/${uuid}/report/${uuid}`, {
|
|
161
185
|
method: 'GET',
|
|
186
|
+
headers: {
|
|
187
|
+
'X-Eyes-Api-Key': settings.apiKey,
|
|
188
|
+
},
|
|
162
189
|
});
|
|
163
190
|
return response.json();
|
|
164
191
|
}
|
|
165
192
|
};
|
|
166
193
|
exports.InternalData = {
|
|
167
|
-
async write({ testInfo, data, eyes, uuid }) {
|
|
168
|
-
var _a
|
|
169
|
-
|
|
194
|
+
async write({ testInfo, data, eyes, uuid, logger, }) {
|
|
195
|
+
var _a;
|
|
196
|
+
logger = logger.extend({ tags: [`internal-data-write-${utils.general.shortid()}`] });
|
|
170
197
|
if (!data || data.length === 0) {
|
|
171
|
-
logger.log(
|
|
198
|
+
logger.log(`No data to write for test: ${testInfo.title}`);
|
|
172
199
|
return;
|
|
173
200
|
}
|
|
174
201
|
const uploadUrl = eyes._eyes.test.account.batchExecReportsUrl
|
|
175
202
|
.replace('__batch_id__', uuid)
|
|
176
203
|
.replace('__report_id__', uuid);
|
|
177
204
|
const { upload } = makeReporterRequest({
|
|
178
|
-
serverUrl: (
|
|
205
|
+
serverUrl: (_a = eyes.getServerUrl()) !== null && _a !== void 0 ? _a : 'https://eyes.applitools.com',
|
|
179
206
|
apiKey: eyes.getApiKey(),
|
|
180
207
|
uploadUrl,
|
|
181
208
|
logger: logger,
|
|
182
209
|
});
|
|
183
|
-
|
|
210
|
+
await upload(uuid, {
|
|
184
211
|
key: `${testInfo.testId}--${testInfo.retry}`,
|
|
185
212
|
data,
|
|
186
213
|
});
|
|
187
|
-
logger.log('Data written successfully:', response);
|
|
188
214
|
},
|
|
189
215
|
async consume(uuid, eyes) {
|
|
190
|
-
var _a;
|
|
191
|
-
const logger = ((_a = eyes.getLogger) === null || _a === void 0 ? void 0 : _a.call(eyes)) || (0, logger_1.makeLogger)()
|
|
216
|
+
var _a, _b, _c;
|
|
217
|
+
const logger = (((_c = (_a = eyes.getLogger) === null || _a === void 0 ? void 0 : (_b = _a.call(eyes)).getLogger) === null || _c === void 0 ? void 0 : _c.call(_b)) || (0, logger_1.makeLogger)()).extend({
|
|
218
|
+
tags: [`internal-data-consume-${utils.general.shortid()}`],
|
|
219
|
+
});
|
|
192
220
|
const { download } = makeReporterRequest({
|
|
193
221
|
serverUrl: eyes.getServerUrl(),
|
|
194
222
|
apiKey: eyes.getApiKey(),
|
|
@@ -99,11 +99,11 @@ exports.expect = test_1.expect.extend({
|
|
|
99
99
|
configuration.properties = [
|
|
100
100
|
...((_c = configuration.properties) !== null && _c !== void 0 ? _c : []),
|
|
101
101
|
{
|
|
102
|
-
name: 'playwright
|
|
102
|
+
name: 'playwright expect toHaveScreenshot options',
|
|
103
103
|
value: JSON.stringify(options),
|
|
104
104
|
},
|
|
105
105
|
{
|
|
106
|
-
name: 'playwright
|
|
106
|
+
name: 'playwright expect syntax used',
|
|
107
107
|
value: 'toHaveScreenshot',
|
|
108
108
|
},
|
|
109
109
|
];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@applitools/eyes-playwright",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.40.0",
|
|
4
4
|
"description": "Applitools Eyes SDK for Playwright",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eyes-playwright",
|
|
@@ -59,11 +59,10 @@
|
|
|
59
59
|
"up:framework": "echo \"$(jq '.devDependencies.playwright = $ENV.APPLITOOLS_FRAMEWORK_VERSION' ./package.json)\" > ./package.json"
|
|
60
60
|
},
|
|
61
61
|
"dependencies": {
|
|
62
|
-
"@applitools/eyes": "1.36.
|
|
63
|
-
"@applitools/req": "1.8.
|
|
64
|
-
"@applitools/spec-driver-playwright": "1.7.
|
|
65
|
-
"@applitools/utils": "1.
|
|
66
|
-
"@azure/storage-blob": "^12.28.0",
|
|
62
|
+
"@applitools/eyes": "1.36.6",
|
|
63
|
+
"@applitools/req": "1.8.3",
|
|
64
|
+
"@applitools/spec-driver-playwright": "1.7.4",
|
|
65
|
+
"@applitools/utils": "1.12.0",
|
|
67
66
|
"@inquirer/prompts": "7.0.1",
|
|
68
67
|
"chalk": "4.1.2",
|
|
69
68
|
"yargs": "17.7.2"
|