To manually get started with Playwright, install the @playwright/test package:

npm install --save-dev @playwright/test
Add Playwright to the package.json scripts field:

"scripts": {
  "dev": "next dev",
  "build": "next build",
  "start": "next start",
  "test:e2e": "playwright test",
}
To manually get started with Playwright, install the @playwright/test package:

npm install --save-dev @playwright/test
Add Playwright to the package.json scripts field:

"scripts": {
  "dev": "next dev",
  "build": "next build",
  "start": "next start",
  "test:e2e": "playwright test",
}
To get started with Cypress, install the cypress package:

npm install --save-dev cypress
Add Cypress to the package.json scripts field:

"scripts": {
  "dev": "next dev",
  "build": "next build",
  "start": "next start",
  "cypress": "cypress open",
}
Run Cypress for the first time to generate examples that use their recommended folder structure:

npm run cypress
Add a test to verify that your navigation is working correctly:

// e2e/example.spec.ts

import { test, expect } from '@playwright/test'

test('should navigate to the about page', async ({ page }) => {
  // Start from the index page (the baseURL is set via the webServer in the playwright.config.ts)
  await page.goto('http://localhost:3000/')
  // Find an element with the text 'About Page' and click on it
  await page.click('text=About Page')
  // The new url should be "/about" (baseURL is used there)
  await expect(page).toHaveURL('http://localhost:3000/about')
  // The new page should contain an h1 with "About Page"
  await expect(page.locator('h1')).toContainText('About Page')
})
The fastest way to get started, is to use create-next-app with the with-playwright example. This will create a Next.js project complete with Playwright all set up.

npx create-next-app@latest --example with-playwright with-playwright-app
Install next, react and react-dom in your project:

npm install next react react-dom
# or
yarn add next react react-dom
Open package.json and add the following scripts:

"scripts": {
  "dev": "next dev",
  "build": "next build",
  "start": "next start",
  "lint": "next lint"
}
Populate ./pages/index.js with the following contents:

function HomePage() {
  return <div>Welcome to Next.js!</div>
}

export default HomePage

Recommend

Nextjs Testing Playwright Quickstart

Nextjs Testing Cypress Getting ready for Continuous Integration (CI)

Nextjs Testing Cypress Creating your first Cypress integration test

Nextjs Testing Cypress Manual setup

Nextjs Testing Cypress Quickstart

Nextjs Middleware Execution Order

Nextjs Middleware API

Nextjs Middleware Usage

Matplotlib Overview of axisartist toolkit FloatingAxis

Matplotlib Overview of axisartist toolkit GridHelper

Matplotlib Overview of axisartist toolkit Rotation and Alignment of TickLabels Adjusting pad

Matplotlib Overview of axisartist toolkit Rotation and Alignment of TickLabels

Matplotlib Overview of axisartist toolkit HowTo

Matplotlib Overview of axisartist toolkit Default AxisArtists

Matplotlib Overview of axisartist toolkit axisartist axisartist with ParasiteAxes

Matplotlib Overview of axisartist toolkit axisartist

Matplotlib The mplot3d Toolkit Tri-Surface plots

Matplotlib The mplot3d Toolkit

Matplotlib Overview of mpl_toolkits.axes_grid1 AxesDivider

Matplotlib Overview of mpl_toolkits.axes_grid1 axes_grid1 RGBAxes

Matplotlib Overview of mpl_toolkits.axes_grid1 axes_grid1 InsetLocator

Matplotlib Overview of mpl_toolkits.axes_grid1 axes_grid1 ParasiteAxes Example 2. twin

Matplotlib Overview of mpl_toolkits.axes_grid1 axes_grid1 colorbar whose height (or width) in sync with the master axes scatter_hist.py with AxesDivider

Matplotlib Overview of mpl_toolkits.axes_grid1 axes_grid1 AxesDivider Class

Matplotlib Image tutorial Plotting numpy arrays as images Array Interpolation schemes

Matplotlib Image tutorial Plotting numpy arrays as images Examining a specific data range

Matplotlib Image tutorial Plotting numpy arrays as images Color scale reference

Matplotlib Image tutorial Plotting numpy arrays as images Applying pseudocolor schemes to image plots

Matplotlib Image tutorial Plotting numpy arrays as images

Matplotlib Image tutorial Importing image data into Numpy arrays

Matplotlib Image tutorial Startup commands

Matplotlib Pyplot tutorial Logarithmic and other nonlinear axes

Matplotlib Pyplot tutorial Working with text Annotating text

Matplotlib Pyplot tutorial Working with text Using mathematical expressions in text

Matplotlib Pyplot tutorial Working with text

Matplotlib Pyplot tutorial Working with multiple figures and axes

Matplotlib Pyplot tutorial Controlling line properties

Matplotlib Pyplot tutorial Plotting with categorical variables

Matplotlib Pyplot tutorial Plotting with keyword strings

Matplotlib Pyplot tutorial Intro to pyplot Formatting the style of your plot

Matplotlib Pyplot tutorial Intro to pyplot

Matplotlib Basic Usage Working with multiple Figures and Axes

Matplotlib Basic Usage Color mapped data

Matplotlib Basic Usage Axis scales and ticks Additional Axis objects

Matplotlib Basic Usage Axis scales and ticks Plotting dates and strings

Matplotlib Basic Usage Axis scales and ticks Tick locators and formatters

Matplotlib Basic Usage Axis scales and ticks Scales

Matplotlib Basic Usage Labelling plots Legends