diff --git a/tests/playwright/README.md b/tests/playwright/README.md new file mode 100644 index 000000000..48e70b36a --- /dev/null +++ b/tests/playwright/README.md @@ -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" +``` diff --git a/tests/playwright/example.spec.js b/tests/playwright/example.spec.js index 903559648..789a68e19 100644 --- a/tests/playwright/example.spec.js +++ b/tests/playwright/example.spec.js @@ -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/); });