Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: Re-enabled mixed chart hover test #3306

Merged
merged 2 commits into from
Feb 21, 2025
Merged
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
17 changes: 11 additions & 6 deletions src/mixed-line-bar-chart/__integ__/mixed-line-bar-chart.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -504,26 +504,31 @@ describe('Details popover', () => {
await page.windowScrollTo({ top: 150 });
const barChart = createWrapper().findBarChart();
const barGroup = barChart.findBarGroups().get(1).toSelector();
await expect(page.getWindowScroll()).resolves.toEqual({ top: 150, left: 0 });
await expect(page.getWindowScroll().then(s => s.top)).resolves.toBe(150);
await page.clickBarGroup(barGroup);
await page.waitForVisible(barChart.findDetailPopover().toSelector());
await expect(page.getText(barChart.findDetailPopover().findHeader().toSelector())).resolves.toContain('Apr 2023');
await expect(page.getWindowScroll()).resolves.toEqual({ top: 0, left: 0 });
await expect(page.getWindowScroll().then(s => s.top)).resolves.toBe(0);
})
);

// Skipped due to failures with WebdriverIO v9.
test.skip(
test(
'does not scroll on hover',
setupTest('#/light/bar-chart/drilldown', async page => {
await page.setWindowSize({ width: 360, height: 650 });
await page.windowScrollTo({ top: 150 });
const barChart = createWrapper().findBarChart();
const barGroup = barChart.findBarGroups().get(1).toSelector();
await expect(page.getWindowScroll()).resolves.toEqual({ top: 150, left: 0 });
await expect(page.getWindowScroll().then(s => s.top)).resolves.toBe(150);
await page.hoverElement(barGroup);
await page.waitForVisible(barChart.findDetailPopover().toSelector());
await expect(page.getText(barChart.findDetailPopover().findHeader().toSelector())).resolves.toContain('Apr 2023');
await expect(page.getWindowScroll()).resolves.toEqual({ top: 150, left: 0 });

// Explanation: when a series is hovered we expect no extra scroll, so the page's scroll should stay at 150px.
// However, Webdriver automatically performs scroll adjustments when hovering to make the element fit the screen,
// so we give it a small extra allowance.
await expect(page.getWindowScroll().then(s => s.top)).resolves.toBeGreaterThanOrEqual(150);
await expect(page.getWindowScroll().then(s => s.top)).resolves.toBeLessThan(250);
})
);

Expand Down
Loading