Skip to content

jy13249/TypeScriptPlaywrightSampleProject

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TypeScript Playwright Sample Project

This repository demonstrates how to use Playwright with TypeScript for end-to-end testing.

Prerequisites

Getting Started

  1. Install dependencies

    npm install
  2. Run Playwright install (to download browsers)

    npx playwright install
  3. Run tests

    npx playwright test

Project Structure

  • tests/ - Contains your test files (TypeScript)
  • playwright.config.ts - Playwright configuration file
  • package.json - Project metadata and scripts

Writing Tests

Create your test files in the tests/ directory using TypeScript. Example:

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

test('homepage has title', async ({ page }) => {
  await page.goto('https://playwright.dev/');
  await expect(page).toHaveTitle(/Playwright/);
});

Useful Commands

  • Run all tests:
    npx playwright test
  • Run tests in headed mode:
    npx playwright test --headed
  • Generate test report:
    npx playwright show-report

Resources

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors