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

@playwright/test

Package Overview
Dependencies
Maintainers
6
Versions
2371
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@playwright/test - npm Package Compare versions

Comparing version 0.9.17 to 0.9.18

22

out/index.d.ts

@@ -24,3 +24,3 @@ /**

slowMo: number;
trace: boolean;
video: boolean;
};

@@ -30,3 +30,3 @@ declare type PlaywrightWorkerFixtures = {

browserType: BrowserType<Browser>;
defaultBrowserOptions: LaunchOptions;
browserOptions: LaunchOptions;
browser: Browser;

@@ -41,3 +41,3 @@ isChromium: boolean;

declare type PlaywrightTestFixtures = {
defaultContextOptions: BrowserContextOptions;
contextOptions: BrowserContextOptions;
contextFactory: (options?: BrowserContextOptions) => Promise<BrowserContext>;

@@ -47,8 +47,8 @@ context: BrowserContext;

};
export declare const folio: import("folio").Fixtures<{
testWorkerIndex: number;
} & PlaywrightWorkerFixtures, {
export declare const folio: import("folio").Folio<{
testInfo: import("folio").TestInfo;
testParametersPathSegment: string;
} & PlaywrightTestFixtures, PlaywrightParameters>;
} & PlaywrightTestFixtures, {
testWorkerIndex: number;
} & PlaywrightWorkerFixtures, PlaywrightParameters>;
export declare const it: {

@@ -181,10 +181,2 @@ (name: string, inner: (fixtures: PlaywrightParameters & {

};
export declare const fdescribe: {
(name: string, inner: () => void): void;
(name: string, modifierFn: (modifier: import("folio/out/testModifier").TestModifier, parameters: PlaywrightParameters) => any, inner: () => void): void;
};
export declare const xdescribe: {
(name: string, inner: () => void): void;
(name: string, modifierFn: (modifier: import("folio/out/testModifier").TestModifier, parameters: PlaywrightParameters) => any, inner: () => void): void;
};
export declare const beforeEach: (inner: (fixtures: PlaywrightParameters & {

@@ -191,0 +183,0 @@ testWorkerIndex: number;

@@ -17,25 +17,5 @@ "use strict";

*/
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.afterAll = exports.beforeAll = exports.afterEach = exports.beforeEach = exports.xdescribe = exports.fdescribe = exports.describe = exports.test = exports.xit = exports.fit = exports.it = exports.folio = exports.config = exports.expect = void 0;
exports.afterAll = exports.beforeAll = exports.afterEach = exports.beforeEach = exports.describe = exports.test = exports.xit = exports.fit = exports.it = exports.folio = exports.config = exports.expect = void 0;
const folio_1 = require("folio");
const path = __importStar(require("path"));
var folio_2 = require("folio");

@@ -52,4 +32,4 @@ Object.defineProperty(exports, "expect", { enumerable: true, get: function () { return folio_2.expect; } });

fixtures.slowMo.initParameter('Slows down Playwright operations by the specified amount of milliseconds', 0);
fixtures.trace.initParameter('Whether to record the execution trace', !!process.env.TRACING);
fixtures.defaultBrowserOptions.init(async ({ headful, slowMo }, run) => {
fixtures.video.initParameter('Record videos while running tests', false);
fixtures.browserOptions.init(async ({ headful, slowMo }, run) => {
await run({

@@ -69,4 +49,4 @@ handleSIGINT: false,

}, { scope: 'worker' });
fixtures.browser.init(async ({ browserType, defaultBrowserOptions }, run) => {
const browser = await browserType.launch(defaultBrowserOptions);
fixtures.browser.init(async ({ browserType, browserOptions }, run) => {
const browser = await browserType.launch(browserOptions);
await run(browser);

@@ -93,7 +73,5 @@ await browser.close();

}, { scope: 'worker' });
fixtures.defaultContextOptions.init(async ({ trace, testInfo }, run) => {
if (trace || testInfo.retry) {
fixtures.contextOptions.init(async ({ video, testInfo }, run) => {
if (video) {
await run({
_traceResourcesPath: path.join(folio_1.config.outputDir, 'trace-resources'),
_tracePath: testInfo.outputPath('playwright.trace'),
videosPath: testInfo.outputPath(''),

@@ -106,6 +84,6 @@ });

});
fixtures.contextFactory.init(async ({ browser, defaultContextOptions, testInfo, screenshotOnFailure }, run) => {
fixtures.contextFactory.init(async ({ browser, contextOptions, testInfo, screenshotOnFailure }, run) => {
const contexts = [];
async function contextFactory(options = {}) {
const context = await browser.newContext({ ...defaultContextOptions, ...options });
const context = await browser.newContext({ ...contextOptions, ...options });
contexts.push(context);

@@ -145,4 +123,2 @@ return context;

exports.describe = exports.folio.describe;
exports.fdescribe = exports.folio.fdescribe;
exports.xdescribe = exports.folio.xdescribe;
exports.beforeEach = exports.folio.beforeEach;

@@ -149,0 +125,0 @@ exports.afterEach = exports.folio.afterEach;

{
"name": "@playwright/test",
"version": "0.9.17",
"version": "0.9.18",
"license": "Apache-2.0",

@@ -21,4 +21,4 @@ "author": {

"dependencies": {
"folio": "=0.3.10",
"playwright": "1.4.0-next.1601161680085",
"folio": "=0.3.11",
"playwright": "=1.5.0",
"rimraf": "^3.0.2"

@@ -25,0 +25,0 @@ },

@@ -1,2 +0,2 @@

# 🎭 End-to-end web tests with Playwright [![npm version](https://img.shields.io/npm/v/@playwright/test.svg?style=flat)](https://www.npmjs.com/package/@playwright/test)
# 🎭 End-to-end tests with Playwright [![npm version](https://img.shields.io/npm/v/@playwright/test.svg?style=flat)](https://www.npmjs.com/package/@playwright/test)

@@ -32,12 +32,11 @@ 🚧 This project is under active development and is not ready for serious use.

Create `foo.spec.ts` (or `foo.spec.js`) to define your test. Playwright provides a [`page`](https://playwright.dev/#path=docs%2Fapi.md&q=class-page) argument to the test function.
Create `foo.spec.ts` to define your test. The test function uses the [`page`](https://playwright.dev/#path=docs%2Fapi.md&q=class-page) argument for browser automation.
```js
// tests/foo.spec.ts
const { it, expect } = require('@playwright/test');
import { it, expect } from '@playwright/test';
it('is a basic test with the page', async ({ page }) => {
await page.goto('https://playwright.dev/');
const home = await page.waitForSelector('home-navigation');
expect(await home.innerText()).toBe('🎭 Playwright');
const name = await page.innerText('.home-navigation');
expect(name).toBe('🎭 Playwright');
});

@@ -56,3 +55,3 @@ ```

#### Spec syntax
#### Specs and assertions

@@ -67,3 +66,2 @@ Use `it` and `describe` to write test functions.

// Test function
// ...
})

@@ -75,4 +73,2 @@ });

#### Assertions
The test runner provides the [expect](https://www.npmjs.com/package/expect) package for assertions. See [expect API reference](https://jestjs.io/docs/en/expect).

@@ -94,3 +90,3 @@

# Take screenshots on failure
# Save screenshots on failure in test-results directory
npx folio --param screenshotOnFailure

@@ -104,3 +100,14 @@

#### Configure NPM scripts
Save the run command as an NPM script.
```json
{
"scripts": {
"test": "npx folio --param screenshotOnFailure"
}
}
```
-----------

@@ -107,0 +114,0 @@

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