System info
- Playwright Version: v1.33
- Operating System: Windows 10
- Browser: Chromium
- Other info:
Issue Description
I want to verify the contents of tips when hovers over some locators.
- Headed Mode
- Locator is visible without scrolling: √
- Locator needs scrolling & depends on hover() itself to
scrollIntoView: ×
- Locator needs scrolling & manually trigger
scrollIntoView in advance: √
- Headless Mode
- First condition above: √
- Last two items above: ×
Why the 3rd condition worked in Headed while not worked in Headless? How the scrollIntoVieW method works?
The element needs to be hovered is a bit special, it may not depend on :hover, having tested in Chrome DevTools: added force state to it but the content didn't appeared too, so it maybe binds to other listeners.
I wonder if there is a solution to deal with such condition? Could locator.hover()continuously triggers until expect() statements to be done?
Source code
Test file (self-contained)
await page.getBytext('other locator nearby to trigger scrollIntoView').click();
await expect(page.getByText('${tip}')).toHaveCount(0);
await page.locator('xxx-label:visible').locator('.tool-tip').hover();
await expect(page.getByText('${tip}')).toHaveCount(1);
Steps
Expected
All passed
Actual
- Headed Mode
- Locator is visible without scrolling: √
- Locator needs scrolling & depends on hover() itself to
scrollIntoView: ×
- Locator needs scrolling & manually trigger
scrollIntoView in advance: √
- Headless Mode
- First condition above: √
- Last two items above: ×
System info
Issue Description
I want to verify the contents of tips when hovers over some locators.
scrollIntoView: ×scrollIntoViewin advance: √Why the 3rd condition worked in Headed while not worked in Headless? How the
scrollIntoVieWmethod works?The element needs to be hovered is a bit special, it may not depend on :hover, having tested in Chrome DevTools: added force state to it but the content didn't appeared too, so it maybe binds to other listeners.
I wonder if there is a solution to deal with such condition? Could
locator.hover()continuously triggers untilexpect()statements to be done?Source code
Test file (self-contained)
Steps
Expected
All passed
Actual
scrollIntoView: ×scrollIntoViewin advance: √