npm

playwright-shared-context-fixture
TypeScript icon, indicating that this package has built-in type declarations

1.1.0 • Public • Published


playwright-shared-context-fixture

👩‍❤️‍👩 Share a common context in playwright to cache SPA's and speed up your tests

Build Status Code Style Package Version MIT License


🚀 Use case

When testing big SPA's that weight significantly the default behavior of creating a new context with every test suite can lead to a lot of wasted time in fetching up the SPA assets.

By sharing a common context SPA resources are fetched once and re-used in all tests


🌱 Installation

# Yarn
yarn add --dev playwright-shared-context-fixture

# PNPM
pnpm add --D playwright-shared-context-fixture

# NPM
npm install --save-dev playwright-shared-context-fixture

📝 Usage

Include the sharedContextFixture in the @playwright/test extend

import { test as base } from "@playwright/test";
import { createSharedContextFixture } from "playwright-shared-context-fixture";

const fixtures = createSharedContextFixture();
const test = base.extend(fixtures);

// Context is now shared
test("my test", async ({ page }) => {});

LICENSE

MIT

Package Sidebar

Install

npm i playwright-shared-context-fixture

Weekly Downloads

1

Version

1.1.0

License

MIT

Unpacked Size

210 kB

Total Files

20

Last publish

Collaborators

  • cubanducko