Fix gallery changing image every time a task finishes (#2125)

This commit is contained in:
bymyself
2025-01-02 15:51:28 -07:00
committed by GitHub
parent cb607ee070
commit 5c7cbe968e
4 changed files with 116 additions and 8 deletions

View File

@@ -242,4 +242,21 @@ export class QueueSidebarTab extends SidebarTab {
localStorage.setItem('queue', JSON.stringify([width, 100 - width]))
}, width)
}
getTaskPreviewButton(taskIndex: number) {
return this.tasks.nth(taskIndex).getByRole('button')
}
async openTaskPreview(taskIndex: number) {
const previewButton = this.getTaskPreviewButton(taskIndex)
await previewButton.hover()
await previewButton.click()
return this.getGalleryImage(taskIndex).waitFor({ state: 'visible' })
}
getGalleryImage(galleryItemIndex: number) {
// Aria labels of Galleria items are 1-based indices
const galleryLabel = `${galleryItemIndex + 1}`
return this.page.getByLabel(galleryLabel).locator('.galleria-image')
}
}