Skip to content

Commit eeb1a0b

Browse files
authored
Update Playwright usage instructions and comments q
Added usage instructions for Playwright commands and improved comments in the script section.
1 parent 3212fd8 commit eeb1a0b

1 file changed

Lines changed: 16 additions & 4 deletions

File tree

pages/playwright/index.html

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,20 @@ <h2>playwright setup</h2>
3636
download "playwright-async.config.js"
3737
download "tests/tools/cmd.js"
3838

39-
40-
41-
4239
test -f package.json || echo "{}" > package.json
4340
yarn add -D playwright @playwright/test dotenv
41+
42+
--- Then use
43+
./node_modules/.bin/playwright codegen http://0.0.0.0:5678/vite-project/dist/
44+
/bin/bash playwright.sh composition/react/composite-select-demo-attr.e2e.ts
45+
/bin/bash playwright.sh -- --debug -- composition/react/composite-select-demo-attr.e2e.ts
46+
/bin/bash playwright.sh -- vite-project/src/App.e2e.ts -g "build list"
47+
/bin/bash playwright.sh -- --debug -g "select two" -- composition/composite-select/composite-select.e2e.ts
48+
49+
npx playwright show-report
50+
./node_modules/.bin/playwright test --headed --forbid-only --project=chromium --workers=1
51+
52+
4453
</script>
4554
<h2>Usefull snippets</h2>
4655
<script type="editor" data-lang="ts">
@@ -59,7 +68,8 @@ <h2>Usefull snippets</h2>
5968
const outerHTML = await firstElement.evaluate((el) => el.outerHTML);
6069
const innerHTML = await firstElement.evaluate((el) => el.innerHTML);
6170

62-
// select in Web Component
71+
// selectors
72+
// in web component
6373
const section = await page.locator("center-and-height-resizer").locator(".buttons-container");
6474

6575
// exist or not exist
@@ -70,6 +80,8 @@ <h2>Usefull snippets</h2>
7080

7181
// checkbox
7282
await page.locator("#loading-sel-1").check();
83+
// in docker this might throw Error: locator.check: Clicking the checkbox did not change its state
84+
// use .click() better in that case
7385
await page.locator("#loading-sel-1").uncheck();
7486

7587

0 commit comments

Comments
 (0)