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

playwright

Package Overview
Dependencies
Maintainers
4
Versions
4714
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

playwright - npm Package Compare versions

Comparing version 1.50.0-alpha-2024-12-17 to 1.50.0-alpha-2024-12-18

38

lib/common/testType.js

@@ -60,3 +60,5 @@ "use strict";

test.setTimeout = (0, _transform.wrapFunctionWithLocation)(this._setTimeout.bind(this));
test.step = this._step.bind(this);
test.step = this._step.bind(this, 'pass');
test.step.fail = this._step.bind(this, 'fail');
test.step.fixme = this._step.bind(this, 'fixme');
test.use = (0, _transform.wrapFunctionWithLocation)(this._use.bind(this));

@@ -227,5 +229,6 @@ test.extend = (0, _transform.wrapFunctionWithLocation)(this._extend.bind(this));

}
async _step(title, body, options = {}) {
async _step(expectation, title, body, options = {}) {
const testInfo = (0, _globals.currentTestInfo)();
if (!testInfo) throw new Error(`test.step() can only be called from a test`);
if (expectation === 'fixme') return undefined;
const step = testInfo._addStep({

@@ -238,8 +241,12 @@ category: 'test.step',

return await _utils.zones.run('stepZone', step, async () => {
var _result;
let result;
let error;
try {
const result = await (0, _utils.raceAgainstDeadline)(async () => body(), options.timeout ? (0, _utils.monotonicTime)() + options.timeout : 0);
if (result.timedOut) throw new _playwrightCore.errors.TimeoutError(`Step timeout ${options.timeout}ms exceeded.`);
step.complete({});
return result.result;
} catch (error) {
result = await (0, _utils.raceAgainstDeadline)(async () => body(), options.timeout ? (0, _utils.monotonicTime)() + options.timeout : 0);
} catch (e) {
error = e;
}
if ((_result = result) !== null && _result !== void 0 && _result.timedOut) {
const error = new _playwrightCore.errors.TimeoutError(`Step timeout ${options.timeout}ms exceeded.`);
step.complete({

@@ -250,2 +257,19 @@ error

}
const expectedToFail = expectation === 'fail';
if (error) {
step.complete({
error
});
if (expectedToFail) return undefined;
throw error;
}
if (expectedToFail) {
error = new Error(`Step is expected to fail, but passed`);
step.complete({
error
});
throw error;
}
step.complete({});
return result.result;
});

@@ -252,0 +276,0 @@ }

4

package.json
{
"name": "playwright",
"version": "1.50.0-alpha-2024-12-17",
"version": "1.50.0-alpha-2024-12-18",
"description": "A high-level API to automate web browsers",

@@ -59,3 +59,3 @@ "repository": {

"dependencies": {
"playwright-core": "1.50.0-alpha-2024-12-17"
"playwright-core": "1.50.0-alpha-2024-12-18"
},

@@ -62,0 +62,0 @@ "optionalDependencies": {

Sorry, the diff of this file is too big to display

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