From d7890a6019bc0421c40d190ab11269d9b29d19bd Mon Sep 17 00:00:00 2001 From: Andy Scherzinger Date: Tue, 8 Sep 2026 08:20:46 +0200 Subject: [PATCH] fix(tests): toggle link providers by their switch role createTextLinkColumn() looked the "Allowed types" provider toggles up with getByRole('checkbox'), but they expose the switch role, so the locator matched nothing and setCheckboxState() returned without toggling. Every pre-activated provider stayed enabled, so a URL only column rendered the provider NcSelect instead of the plain text field and the value typed by the test was never committed, leaving the row without it. The toggles are now addressed by their switch role and the requested provider is asserted to exist, so a future role change fails the test instead of silently disabling the column setup. Assisted-by: ClaudeCode:claude-opus-5 Claude-Session: https://claude.ai/code/session_015aqLZ5g2YsrewxS9UQcuwJ Signed-off-by: Andy Scherzinger --- playwright/support/commands.ts | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/playwright/support/commands.ts b/playwright/support/commands.ts index ab4351d81f..48a2c29727 100644 --- a/playwright/support/commands.ts +++ b/playwright/support/commands.ts @@ -605,22 +605,22 @@ export async function createTextLinkColumn( .click() await expect(page.getByText('Allowed types')).toBeVisible() - await setCheckboxState( - page.getByRole('checkbox', { name: /^URL$/i }), - false, - ) - await setCheckboxState( - page.getByRole('checkbox', { name: /^Files$/i }), - false, - ) + const providerSwitches = page.locator('.typeSelection').getByRole('switch') + await expect(providerSwitches.first()).toBeVisible() + + const providerCount = await providerSwitches.count() + for (let index = 0; index < providerCount; index++) { + await setCheckboxState(providerSwitches.nth(index), false) + } for (const provider of ressourceProvider) { - await setCheckboxState( - page.getByRole('checkbox', { + const providerSwitch = page + .locator('.typeSelection') + .getByRole('switch', { name: new RegExp(`^${escapeRegExp(provider)}$`, 'i'), - }), - true, - ) + }) + await expect(providerSwitch).toHaveCount(1) + await setCheckboxState(providerSwitch, true) } await page .locator('.modal-container button')