E2E Testing with playwright
Running tests
The application must be started with TEST_MODE=true
$ TEST_MODE=true yarn dev
Then we can run a single suite with
$ yarn test:e2e ./tests/e2e/administration.spec.ts
Or all the tests with
$ yarn test:e2e
We can also provide some env vars to test:e2e
script:
-
BASE_URL=<any_url>
Run the tests to the given url -
PWDEBUG=1
Control the test execution
Page Objects
- Any locator name must start with of one the following prefixes:
btn
,link
,input
,select
,checkbox
,text
Important links
Assertions
Checking if a element is visible
await expect(anyElement).toBeVisible();