Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mirian97/learn-playwright
Learning Playwright
https://github.com/mirian97/learn-playwright
codegen e2e playwright test-automation
Last synced: 17 days ago
JSON representation
Learning Playwright
- Host: GitHub
- URL: https://github.com/mirian97/learn-playwright
- Owner: Mirian97
- Created: 2024-12-14T18:35:26.000Z (20 days ago)
- Default Branch: master
- Last Pushed: 2024-12-14T19:20:11.000Z (20 days ago)
- Last Synced: 2024-12-14T20:20:50.451Z (20 days ago)
- Topics: codegen, e2e, playwright, test-automation
- Language: TypeScript
- Homepage: https://playwright.dev/
- Size: 27.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Learn Playwright
This repository contains automated tests written using [Playwright](https://playwright.dev/).
Playwright is considered one of the best solutions for end-to-end (E2E) testing due to the following key features:- **Cross-Browser Testing**:
Playwright supports all major browsers, including Chromium, Firefox, and WebKit. This ensures your application works seamlessly across different environments.- **Automatic Waiting**:
Playwright automatically waits for elements to be ready before performing actions, reducing the need for complex and flaky manual wait logic.- **Multi-Language Support**:
While built in Node.js, Playwright offers bindings for Python, Java, and C#, making it accessible to developers across different tech stacks.- **Fast and Reliable**:
Playwright runs tests quickly and efficiently, with parallel execution and reduced flakiness, even for dynamic web applications.- **Headless and Headed Execution**:
Tests can be run in headless mode for CI pipelines or headed mode for debugging and observation.## Installation
1. Clone the repository:
```bash
git clone https://github.com/your-username/learn-playwright.git
cd learn-playwright
```2. Install dependencies:
```bash
npm install
```## Running Tests
To run all tests, execute the following command:
```bash
npx playwright test
```### Show Report Test
After run the tests, you can see the detailed report with:
```bash
npx playwright show-report
```### Running Specific Tests
You can run a specific test file by specifying its path:
```bash
npx playwright test tests/example.spec.js
```### Headless Mode
By default, Playwright runs tests in headless mode. To run tests with a visible browser:
```bash
npx playwright test --headed
```### Running Tests to Specific Browser
If you would like to run in specific browser
```bash
npx playwright test --project chromium
```### Debugging
To debug tests, use the following command:
```bash
npx playwright test --debug
```## Folder Structure
- **tests/**: Contains test files written in JavaScript/TypeScript.
- **playwright.config.js**: Configuration file for Playwright.## Documentation
- Official Playwright Documentation: [https://playwright.dev/docs/intro](https://playwright.dev/docs/intro)