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

jest-playwright-preset

Package Overview
Dependencies
Maintainers
2
Versions
79
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jest-playwright-preset

Running tests using Jest & Playwright.

  • 1.4.6
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
580K
decreased by-39.68%
Maintainers
2
Weekly downloads
 
Created

What is jest-playwright-preset?

The jest-playwright-preset package allows you to use Playwright with Jest for end-to-end testing. It provides a Jest preset configuration that simplifies the setup and usage of Playwright within Jest, enabling you to write tests that can interact with web pages in a headless browser environment.

What are jest-playwright-preset's main functionalities?

Setup and Configuration

This feature allows you to easily set up Jest to use Playwright by adding the jest-playwright-preset to your Jest configuration file. This simplifies the initial setup process.

module.exports = { preset: 'jest-playwright-preset' };

Writing Tests

This feature allows you to write tests that interact with web pages. In this example, the test navigates to a URL and checks if the page title is as expected.

test('should display the correct title', async () => { await page.goto('https://example.com'); const title = await page.title(); expect(title).toBe('Example Domain'); });

Custom Browser Contexts

This feature allows you to customize the browser context for your tests. In this example, the viewport size is set before all tests run.

beforeAll(async () => { await jestPlaywright.resetContext({ viewport: { width: 1280, height: 720 } }); });

Other packages similar to jest-playwright-preset

Keywords

FAQs

Package last updated on 15 Feb 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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