This is the "hackathon-template" project for automation in playwright.
Here are some scripts that you can run in this project:
test
: Run tests with Playwright. Usenpm run test
.test:codegen
: Generate code with Playwright. Usenpm run test:codegen
.test:headed
: Run headed tests with Playwright. Usenpm run test:headed
.test:ui
: Run UI tests with Playwright. Usenpm run test:ui
.format
: Format the code with Prettier. Usenpm run format
. Makes your code prettier.
- Fork this. You know it. You can do it.
- Clone it.
- Use it!
npm install
to install all dependencies.- Edit line 27 (
baseUrl
) inplaywright.config.ts
to your url
- then you can use
await page.goto("/login")
for example - or like that in your page
async visit() { await this.page.goto("/login"); }
- Check structure of this project.
- You can use page object pattern, if you want.
- You can use
codegen
as well
Good luck!
npx playwright install --with-deps chromium