https://github.com/tyszkiewiczkonopka/playwright_demobank
https://github.com/tyszkiewiczkonopka/playwright_demobank
Last synced: 4 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/tyszkiewiczkonopka/playwright_demobank
- Owner: tyszkiewiczkonopka
- Created: 2024-03-23T18:45:08.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-10-16T13:21:47.000Z (8 months ago)
- Last Synced: 2025-01-08T03:49:10.696Z (5 months ago)
- Language: TypeScript
- Size: 50.8 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Test Automation training from jaktestowac.pl
## Links
- course https://jaktestowac.pl/course/playwright-wprowadzenie/
- test site
https://demo-bank.vercel.app/If link broken check first lesson for update:
https://jaktestowac.pl/lesson/pw1s01l01/## Commands
- check `NodeJS` version
`node -v`
- new project with Playwright:
`npm init playwright@latest`
- record tests for given site
`npx playwright codegen https://demo-bank.vercel.app/`
- run tests without browser GUI:
`npx playwright test`
- run test with browser GUI:
`npx playwright test --headed`
- viewing report
`npx playwright show-report`## Playwright Config modifications
- config file `playwright.config.ts`
- disabling browsers, i.e. Firefox:
```json
// {
// name: 'firefox',
// use: {
// ...devices['Desktop Firefox'],
// },
// },
```## Visual Studio Code
- Preview: for README.md
- Auto save option: File -> Auto save
- File history: Folder -> context menu -> Open timeline## Playwright snippets
- always begin with import
```javascript
import { test, expect } from '@playwright/test';
```- group tests with 'describe'
```javascript
test.describe('Pulpit tests', () => {});
```- wait for page to fully load
```javascript
await page.waitForLoadState('domcontentloaded');
```