Add basic documentation

This commit is contained in:
Emili Castells Guasch 2023-02-24 15:48:14 +01:00
parent c84d10eb62
commit a121373be0
2 changed files with 16 additions and 2 deletions

View file

@ -0,0 +1,14 @@
# Playwright Testing
## Local Environment Variables
Allows using environment variables inside the tests.
- Duplicate `.env.sample` and rename it as `.env`, set values and add new variables if needed.
## Run Tests
```
$ npx playwright test
$ npx playwright test example.spec.js --headed
$ npx playwright test example.spec.js --debug
$ npx playwright test -g "Test name here"
```

View file

@ -1,6 +1,6 @@
const { test, expect } = require('@playwright/test');
test('has ngrok url', async ({page, baseURL}) => {
test('has title', async ({ page }) => {
await page.goto('/');
await expect(page).toHaveURL(baseURL);
await expect(page).toHaveTitle(/WooCommerce PayPal Payments/);
});