mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-05-04 05:02:17 +00:00
refactor: replace fragile CSS selectors in SidebarTab.ts and SettingDialog.ts
Amp-Thread-ID: https://ampcode.com/threads/T-019c1359-48cc-7676-abc8-2de8c57b52cf Co-authored-by: Amp <amp@ampcode.com>
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import type { Page } from '@playwright/test'
|
||||
|
||||
import type { ComfyPage } from '../ComfyPage'
|
||||
import { TestIds } from '../selectors'
|
||||
|
||||
export class SettingDialog {
|
||||
constructor(
|
||||
@@ -9,12 +10,12 @@ export class SettingDialog {
|
||||
) {}
|
||||
|
||||
get root() {
|
||||
return this.page.locator('div.settings-container')
|
||||
return this.page.getByTestId(TestIds.dialogs.settings)
|
||||
}
|
||||
|
||||
async open() {
|
||||
await this.comfyPage.executeCommand('Comfy.ShowSettingsDialog')
|
||||
await this.page.waitForSelector('div.settings-container')
|
||||
await this.root.waitFor({ state: 'visible' })
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -41,8 +42,9 @@ export class SettingDialog {
|
||||
}
|
||||
|
||||
async goToAboutPanel() {
|
||||
const aboutButton = this.page.locator('li[aria-label="About"]')
|
||||
await aboutButton.click()
|
||||
await this.page.waitForSelector('div.about-container')
|
||||
await this.page.getByTestId('settings-tab-about').click()
|
||||
await this.page
|
||||
.getByTestId(TestIds.dialogs.about)
|
||||
.waitFor({ state: 'visible' })
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user