expect-playwright
Advanced tools
Comparing version 0.7.1 to 0.7.2
@@ -5,8 +5,10 @@ "use strict"; | ||
const toHaveSelector = async function (arg, selector, options = {}) { | ||
const frame = await utils_1.getFrame(arg); | ||
const pass = await frame | ||
.waitForSelector(selector, { | ||
state: this.isNot ? "hidden" : "visible", | ||
...options, | ||
}) | ||
const pass = await utils_1.getElementHandle([ | ||
arg, | ||
selector, | ||
{ | ||
state: this.isNot ? "hidden" : "visible", | ||
...options, | ||
}, | ||
], 0) | ||
.then(() => !this.isNot) | ||
@@ -13,0 +15,0 @@ .catch(() => this.isNot); |
@@ -6,6 +6,9 @@ "use strict"; | ||
try { | ||
const frame = (await utils_1.getFrame(arg)); | ||
await frame.waitForSelector(selector, { state: "attached", ...options }); | ||
const [elementHandle] = await utils_1.getElementHandle([arg, selector, options], 1); | ||
await elementHandle.waitForSelector(selector, { | ||
state: "attached", | ||
...options, | ||
}); | ||
/* istanbul ignore next */ | ||
const actualCount = await frame.$$eval(selector, (el) => el.length); | ||
const actualCount = await elementHandle.$$eval(selector, (el) => el.length); | ||
return { | ||
@@ -12,0 +15,0 @@ pass: actualCount === expectedValue, |
{ | ||
"name": "expect-playwright", | ||
"version": "0.7.1", | ||
"version": "0.7.2", | ||
"main": "lib/index.js", | ||
@@ -5,0 +5,0 @@ "types": "./global.d.ts", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
33814
651
0