Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ dts-build/packages
*.tsbuildinfo
*.tgz
packages-private/benchmark/reference
**/__tests__/**/__screenshots__/**/*
8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,9 @@
"@types/node": "^22.18.6",
"@types/semver": "^7.7.1",
"@types/serve-handler": "^6.1.4",
"@vitest/ui": "^3.0.2",
"@vitest/coverage-v8": "^3.2.4",
"@vitest/ui": "^4.0.1",
"@vitest/browser-playwright": "^4.0.1",
"@vitest/coverage-v8": "^4.0.1",
"@vitest/eslint-plugin": "^1.3.12",
"@vue/consolidate": "1.0.0",
"conventional-changelog-cli": "^5.0.0",
Expand All @@ -93,6 +94,7 @@
"marked": "13.0.3",
"npm-run-all2": "^8.0.4",
"picocolors": "^1.1.1",
"playwright": "^1.56.1",
"prettier": "^3.5.3",
"pretty-bytes": "^6.1.1",
"pug": "^3.0.3",
Expand All @@ -111,6 +113,6 @@
"typescript": "~5.6.2",
"typescript-eslint": "^8.32.1",
"vite": "catalog:",
"vitest": "^3.2.4"
"vitest": "^4.0.1"
}
}
21 changes: 21 additions & 0 deletions packages-private/vapor-e2e-test/__tests__/e2eUtils.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { type Locator, page, userEvent } from 'vitest/browser'

export const css = (css: string) => page.getByCSS(css)
export const E2E_TIMEOUT: number = 30 * 1000

export async function enterValue(locator: Locator, text: string) {
await locator.fill(text)
await userEvent.type(locator, '{enter}')
}

export function nextFrame() {
// this page is not same as Playwright's page
// how to wait for the next frame?
return page.evaluate(() => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sheremet-va
I merged the latest code of minor into the current branch, but I encountered a problem and don't know how to solve it. this page is not same as Playwright's page. how to wait for the next frame? I couldn't find a solution in the vitest documentation.

return new Promise(resolve => {
requestAnimationFrame(() => {
requestAnimationFrame(resolve)
})
})
})
}
17 changes: 17 additions & 0 deletions packages-private/vapor-e2e-test/__tests__/setupBrowser.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { type Locator, locators } from 'vitest/browser'

locators.extend({
getByCSS(css: string) {
return `css=${css}`
},
})

const div = document.createElement('div')
div.id = 'app'
document.body.appendChild(div)

declare module 'vitest/browser' {
interface LocatorSelectors {
getByCSS(css: string): Locator
}
}
Loading