@playwright/test 1.34.0-alpha-may-3-2023 → 1.34.0-alpha-may-4-2023
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/lib/common/transform.js +6 -5
- package/lib/index.js +2 -1
- package/lib/reporters/merge.js +0 -2
- package/lib/worker/testInfo.js +26 -9
- package/package.json +2 -2
package/lib/common/transform.js
CHANGED
|
@@ -37,16 +37,17 @@ function validateTsConfig(tsconfig) {
|
|
|
37
37
|
if (!tsconfig.tsConfigPath || !tsconfig.baseUrl) return;
|
|
38
38
|
// Make 'baseUrl' absolute, because it is relative to the tsconfig.json, not to cwd.
|
|
39
39
|
const absoluteBaseUrl = _path.default.resolve(_path.default.dirname(tsconfig.tsConfigPath), tsconfig.baseUrl);
|
|
40
|
-
const
|
|
41
|
-
|
|
42
|
-
|
|
40
|
+
const pathsFallback = [{
|
|
41
|
+
key: '*',
|
|
42
|
+
values: ['*']
|
|
43
|
+
}];
|
|
43
44
|
return {
|
|
44
45
|
allowJs: tsconfig.allowJs,
|
|
45
46
|
absoluteBaseUrl,
|
|
46
|
-
paths: Object.entries(paths).map(([key, values]) => ({
|
|
47
|
+
paths: Object.entries(tsconfig.paths || {}).map(([key, values]) => ({
|
|
47
48
|
key,
|
|
48
49
|
values
|
|
49
|
-
}))
|
|
50
|
+
})).concat(pathsFallback)
|
|
50
51
|
};
|
|
51
52
|
}
|
|
52
53
|
function loadAndValidateTsconfigForFile(file) {
|
package/lib/index.js
CHANGED
|
@@ -440,7 +440,8 @@ const playwrightFixtures = {
|
|
|
440
440
|
location: stackTrace === null || stackTrace === void 0 ? void 0 : stackTrace.frames[0],
|
|
441
441
|
category: 'pw:api',
|
|
442
442
|
title: apiCall,
|
|
443
|
-
wallTime
|
|
443
|
+
wallTime,
|
|
444
|
+
laxParent: true
|
|
444
445
|
});
|
|
445
446
|
userData.userObject = step;
|
|
446
447
|
},
|
package/lib/reporters/merge.js
CHANGED
|
@@ -84,8 +84,6 @@ function mergeEvents(shardReports) {
|
|
|
84
84
|
for (const reportJsonl of shardReports) {
|
|
85
85
|
const parsedEvents = parseEvents(reportJsonl);
|
|
86
86
|
for (const event of parsedEvents) {
|
|
87
|
-
// TODO: show remaining events?
|
|
88
|
-
if (event.method === 'onError') throw new Error('Error in shard');
|
|
89
87
|
if (event.method === 'onBegin') beginEvents.push(event);else if (event.method === 'onEnd') endEvents.push(event);else events.push(event);
|
|
90
88
|
}
|
|
91
89
|
}
|
package/lib/worker/testInfo.js
CHANGED
|
@@ -56,6 +56,7 @@ class TestInfoImpl {
|
|
|
56
56
|
this._lastStepId = 0;
|
|
57
57
|
this._projectInternal = void 0;
|
|
58
58
|
this._configInternal = void 0;
|
|
59
|
+
this._steps = [];
|
|
59
60
|
this.testId = void 0;
|
|
60
61
|
this.repeatEachIndex = void 0;
|
|
61
62
|
this.retry = void 0;
|
|
@@ -163,15 +164,28 @@ class TestInfoImpl {
|
|
|
163
164
|
}
|
|
164
165
|
_addStep(data) {
|
|
165
166
|
const stepId = `${data.category}@${data.title}@${++this._lastStepId}`;
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
167
|
+
let parentStep = _utils.zones.zoneData('stepZone', (0, _utils.captureRawStack)());
|
|
168
|
+
|
|
169
|
+
// For out-of-stack calls, locate the enclosing step.
|
|
170
|
+
let isLaxParent = false;
|
|
171
|
+
if (!parentStep && data.laxParent) {
|
|
172
|
+
const visit = step => {
|
|
173
|
+
// Never nest into under another lax element, it could be a series
|
|
174
|
+
// of no-reply actions, ala page.continue().
|
|
175
|
+
if (!step.endWallTime && step.category === data.category && !step.laxParent) parentStep = step;
|
|
176
|
+
step.steps.forEach(visit);
|
|
177
|
+
};
|
|
178
|
+
this._steps.forEach(visit);
|
|
179
|
+
isLaxParent = !!parentStep;
|
|
180
|
+
}
|
|
169
181
|
const step = {
|
|
170
182
|
stepId,
|
|
171
183
|
...data,
|
|
184
|
+
laxParent: isLaxParent,
|
|
185
|
+
steps: [],
|
|
172
186
|
complete: result => {
|
|
173
|
-
if (
|
|
174
|
-
|
|
187
|
+
if (step.endWallTime) return;
|
|
188
|
+
step.endWallTime = Date.now();
|
|
175
189
|
let error;
|
|
176
190
|
if (result.error instanceof Error) {
|
|
177
191
|
// Step function threw an error.
|
|
@@ -180,19 +194,22 @@ class TestInfoImpl {
|
|
|
180
194
|
// Internal API step reported an error.
|
|
181
195
|
error = result.error;
|
|
182
196
|
} else {
|
|
183
|
-
//
|
|
184
|
-
// Report step as failed to make it easier to spot.
|
|
185
|
-
error =
|
|
197
|
+
// One of the child steps failed (probably soft expect).
|
|
198
|
+
// Report this step as failed to make it easier to spot.
|
|
199
|
+
error = step.steps.map(s => s.error).find(e => !!e);
|
|
186
200
|
}
|
|
201
|
+
step.error = error;
|
|
187
202
|
const payload = {
|
|
188
203
|
testId: this._test.id,
|
|
189
204
|
stepId,
|
|
190
|
-
wallTime:
|
|
205
|
+
wallTime: step.endWallTime,
|
|
191
206
|
error
|
|
192
207
|
};
|
|
193
208
|
this._onStepEnd(payload);
|
|
194
209
|
}
|
|
195
210
|
};
|
|
211
|
+
const parentStepList = parentStep ? parentStep.steps : this._steps;
|
|
212
|
+
parentStepList.push(step);
|
|
196
213
|
const hasLocation = data.location && !data.location.file.includes('@playwright');
|
|
197
214
|
// Sanitize location that comes from user land, it might have extra properties.
|
|
198
215
|
const location = data.location && hasLocation ? {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@playwright/test",
|
|
3
|
-
"version": "1.34.0-alpha-may-
|
|
3
|
+
"version": "1.34.0-alpha-may-4-2023",
|
|
4
4
|
"description": "A high-level API to automate web browsers",
|
|
5
5
|
"repository": "github:Microsoft/playwright",
|
|
6
6
|
"homepage": "https://playwright.dev",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"license": "Apache-2.0",
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@types/node": "*",
|
|
39
|
-
"playwright-core": "1.34.0-alpha-may-
|
|
39
|
+
"playwright-core": "1.34.0-alpha-may-4-2023"
|
|
40
40
|
},
|
|
41
41
|
"optionalDependencies": {
|
|
42
42
|
"fsevents": "2.3.2"
|