Skip to content

Commit

Permalink
Explain playwright tests in CONTRIBUTING.md
Browse files Browse the repository at this point in the history
  • Loading branch information
sabberworm committed Nov 19, 2024
1 parent c3f68a9 commit bdcbf81
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
11 changes: 11 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,20 @@ The following checks must succeed before code can be merged:
- Prettier
- TypeScript compile
- ESLint
- Playwright

The `./gradlew check` command executes them all. To reformat code, use `./gradlew prettierFormat`.

The playwright tests also include visual regression tests. The reference images only exist for chromium on linux. All other variations have been deemed too flaky. If you are not on linux (or WSL), you can use docker to run the tests (check the current version of playwright in `package.json` and adjust `PLAYWRIGHT_VERSION` accordingly):

```bash
PLAYWRIGHT_VERSION=v1.49.0
./gradlew frontendBuild
docker run -v .:/app --workdir /app -it --rm mcr.microsoft.com/playwright:$PLAYWRIGHT_VERSION-noble npm run test:playwright
```

Exclude the playwright task from `./gradlew check` by passing `-x playwright`.

### Working on the GUI editor

To run the editor GUI independently from AEM (and with mocked responses), the watch mode can be used:
Expand Down
3 changes: 1 addition & 2 deletions src/test/playwright/basic.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ test('add step', async ({ page }) => {
await expect(page).toHaveScreenshot();
await page.getByRole('option', { name: 'Query JCR' }).click();
await page.getByLabel('Log Level: INFO').click();
await page.getByRole('option', { name: 'TRACE' }).click();
await page.getByRole('option', { name: 'TRACE' }).click();
await expect(page).toHaveScreenshot();

const step = page.locator('.hop-config.nodeQuery');
Expand Down Expand Up @@ -61,5 +61,4 @@ test('add step', async ({ page }) => {
- text: /info JCR Hopper script finished after \\d+[hmsp]+ warn Not saving changes as dry run is enabled error Script execution aborted with exception/
- button "!!"
`);

});

0 comments on commit bdcbf81

Please sign in to comment.