Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

expect-playwright

Package Overview
Dependencies
Maintainers
2
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

expect-playwright - npm Package Compare versions

Comparing version 0.7.2 to 0.8.0

20

lib/matchers/utils.js

@@ -7,5 +7,10 @@ "use strict";

};
const isLocator = (value) => {
return value.constructor.name === "Locator";
};
const getFrame = async (value) => {
const resolved = await value;
return isElementHandle(resolved) ? resolved.contentFrame() : resolved;
return isElementHandle(resolved)
? resolved.contentFrame()
: resolved;
};

@@ -23,10 +28,13 @@ exports.getFrame = getFrame;

// Finally, we can find the element handle
const handle = await args[0];
let elementHandle = (_a = (await exports.getFrame(handle))) !== null && _a !== void 0 ? _a : handle;
let handle = await args[0];
handle = (_a = (await exports.getFrame(handle))) !== null && _a !== void 0 ? _a : handle;
if (isLocator(handle)) {
handle = (await handle.elementHandle());
}
// If the user provided a page or iframe, we need to locate the provided
// selector or the `body` element if none was provided.
if (!isElementHandle(elementHandle)) {
else if (!isElementHandle(handle)) {
const selector = (_b = args[1]) !== null && _b !== void 0 ? _b : "body";
try {
elementHandle = (await elementHandle.waitForSelector(selector, options));
handle = (await handle.waitForSelector(selector, options));
}

@@ -37,3 +45,3 @@ catch (err) {

}
return [elementHandle, expectedValue];
return [handle, expectedValue];
};

@@ -40,0 +48,0 @@ exports.getElementHandle = getElementHandle;

{
"name": "expect-playwright",
"version": "0.7.2",
"version": "0.8.0",
"main": "lib/index.js",

@@ -18,9 +18,9 @@ "types": "./global.d.ts",

"jest": "^27.0.4",
"jest-playwright-preset": "^1.6.1",
"playwright-chromium": "^1.12.0",
"playwright-core": "^1.12.0",
"prettier": "^2.3.0",
"jest-playwright-preset": "^1.7.0",
"playwright-chromium": "^1.14.0",
"playwright-core": "^1.14.0",
"prettier": "^2.3.2",
"ts-jest": "^27.0.3",
"typescript": "^4.3.2"
"typescript": "^4.3.5"
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc