mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-26 01:09:46 +00:00
Typing fixes, initial tests
This commit is contained in:
63
browser_tests/documentationSidebar.spec.ts
Normal file
63
browser_tests/documentationSidebar.spec.ts
Normal file
@@ -0,0 +1,63 @@
|
||||
import { expect } from '@playwright/test'
|
||||
import { comfyPageFixture as test } from './ComfyPage'
|
||||
|
||||
test.describe('Documentation Sidebar', () => {
|
||||
test('Sidebar registered', async ({ comfyPage }) => {
|
||||
await expect(
|
||||
comfyPage.page.locator('.documentationSidebar-tab-button')
|
||||
).toBeVisible()
|
||||
})
|
||||
test('Parses help for basic node', async ({ comfyPage }) => {
|
||||
await comfyPage.loadWorkflow('default')
|
||||
await comfyPage.page.locator('.documentationSidebar-tab-button').click()
|
||||
const docPane = comfyPage.page.locator('.sidebar-content-container')
|
||||
//Check that each independently parsed element exists
|
||||
await expect(docPane).toContainText('Load Checkpoint')
|
||||
await expect(docPane).toContainText('Loads a diffusion model')
|
||||
await expect(docPane).toContainText('The name of the checkpoint')
|
||||
await expect(docPane).toContainText('The VAE model used')
|
||||
})
|
||||
test('Responds to hovering over node', async ({ comfyPage }) => {
|
||||
await comfyPage.loadWorkflow('default')
|
||||
await comfyPage.page.locator('.documentationSidebar-tab-button').click()
|
||||
const docPane = comfyPage.page.locator('.sidebar-content-container')
|
||||
await comfyPage.page.mouse.move(321, 593)
|
||||
const tooltipTimeout = 500
|
||||
await comfyPage.page.waitForTimeout(tooltipTimeout + 16)
|
||||
await expect(comfyPage.page.locator('.node-tooltip')).not.toBeVisible()
|
||||
await expect(
|
||||
comfyPage.page.locator(
|
||||
'.side-bar-panel > div > div > div > div:nth-child(4)'
|
||||
)
|
||||
).toBeFocused()
|
||||
})
|
||||
test('Updates when a new node is selected', async ({ comfyPage }) => {
|
||||
await comfyPage.loadWorkflow('default')
|
||||
await comfyPage.page.locator('.documentationSidebar-tab-button').click()
|
||||
const docPane = comfyPage.page.locator('.sidebar-content-container')
|
||||
await comfyPage.page.mouse.click(557, 440)
|
||||
await expect(docPane).not.toContainText('Load Checkpoint')
|
||||
await expect(docPane).toContainText('CLIP Text Encode (Prompt)')
|
||||
await expect(docPane).toContainText('The text to be encoded')
|
||||
await expect(docPane).toContainText(
|
||||
'A conditioning containing the embedded text'
|
||||
)
|
||||
})
|
||||
test.describe('Theming', () => {
|
||||
test.beforeEach(async ({ comfyPage }) => {
|
||||
await comfyPage.setSetting('Comfy.ColorPalette', 'dark')
|
||||
})
|
||||
test.afterEach(async ({ comfyPage }) => {
|
||||
await comfyPage.setSetting('Comfy.ColorPalette', 'dark')
|
||||
})
|
||||
test('Responds to a change in theme', async ({ comfyPage }) => {
|
||||
await comfyPage.loadWorkflow('default')
|
||||
await comfyPage.page.locator('.documentationSidebar-tab-button').click()
|
||||
const docPane = comfyPage.page.locator('.sidebar-content-container')
|
||||
await comfyPage.setSetting('Comfy.ColorPalette', 'light')
|
||||
await expect(docPane).toHaveScreenshot(
|
||||
'documentation-sidebar-light-theme.png'
|
||||
)
|
||||
})
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user