diff --git a/tests/govtool-frontend/playwright/tests/3-drep-registration/dRepRegistration.loggedin.spec.ts b/tests/govtool-frontend/playwright/tests/3-drep-registration/dRepRegistration.loggedin.spec.ts index a3da2b512..750b940ef 100644 --- a/tests/govtool-frontend/playwright/tests/3-drep-registration/dRepRegistration.loggedin.spec.ts +++ b/tests/govtool-frontend/playwright/tests/3-drep-registration/dRepRegistration.loggedin.spec.ts @@ -156,8 +156,16 @@ test.describe("Validation of dRep Registration Form", () => { await dRepRegistrationPage.registerBtn.click(); for (let i = 0; i < 100; i++) { - await dRepRegistrationPage.metadataUrlInput.fill(mockInvalid.url()); - await expect(page.getByTestId("invalid-url-error")).toBeVisible(); + const invalidUrl = mockInvalid.url(); + + await dRepRegistrationPage.metadataUrlInput.fill(invalidUrl); + if (invalidUrl.length < 128) { + await expect(page.getByTestId("invalid-url-error")).toBeVisible(); + } else { + await expect( + page.getByTestId("url-must-be-less-than-128-bytes-error") + ).toBeVisible(); + } } const sentenceWithoutSpace = faker.lorem diff --git a/tests/govtool-frontend/playwright/tests/3-drep-registration/editDRep.dRep.spec.ts b/tests/govtool-frontend/playwright/tests/3-drep-registration/editDRep.dRep.spec.ts index a2500d29b..cc41eb822 100644 --- a/tests/govtool-frontend/playwright/tests/3-drep-registration/editDRep.dRep.spec.ts +++ b/tests/govtool-frontend/playwright/tests/3-drep-registration/editDRep.dRep.spec.ts @@ -127,8 +127,15 @@ test.describe("Validation of edit dRep Form", () => { await editDRepPage.registerBtn.click(); for (let i = 0; i < 100; i++) { - await editDRepPage.metadataUrlInput.fill(mockInvalid.url()); - await expect(page.getByTestId("invalid-url-error")).toBeVisible(); + const invalidUrl = mockInvalid.url(); + await editDRepPage.metadataUrlInput.fill(invalidUrl); + if (invalidUrl.length < 128) { + await expect(page.getByTestId("invalid-url-error")).toBeVisible(); + } else { + await expect( + page.getByTestId("url-must-be-less-than-128-bytes-error") + ).toBeVisible(); + } } const sentenceWithoutSpace = faker.lorem