Files
ComfyUI_frontend/browser_tests/tests/baseTooltip.spec.ts
dante01yoon 3aef8da214 fix(test): drop fragile z-index assertion from tooltip e2e test
getComputedStyle().zIndex returns "auto" in CI because Tailwind CSS
z-[1700] is not resolved to a numeric value in the CI build environment.
2026-03-27 22:47:42 +09:00

48 lines
1.3 KiB
TypeScript

import type { Locator, Page } from '@playwright/test'
import {
comfyPageFixture as test,
comfyExpect as expect
} from '../fixtures/ComfyPage'
function tooltipLocator(page: Page): Locator {
return page.locator('[role="tooltip"]')
}
async function hoverAway(page: Page): Promise<void> {
await page.mouse.move(0, 0)
}
test.describe('BaseTooltip regression', { tag: '@ui' }, () => {
test.beforeEach(async ({ comfyPage }) => {
await comfyPage.settings.setSetting('Comfy.UseNewMenu', 'Top')
await comfyPage.setup()
})
test('Queue history button shows tooltip on hover', async ({ comfyPage }) => {
const queueButton = comfyPage.page.getByTestId('queue-overlay-toggle')
await queueButton.hover()
const tooltip = tooltipLocator(comfyPage.page)
await expect(tooltip).toBeVisible()
await hoverAway(comfyPage.page)
await expect(tooltip).not.toBeVisible()
})
test('Toggle properties panel button shows tooltip on hover', async ({
comfyPage
}) => {
const panelButton = comfyPage.page
.getByLabel(/Toggle properties panel/i)
.first()
await panelButton.hover()
const tooltip = tooltipLocator(comfyPage.page)
await expect(tooltip).toBeVisible()
await hoverAway(comfyPage.page)
await expect(tooltip).not.toBeVisible()
})
})