@applitools/eyes-playwright 1.39.6 → 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 CHANGED
@@ -1,5 +1,22 @@
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
+
3
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)
4
21
 
5
22
 
@@ -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,30 +144,48 @@ const makeReporterRequest = (settings) => {
144
144
  download,
145
145
  };
146
146
  async function upload(uuid, data) {
147
- logger.log('Uploading data for UUID:', uuid);
148
- const blobClient = new storage_blob_1.BlockBlobClient(settings.uploadUrl);
147
+ logger.log(`Uploading data for UUID: ${uuid}`);
148
+ const azureUrl = new URL(settings.uploadUrl);
149
+ const eyesUrl = new URL(settings.serverUrl);
149
150
  try {
150
- const [response1, response2] = await Promise.all([
151
+ const [eyesResponse, azureResponse] = await Promise.all([
151
152
  req(`/batch/${uuid}/report/${uuid}`, {
153
+ baseUrl: eyesUrl.origin,
152
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),
153
169
  }),
154
- blobClient.upload(JSON.stringify(data), JSON.stringify(data).length),
155
170
  ]);
156
171
  const uploadResponse = {
157
- respCreateUpload: await response1.json(),
158
- respUpload: JSON.stringify(response2),
172
+ respCreateUpload: await eyesResponse.json(),
173
+ respUpload: await azureResponse.text(),
159
174
  };
160
175
  logger.log('Data written successfully. Upload response:', uploadResponse);
161
176
  return uploadResponse;
162
177
  }
163
178
  catch (error) {
164
- logger.error('Failed to upload data:', error);
179
+ logger.error(`Failed to upload data: ${error}`);
165
180
  throw error;
166
181
  }
167
182
  }
168
183
  async function download(uuid) {
169
184
  const response = await req(`/batch/${uuid}/report/${uuid}`, {
170
185
  method: 'GET',
186
+ headers: {
187
+ 'X-Eyes-Api-Key': settings.apiKey,
188
+ },
171
189
  });
172
190
  return response.json();
173
191
  }
@@ -177,7 +195,7 @@ exports.InternalData = {
177
195
  var _a;
178
196
  logger = logger.extend({ tags: [`internal-data-write-${utils.general.shortid()}`] });
179
197
  if (!data || data.length === 0) {
180
- logger.log('No data to write for test:', testInfo.title);
198
+ logger.log(`No data to write for test: ${testInfo.title}`);
181
199
  return;
182
200
  }
183
201
  const uploadUrl = eyes._eyes.test.account.batchExecReportsUrl
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applitools/eyes-playwright",
3
- "version": "1.39.6",
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.5",
62
+ "@applitools/eyes": "1.36.6",
63
63
  "@applitools/req": "1.8.3",
64
64
  "@applitools/spec-driver-playwright": "1.7.4",
65
65
  "@applitools/utils": "1.12.0",
66
- "@azure/storage-blob": "^12.28.0",
67
66
  "@inquirer/prompts": "7.0.1",
68
67
  "chalk": "4.1.2",
69
68
  "yargs": "17.7.2"