Skip to content

Commit

Permalink
chore: update Playwright example (#2372)
Browse files Browse the repository at this point in the history
  • Loading branch information
jfgreffier committed Nov 24, 2022
1 parent aa6ee0f commit 5d7463e
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 18 deletions.
4 changes: 2 additions & 2 deletions examples/playwright/package.json
Expand Up @@ -7,9 +7,9 @@
"test:ui": "vite build && vitest --ui"
},
"devDependencies": {
"@playwright/test": "^1.23.4",
"@playwright/test": "^1.28.0",
"@vitest/ui": "latest",
"playwright": "^1.23.4",
"playwright": "^1.28.0",
"vite": "latest",
"vitest": "latest"
}
Expand Down
1 change: 0 additions & 1 deletion examples/playwright/src/index.ts
@@ -1,6 +1,5 @@
const root = document.createElement('div')
const button = document.createElement('button')
button.id = 'btn'

let count = 0

Expand Down
6 changes: 3 additions & 3 deletions examples/playwright/test/basic.test.ts
Expand Up @@ -23,10 +23,10 @@ describe('basic', async () => {
})
})

test('should have the correct title', async () => {
test('should change count when button clicked', async () => {
await page.goto('http://localhost:3000')
const button = page.locator('#btn')
await expect(button).toBeDefined()
const button = page.getByRole('button', { name: /Clicked/ })
await expect(button).toBeVisible()

await expect(button).toHaveText('Clicked 0 time(s)')

Expand Down
24 changes: 12 additions & 12 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 5d7463e

Please sign in to comment.