Template project for web testing with Playwright and TypeScript.
- @faker-js/faker: Library for generating fake data, useful for test data creation.
- @playwright/test: End-to-end testing library for web applications, built on top of Playwright.
- @types/node: TypeScript type definitions for Node.js.
- typescript-eslint: ESLint plugin for TypeScript code analysis.
- eslint: A pluggable and configurable linter for identifying and fixing problems in JavaScript code.
- eslint-plugin-playwright: ESLint rules for Playwright tests.
- prettier: Opinionated code formatter to enforce a consistent code style.
- typescript: TypeScript language support.
- dotenv: Zero-dependency module that loads environment variables from a .env file for your Node.js applications.
Before you begin, ensure you have Node.js and npm installed on your machine. If not, follow the installation instructions provided in the Node.js Package Manager Installation Guide.
-
Click on the "Use this template" button and then "Create new repository" menu item.
-
Change the directory.
cd playwright-typescript-template
- Install the dependencies and the browsers.
npm install && npx playwright install
- Run the test.
npx playwright test
- Report the test result.
npm run report