test: do not use deprecated methods

This commit is contained in:
leejooy96 committed 2023-10-31 15:27:50 +09:00
1 parent 24b504768e
commit 1a8a8806ee
2 files changed
+12 -11

No files matched your search

+10 -9
View File
@@ -12,9 +12,10 @@ function waiting(milliseconds: number) {
function isElementVisible(selector: string, waitingMilliseconds = 100) {
return new Promise((resolve) => {
setTimeout(async () => {
expect(await appWindow.isVisible(selector), `Confirm selector '${selector}' is visible`).toBe(
true
)
await expect(
appWindow.locator(selector).first(),
`Confirm selector '${selector}' is visible`
).toBeVisible()
resolve(true)
}, waitingMilliseconds)
})
@@ -43,14 +44,14 @@ test('Document element check', async () => {
})
test('Counter button click check', async () => {
await appWindow.click('#btn-counter', { clickCount: 10, delay: 50 })
await appWindow.getByTestId('btn-counter').click({ clickCount: 10, delay: 50 })
const counterValueElement = await appWindow.$('#counter-badge .v-badge__badge')
const counterValueElement = await appWindow
.getByTestId('counter-badge')
.getByRole('status')
.innerHTML()
expect(
await appWindow.evaluate((element) => element.innerHTML, counterValueElement),
'Confirm counter value is same'
).toBe('10')
expect(counterValueElement).toBe('10')
})
test.afterAll(async () => {