@applitools/eyes-playwright 1.38.0 → 1.38.2

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,145 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.38.2](https://github.com/Applitools-Dev/sdk/compare/js/eyes-playwright@1.38.1...js/eyes-playwright@1.38.2) (2025-07-23)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * blob reporter results saving ([#3108](https://github.com/Applitools-Dev/sdk/issues/3108)) ([d542241](https://github.com/Applitools-Dev/sdk/commit/d542241a971f03c4a42f55a54ae159ef807186e0))
9
+
10
+
11
+ ### Dependencies
12
+
13
+ * @applitools/nml-client bumped to 1.10.0
14
+ #### Features
15
+
16
+ * android multi target | AD-9868 ([#2943](https://github.com/Applitools-Dev/sdk/issues/2943)) ([808aa21](https://github.com/Applitools-Dev/sdk/commit/808aa21e489c3562b93006e2e26ff7ffbb743dd6))
17
+
18
+
19
+
20
+ * @applitools/core-base bumped to 1.26.0
21
+ #### Features
22
+
23
+ * batch properties limit | FLD-3174 ([#3080](https://github.com/Applitools-Dev/sdk/issues/3080)) ([feb9e79](https://github.com/Applitools-Dev/sdk/commit/feb9e79d79f5eab3c58eac2b4ef3c15a562f079c))
24
+ * @applitools/core bumped to 4.43.0
25
+ #### Features
26
+
27
+ * android multi target | AD-9868 ([#2943](https://github.com/Applitools-Dev/sdk/issues/2943)) ([808aa21](https://github.com/Applitools-Dev/sdk/commit/808aa21e489c3562b93006e2e26ff7ffbb743dd6))
28
+ * batch properties limit | FLD-3174 ([#3080](https://github.com/Applitools-Dev/sdk/issues/3080)) ([feb9e79](https://github.com/Applitools-Dev/sdk/commit/feb9e79d79f5eab3c58eac2b4ef3c15a562f079c))
29
+
30
+
31
+
32
+ * @applitools/ec-client bumped to 1.11.1
33
+
34
+ * @applitools/eyes bumped to 1.35.3
35
+
36
+
37
+ ## [1.38.1](https://github.com/Applitools-Dev/sdk/compare/js/eyes-playwright@1.38.0...js/eyes-playwright@1.38.1) (2025-07-15)
38
+
39
+
40
+ ### Bug Fixes
41
+
42
+ * example visual check for search box in system theme | AD-10586 ([#3089](https://github.com/Applitools-Dev/sdk/issues/3089)) ([0a50c8d](https://github.com/Applitools-Dev/sdk/commit/0a50c8d689f8acf236c01df105b96904141f5ad7))
43
+ * eyes playwright types ([c63ae80](https://github.com/Applitools-Dev/sdk/commit/c63ae80292ef363b022eb933d1bb6fbf2dd57e3d))
44
+
45
+
46
+ ### Performance Improvements
47
+
48
+ * yarn dedup packages ([#3061](https://github.com/Applitools-Dev/sdk/issues/3061)) ([2fd8951](https://github.com/Applitools-Dev/sdk/commit/2fd8951d6ce9c18a5dbdb648adaa2c454eae9b4e))
49
+
50
+
51
+ ### Dependencies
52
+
53
+ * @applitools/dom-snapshot bumped to 4.12.1
54
+ #### Performance Improvements
55
+
56
+ * yarn dedup packages ([#3061](https://github.com/Applitools-Dev/sdk/issues/3061)) ([2fd8951](https://github.com/Applitools-Dev/sdk/commit/2fd8951d6ce9c18a5dbdb648adaa2c454eae9b4e))
57
+
58
+
59
+
60
+ * @applitools/req bumped to 1.7.15
61
+ #### Performance Improvements
62
+
63
+ * yarn dedup packages ([#3061](https://github.com/Applitools-Dev/sdk/issues/3061)) ([2fd8951](https://github.com/Applitools-Dev/sdk/commit/2fd8951d6ce9c18a5dbdb648adaa2c454eae9b4e))
64
+ * @applitools/driver bumped to 1.22.1
65
+ #### Performance Improvements
66
+
67
+ * yarn dedup packages ([#3061](https://github.com/Applitools-Dev/sdk/issues/3061)) ([2fd8951](https://github.com/Applitools-Dev/sdk/commit/2fd8951d6ce9c18a5dbdb648adaa2c454eae9b4e))
68
+ * @applitools/spec-driver-selenium bumped to 1.6.1
69
+
70
+ * @applitools/spec-driver-playwright bumped to 1.6.1
71
+
72
+ * @applitools/screenshoter bumped to 3.11.7
73
+ #### Performance Improvements
74
+
75
+ * yarn dedup packages ([#3061](https://github.com/Applitools-Dev/sdk/issues/3061)) ([2fd8951](https://github.com/Applitools-Dev/sdk/commit/2fd8951d6ce9c18a5dbdb648adaa2c454eae9b4e))
76
+
77
+
78
+
79
+ * @applitools/nml-client bumped to 1.9.7
80
+ #### Performance Improvements
81
+
82
+ * yarn dedup packages ([#3061](https://github.com/Applitools-Dev/sdk/issues/3061)) ([2fd8951](https://github.com/Applitools-Dev/sdk/commit/2fd8951d6ce9c18a5dbdb648adaa2c454eae9b4e))
83
+
84
+
85
+
86
+ * @applitools/tunnel-client bumped to 1.9.0
87
+ #### Features
88
+
89
+ * enable EC healthchecks | AD-10040 ([#3017](https://github.com/Applitools-Dev/sdk/issues/3017)) ([c01c300](https://github.com/Applitools-Dev/sdk/commit/c01c300259427ddae53147a64d30b152960503d9))
90
+
91
+
92
+
93
+ * @applitools/ufg-client bumped to 1.16.14
94
+ #### Performance Improvements
95
+
96
+ * yarn dedup packages ([#3061](https://github.com/Applitools-Dev/sdk/issues/3061)) ([2fd8951](https://github.com/Applitools-Dev/sdk/commit/2fd8951d6ce9c18a5dbdb648adaa2c454eae9b4e))
97
+
98
+
99
+
100
+ * @applitools/core-base bumped to 1.25.6
101
+ #### Performance Improvements
102
+
103
+ * yarn dedup packages ([#3061](https://github.com/Applitools-Dev/sdk/issues/3061)) ([2fd8951](https://github.com/Applitools-Dev/sdk/commit/2fd8951d6ce9c18a5dbdb648adaa2c454eae9b4e))
104
+
105
+
106
+
107
+ * @applitools/ec-client bumped to 1.11.0
108
+ #### Features
109
+
110
+ * enable EC healthchecks | AD-10040 ([#3017](https://github.com/Applitools-Dev/sdk/issues/3017)) ([c01c300](https://github.com/Applitools-Dev/sdk/commit/c01c300259427ddae53147a64d30b152960503d9))
111
+
112
+
113
+ #### Performance Improvements
114
+
115
+ * yarn dedup packages ([#3061](https://github.com/Applitools-Dev/sdk/issues/3061)) ([2fd8951](https://github.com/Applitools-Dev/sdk/commit/2fd8951d6ce9c18a5dbdb648adaa2c454eae9b4e))
116
+
117
+
118
+
119
+ * @applitools/core bumped to 4.42.0
120
+ #### Features
121
+
122
+ * enable EC healthchecks | AD-10040 ([#3017](https://github.com/Applitools-Dev/sdk/issues/3017)) ([c01c300](https://github.com/Applitools-Dev/sdk/commit/c01c300259427ddae53147a64d30b152960503d9))
123
+
124
+
125
+ #### Performance Improvements
126
+
127
+ * yarn dedup packages ([#3061](https://github.com/Applitools-Dev/sdk/issues/3061)) ([2fd8951](https://github.com/Applitools-Dev/sdk/commit/2fd8951d6ce9c18a5dbdb648adaa2c454eae9b4e))
128
+
129
+
130
+
131
+ * @applitools/spec-driver-webdriver bumped to 1.3.1
132
+
133
+ * @applitools/spec-driver-puppeteer bumped to 1.5.1
134
+
135
+ * @applitools/eyes bumped to 1.35.2
136
+ #### Performance Improvements
137
+
138
+ * yarn dedup packages ([#3061](https://github.com/Applitools-Dev/sdk/issues/3061)) ([2fd8951](https://github.com/Applitools-Dev/sdk/commit/2fd8951d6ce9c18a5dbdb648adaa2c454eae9b4e))
139
+
140
+
141
+
142
+
3
143
  ## [1.38.0](https://github.com/Applitools-Dev/sdk/compare/js/eyes-playwright@1.37.3...js/eyes-playwright@1.38.0) (2025-07-09)
4
144
 
5
145
 
@@ -9,9 +9,13 @@ test('Playwright website', async ({ page, eyes }) => {
9
9
  const searchBox = page.getByLabel('Search')
10
10
 
11
11
  /* Region visual check - "Search" component in light theme */
12
+ await eyes.check('Search box in system theme', { region: searchBox })
13
+
14
+ await page.getByLabel('Switch between dark and light').click(); // Switch to light theme
15
+
12
16
  await eyes.check('Search box in light theme', {region: searchBox})
13
17
 
14
- await page.getByLabel('Switch between dark and light').click();
18
+ await page.getByLabel('Switch between dark and light').click(); // Switch to dark theme
15
19
 
16
20
  /* Region visual check - "Search" component in dark theme */
17
21
  await eyes.check('Search box in dark theme', {region: searchBox})
@@ -26,6 +26,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
26
26
  exports.InternalData = void 0;
27
27
  const fs = __importStar(require("fs"));
28
28
  const path = __importStar(require("path"));
29
+ const os = __importStar(require("os"));
29
30
  const playwrightPath = require.resolve('playwright');
30
31
  const HtmlReporter = require(path.join(path.dirname(playwrightPath), '/lib/reporters/html')).default;
31
32
  const pluginsFile = require.resolve('../../dist/fixture/reportRenderer.js');
@@ -45,8 +46,13 @@ const createInjectedScript = (testResultsMap) => `
45
46
  class EyesReporter extends HtmlReporter {
46
47
  constructor(options) {
47
48
  super(options);
49
+ this.stdoutData = '';
48
50
  this.applitoolsIdentifiersAndFolders = [];
49
51
  }
52
+ onStdOut(chunk) {
53
+ // Capture stdout data for blob reporter scenarios
54
+ this.stdoutData += chunk.toString();
55
+ }
50
56
  onTestEnd(test, result) {
51
57
  var _a;
52
58
  (_a = super.onTestEnd) === null || _a === void 0 ? void 0 : _a.call(this, test, result);
@@ -74,7 +80,7 @@ class EyesReporter extends HtmlReporter {
74
80
  await super.onEnd(result);
75
81
  const testResultsMap = {};
76
82
  for (const applitoolsIdentifierAndFolder of this.applitoolsIdentifiersAndFolders) {
77
- const content = await exports.InternalData.consume(applitoolsIdentifierAndFolder);
83
+ const content = await exports.InternalData.consume(applitoolsIdentifierAndFolder, this.stdoutData);
78
84
  if (content) {
79
85
  testResultsMap[content.key] = content.data;
80
86
  }
@@ -90,7 +96,17 @@ class EyesReporter extends HtmlReporter {
90
96
  }
91
97
  }
92
98
  exports.default = EyesReporter;
99
+ const defaultDataDirectory = path.join(os.tmpdir(), 'eyes-playwright-data');
93
100
  exports.InternalData = {
101
+ determineDirectory(testInfo) {
102
+ var _a;
103
+ const blobReporter = testInfo.config.reporter.find(r => r[0].includes('blob'));
104
+ const customOutputDir = (_a = blobReporter === null || blobReporter === void 0 ? void 0 : blobReporter[1]) === null || _a === void 0 ? void 0 : _a.outputDir;
105
+ return customOutputDir ? path.join(customOutputDir, 'eyes-report-files') : defaultDataDirectory;
106
+ },
107
+ hasBlobReporter(testInfo) {
108
+ return testInfo.config.reporter.some(r => r[0].includes('blob'));
109
+ },
94
110
  async write({ testInfo, data }) {
95
111
  const [applitoolsIdentifier, folder] = testInfo.attachments
96
112
  .find(a => a.name === 'applitoolsIdentifier')
@@ -99,29 +115,66 @@ exports.InternalData = {
99
115
  .map(s => s.trim())
100
116
  .filter(Boolean); // if the directory is not specified, it will be empty
101
117
  const key = `${testInfo.testId}--${testInfo.retry}`;
102
- this.ensureFolder(folder);
103
- await fs.promises.writeFile(this.getPathForInternalId(applitoolsIdentifier, folder), JSON.stringify({ key, data }));
118
+ if (this.hasBlobReporter(testInfo)) {
119
+ // Use stdout approach for blob reporter scenarios
120
+ // eslint-disable-next-line no-console
121
+ console.log(`EYES_DATA:${applitoolsIdentifier}:${JSON.stringify({ key, data })}`);
122
+ }
123
+ else {
124
+ // Use file approach for direct reporter scenarios
125
+ const targetFolder = folder || this.determineDirectory(testInfo);
126
+ this.ensureFolder(targetFolder);
127
+ await fs.promises.writeFile(this.getPathForInternalId(applitoolsIdentifier, targetFolder), JSON.stringify({ key, data }));
128
+ }
104
129
  },
105
- async consume(applitoolsIdentifierAndFolder) {
130
+ async consume(applitoolsIdentifierAndFolder, stdoutData) {
106
131
  const [name, folder] = applitoolsIdentifierAndFolder
107
132
  .split('|')
108
133
  .map(s => s.trim())
109
134
  .filter(Boolean); // if the directory is not specified, it will be empty
110
- const filepath = this.getPathForInternalId(name, folder);
111
- try {
112
- const content = await fs.promises.readFile(filepath, 'utf-8').then(JSON.parse);
113
- return content;
135
+ // Try stdout data first (for blob reporter scenarios), then fall back to files
136
+ if (stdoutData) {
137
+ // Parse from stdout for blob reporter scenarios
138
+ const results = this.parseStdoutLine(name, stdoutData);
139
+ // Return the last result if multiple exist, or undefined if none
140
+ return results.length > 0 ? results[results.length - 1] : undefined;
141
+ }
142
+ else {
143
+ // Read from file for direct reporter scenarios
144
+ const targetFolder = folder || defaultDataDirectory;
145
+ const filepath = this.getPathForInternalId(name, targetFolder);
146
+ try {
147
+ const content = await fs.promises.readFile(filepath, 'utf-8').then(JSON.parse);
148
+ return content;
149
+ }
150
+ catch (err) {
151
+ // TODO no eyes results for test - this is ok, could be that no visual tests occurred for this playwright test
152
+ }
114
153
  }
115
- catch (err) {
116
- // TODO no eyes results for test - this is ok, could be that no visual tests occurred for this playwright test
154
+ },
155
+ parseStdoutLine(identifier, stdoutData) {
156
+ const lines = stdoutData.split('\n');
157
+ const eyesLines = lines.filter(line => line.startsWith(`EYES_DATA:${identifier}:`));
158
+ const results = [];
159
+ for (const eyesLine of eyesLines) {
160
+ const jsonPart = eyesLine.replace(`EYES_DATA:${identifier}:`, '');
161
+ try {
162
+ const parsed = JSON.parse(jsonPart);
163
+ results.push(parsed);
164
+ }
165
+ catch (err) {
166
+ // Skip invalid JSON lines
167
+ continue;
168
+ }
117
169
  }
170
+ return results;
118
171
  },
119
- ensureFolder(folderPath = path.join('blob-report', 'eyes-report-files')) {
172
+ ensureFolder(folderPath = defaultDataDirectory) {
120
173
  if (!fs.existsSync(folderPath)) {
121
174
  fs.mkdirSync(folderPath, { recursive: true });
122
175
  }
123
176
  },
124
- getPathForInternalId(applitoolsIdentifier, folderPath = path.join('blob-report', 'eyes-report-files')) {
177
+ getPathForInternalId(applitoolsIdentifier, folderPath = defaultDataDirectory) {
125
178
  return path.join(folderPath, applitoolsIdentifier);
126
179
  },
127
180
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applitools/eyes-playwright",
3
- "version": "1.38.0",
3
+ "version": "1.38.2",
4
4
  "description": "Applitools Eyes SDK for Playwright",
5
5
  "keywords": [
6
6
  "eyes-playwright",
@@ -59,8 +59,8 @@
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.35.1",
63
- "@applitools/spec-driver-playwright": "1.6.0",
62
+ "@applitools/eyes": "1.35.3",
63
+ "@applitools/spec-driver-playwright": "1.6.1",
64
64
  "@applitools/utils": "1.9.0",
65
65
  "@inquirer/prompts": "7.0.1",
66
66
  "chalk": "4.1.2",
@@ -35,7 +35,7 @@ export type EyesConfig = Omit<
35
35
  afterAll?: (results: Array<TestResultContainer>) => Promise<void>
36
36
  }
37
37
 
38
- type Eyes = Pick<BaseEyes, 'locate' | 'extractText' | 'extractTextRegions'> & {
38
+ export type Eyes = Pick<BaseEyes, 'locate' | 'extractText' | 'extractTextRegions'> & {
39
39
  check(name?: string, checkSettings?: CheckSettingsAutomationPlain): Promise<MatchResult>
40
40
  }
41
41