@stablyai/internal-playwright 0.1.1 → 0.1.3
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/index.js +1 -1
- package/index.mjs +2 -2
- package/lib/index.js +8 -6
- package/lib/matchers/toMatchSnapshot.js +1 -1
- package/package.json +2 -2
package/index.js
CHANGED
package/index.mjs
CHANGED
|
@@ -13,6 +13,6 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
export * from
|
|
17
|
-
import playwright from
|
|
16
|
+
export * from "@stablyai/internal-playwright-core";
|
|
17
|
+
import playwright from "@stablyai/internal-playwright-core";
|
|
18
18
|
export default playwright;
|
package/lib/index.js
CHANGED
|
@@ -134,7 +134,7 @@ const playwrightFixtures = {
|
|
|
134
134
|
actionTimeout: [0, { option: true, box: true }],
|
|
135
135
|
testIdAttribute: ["data-testid", { option: true, box: true }],
|
|
136
136
|
navigationTimeout: [0, { option: true, box: true }],
|
|
137
|
-
|
|
137
|
+
autoHeal: [void 0, { option: true, box: true }],
|
|
138
138
|
baseURL: [async ({}, use) => {
|
|
139
139
|
await use(process.env.PLAYWRIGHT_TEST_BASE_URL);
|
|
140
140
|
}, { option: true, box: true }],
|
|
@@ -215,19 +215,21 @@ const playwrightFixtures = {
|
|
|
215
215
|
...options
|
|
216
216
|
});
|
|
217
217
|
}, { box: true }],
|
|
218
|
-
_setupContextOptions: [async ({ playwright, _combinedContextOptions, actionTimeout, navigationTimeout, testIdAttribute,
|
|
218
|
+
_setupContextOptions: [async ({ playwright, _combinedContextOptions, actionTimeout, navigationTimeout, testIdAttribute, autoHeal }, use, testInfo) => {
|
|
219
219
|
if (testIdAttribute)
|
|
220
220
|
playwrightLibrary.selectors.setTestIdAttribute(testIdAttribute);
|
|
221
221
|
testInfo.snapshotSuffix = process.platform;
|
|
222
222
|
if ((0, import_utils.debugMode)() === "inspector")
|
|
223
223
|
testInfo._setDebugMode();
|
|
224
|
-
if (
|
|
224
|
+
if (autoHeal) {
|
|
225
225
|
try {
|
|
226
226
|
const { setHealingConfig } = require("playwright-core/lib/server/stably/autohealing/healingService");
|
|
227
227
|
setHealingConfig({
|
|
228
|
-
enabled:
|
|
229
|
-
model:
|
|
230
|
-
timeout:
|
|
228
|
+
enabled: autoHeal.enabled,
|
|
229
|
+
model: autoHeal.model,
|
|
230
|
+
timeout: autoHeal.timeout,
|
|
231
|
+
locators: autoHeal.locators,
|
|
232
|
+
screenshots: autoHeal.screenshots
|
|
231
233
|
});
|
|
232
234
|
} catch (error) {
|
|
233
235
|
}
|
|
@@ -303,7 +303,7 @@ async function toHaveScreenshot(pageOrLocator, nameOrOptions = {}, optOptions =
|
|
|
303
303
|
header2 += " Failed to re-generate expected.\n";
|
|
304
304
|
return helper.handleDifferent(actual, expectScreenshotOptions.expected, previous, diff, header2, errorMessage, log, this._stepInfo);
|
|
305
305
|
}
|
|
306
|
-
if (helper.options.autoheal ?? (0, import_healingService.
|
|
306
|
+
if (helper.options.autoheal ?? (0, import_healingService.isScreenshotHealingEnabled)()) {
|
|
307
307
|
if (actual && expected) {
|
|
308
308
|
try {
|
|
309
309
|
const aiScreenshotMatchJudgement = await (0, import_healingService.attemptToHaveScreenshotHealing)({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stablyai/internal-playwright",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "A high-level API to automate web browsers",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
},
|
|
67
67
|
"license": "Apache-2.0",
|
|
68
68
|
"dependencies": {
|
|
69
|
-
"@stablyai/internal-playwright-core": "0.1.
|
|
69
|
+
"@stablyai/internal-playwright-core": "0.1.3"
|
|
70
70
|
},
|
|
71
71
|
"optionalDependencies": {
|
|
72
72
|
"fsevents": "2.3.2"
|