playwright-shared-context-fixture
🚀 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