Skip to content

Commit fda7774

Browse files
committed
test(settings): fix Previews admin Playwright locators
Match the save toast exactly and query provider enable controls as switches, matching NcCheckboxRadioSwitch. Assisted-by: Grok:grok-4.6 Signed-off-by: Ray Vincent <rayhvincent@gmail.com>
1 parent 725f56b commit fda7774

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

tests/playwright/e2e/settings/admin-settings-previews.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ adminTest.describe('Settings: Previews admin page', () => {
4141
await maxX.fill('2048')
4242
await page.locator('[data-cy="previews-save"]').click()
4343
await handlePasswordConfirmation(page)
44-
await expect(page.getByText('Preview settings saved')).toBeVisible()
44+
await expect(page.getByText('Preview settings saved', { exact: true })).toBeVisible()
4545
await page.reload()
4646
await expect(page.locator('[data-cy="previews-enable"] input')).toBeChecked()
4747
await expect(page.getByRole('spinbutton', { name: 'Maximum preview width (pixels)' })).toHaveValue('2048')
@@ -119,7 +119,7 @@ adminTest.describe('Settings: Previews admin page', () => {
119119
await page.goto('/index.php/settings/admin/previews')
120120
await page.getByRole('heading', { name: 'Providers' }).scrollIntoViewIfNeeded()
121121
const imaginaryRow = page.locator('[data-cy="previews-providers"] .previews-admin__provider').filter({ has: page.locator('code', { hasText: /^OC\\Preview\\Imaginary$/ }) })
122-
const imaginarySwitch = imaginaryRow.getByRole('checkbox')
122+
const imaginarySwitch = imaginaryRow.getByRole('switch')
123123
const requiresUrl = imaginaryRow.locator('[data-cy="previews-provider-availability"]').filter({ hasText: 'Requires Imaginary URL' })
124124
if (await requiresUrl.count()) {
125125
await expect(imaginarySwitch).toBeDisabled()
@@ -130,7 +130,7 @@ adminTest.describe('Settings: Previews admin page', () => {
130130
}
131131

132132
const movieRow = page.locator('[data-cy="previews-providers"] .previews-admin__provider').filter({ has: page.locator('code', { hasText: /^OC\\Preview\\Movie$/ }) })
133-
const movieSwitch = movieRow.getByRole('checkbox')
133+
const movieSwitch = movieRow.getByRole('switch')
134134
const requiresFfmpeg = movieRow.locator('[data-cy="previews-provider-availability"]').filter({ hasText: 'Requires ffmpeg' })
135135
if (await requiresFfmpeg.count()) {
136136
await expect(movieSwitch).toBeDisabled()

0 commit comments

Comments
 (0)