Retry UI test assertions (#14165)
We noticed that some of the tests depending on the `hover:` variant were flaky. After some investigation, we found that injected elements had the `:hover` state without us explicitly hovering over the element. To avoid this, we now set up an explicit placeholder element to move the mouse to before running the tests.
This commit is contained in:
parent
fbf877aa0a
commit
8cace0d9b5
1 changed files with 10 additions and 0 deletions
|
|
@ -305,6 +305,14 @@ async function render(page: Page, content: string) {
|
|||
}
|
||||
`)
|
||||
|
||||
// We noticed that some of the tests depending on the `hover:` variant were
|
||||
// flaky. After some investigation, we found that injected elements had the
|
||||
// `:hover` state without us explicitly hovering over the element.
|
||||
//
|
||||
// To avoid this, we now set up an explicit placeholder element to move the
|
||||
// mouse to before running the tests.
|
||||
content = `<div id="mouse-park" class="size-12"></div>${content}`
|
||||
|
||||
await page.setContent(content)
|
||||
await page.addStyleTag({
|
||||
content: optimizeCss(
|
||||
|
|
@ -312,6 +320,8 @@ async function render(page: Page, content: string) {
|
|||
),
|
||||
})
|
||||
|
||||
await page.locator('#mouse-park').hover()
|
||||
|
||||
return {
|
||||
getPropertyValue(selector: string | [string, string], property: string) {
|
||||
return getPropertyValue(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue