Skip to content

UmarShariff771/Playwright-Basic-Javascript

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Playwright-Basic-Javascript

🧩 Pre-requisites

Before getting started, ensure you have the following installed:

  • Node.js (latest LTS version recommended)
  • Visual Studio Code

Once installed:

  1. Open the specified project folder in VS Code or

  2. Clone the repository using:

    git clone <repository-url>
    

⚙️ Installation Steps

Initialize Playwright in your project:

npm init playwright

Follow the prompts to set up your desired configuration (browsers, example tests, etc.).

🧪 Playwright Terminal Commands

1. Run all tests

Runs all tests based on the testDir configured in playwright.config.js.

npx playwright test

2. Run tests in headed mode

Overrides headlines: true in config to show the browser UI.

npx playwright test --headed

3. Run a specific test file

npx playwright test /

npx playwright test tests/UIBasics.spec.js

4. Run tests in debug mode

npx playwright test / --debug

npx playwright test tests/UIBasics.spec.js --debug

5. Record and playback (Codegen)

Launch the Playwright inspector to generate tests via code recording:

npx playwright codegen

npx playwright codegen https://google.com

6. View trace files

Open trace files in your browser for debugging:

Website: https://trace.playwright.dev/

Or use the CLI command:

npx playwright show-trace <path-to-trace.zip>

✅ Notes

Ensure all dependencies are installed before running tests:

npm install

Keep your browsers up to date:

npx playwright install

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors