There are two componenents: myButton and myModal.
Run the app
npm run devRun tests
npm run test-ctRun tests in UI mode
npm run test-ct -- --uiplaywright-ct-.config.ts./playwright/index.ts
npm run test-ct src/components/myButtonmyModal - visibility
playwright test -c playwright-ct.config.ts --ui src/components/myModal--uiallows for watch mode- Add
<div id="modals"></div>inplaywright/index.html(remove theDIVto see the broken test)
For integration you decide how broad the scope is. Key takeaways:
Testing component in small
Testing component in large
Playwright Test for VSCode allows you to run tests from Visual Studio Code.
myModal - visual tests
- Tests are tagged as
@visual-tests
npm run test-ct -- --ui --grep @visual-testsBread something:
- <h3 class="flex shrink-0 items-center pb-4 text-xl font-medium ">Cześć!</h3>
+ <h3 class="flex shrink-0 items-center pb-40 text-xl font-medium ">Cześć!</h3>And in the Playwright UI look at the side by side oraz slider tabs. If you want to update snapshots:
npm run test-ct src/components/myModal/myModal.component.spec.ts -- --update-snapshotssrc/components/myButton/myButton.spec.tssrc/components/myModal/myModal.spec.ts