Skip to content

SebastianSedzik/msw-remote-server-playwright-example

Repository files navigation

Playground: MSW Remote Server API + Playwright

This repository showcases the example integration of the MSW Remote Server API with Playwright test runner.

It uses an unstable version of MSW created from the mswjs/msw#2041 PR.

Getting started

  1. Clone the repository:
[email protected]:SebastianSedzik/msw-remote-server-playwright-example.git
  1. Install dependencies:
pnpm install
  1. Run Playwright tests:
pnpm test

Overview

This repository includes a server application and Playwright tests to cover its functionalities:

  1. ./server-app An application that exposes two paths:
    • /: Main path with links to sub-pages
    • /recipes: A page that displays a list of recipes fetched from the https://dummyjson.com API. The list of recipes is fetched on the server side.
  2. ./tests: Playwright tests using MSW Remote Server API to mock server-app requests:

Running the app (normal mode)

In this mode, the application will make calls to the real API.

pnpm start

After successfully running the command, the app should be accessible at http://localhost:3000.

Running app (mocked mode)

In this mode, the application will use MSW handlers instead of making calls to the real API.

pnpm start-mocked

After successfully running the command, the app should be accessible at http://localhost:3000.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published