diff --git a/playwright/BootTests/Compliance/ComplianceCIS.boot.ts b/playwright/BootTests/Compliance/ComplianceCIS.boot.ts index 8a94a1c362..cab26e357b 100644 --- a/playwright/BootTests/Compliance/ComplianceCIS.boot.ts +++ b/playwright/BootTests/Compliance/ComplianceCIS.boot.ts @@ -51,7 +51,7 @@ test('Compliance step integration test - CIS', async ({ page, cleanup }) => { await test.step('Create a Compliance policy', async () => { await navigateToCompliance(page); await page.getByRole('button', { name: 'Create new policy' }).click(); - await page.getByRole('option', { name: 'RHEL 10' }).click(); + await page.locator('label[for="rhel10-input"]').click(); await expect( page.getByRole('gridcell', { name: 'ANSSI-BP-028 (enhanced)' }).first(), ).toBeVisible(); // Wait for the policy type list to load diff --git a/playwright/BootTests/Compliance/helpers.ts b/playwright/BootTests/Compliance/helpers.ts index 7633daaba6..0b64777eeb 100644 --- a/playwright/BootTests/Compliance/helpers.ts +++ b/playwright/BootTests/Compliance/helpers.ts @@ -197,7 +197,8 @@ export const createCompliancePolicy = async ( }); await expect(createButton).toBeVisible(); await createButton.click(); - await page.getByRole('option', { name: distro }).click(); + const distroId = distro.replace(/\s+/g, '').toLowerCase() + '-input'; + await page.locator(`label[for="${distroId}"]`).click(); // Wait for the policy type list to load before searching await expect(page.getByRole('gridcell').first()).toBeVisible({