This directory contains end-to-end tests for the project. These tests are written in Typescript and use the Playwright library to interact with the browser.
To run the tests, please run
npm run test:e2e
This will start the test runner and run all the tests in the e2e_tests
directory.
To run the tests in an interactive ui mode, please run
npm run test:e2e:ui
Should the playwright browsers not be installed, please run the following command to install them:
npx playwright install
To write a new test, please create a new file in the tests/
directory. The file should have the extension .spec.ts
. Each function in the file should be a test case.
For example:
import { test, expect } from "@playwright/test";
test("should open the homepage", async ({ page }) => {
await page.goto("http://localhost:3000");
const title = await page.title();
expect(title).toBe("Homepage");
});