From a66cd6f3fc70768061e7a32ba8ccf8413218eb7e Mon Sep 17 00:00:00 2001 From: vysk Date: Sat, 4 Jan 2025 15:45:25 +0400 Subject: [PATCH] test: add register strapi-admin test --- .../playwright/strapi-admin-ui-tests.spec.ts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/cms/tests/playwright/strapi-admin-ui-tests.spec.ts b/cms/tests/playwright/strapi-admin-ui-tests.spec.ts index e35bd31..36d895e 100644 --- a/cms/tests/playwright/strapi-admin-ui-tests.spec.ts +++ b/cms/tests/playwright/strapi-admin-ui-tests.spec.ts @@ -15,6 +15,25 @@ test('unauthorized redirect from localhost:1337 to /admin/auth/login', async ({ await expect(page).toHaveURL('http://localhost:1337/admin/auth/login'); }); +test.skip('register admin-user to strapi-admin', async ({ page }) => { + checkTestUserCredentialsExist(); + + await expect(page).toHaveURL('http://localhost:1337/admin/auth/register-admin'); + + // Fill registration-form fields + await page.fill('input[name="firstname"]', 'Adminiy'); + await page.fill('input[name="email"]', TEST_USERS.adminUser.email); + await page.fill('input[name="password"]', TEST_USERS.adminUser.password); + await page.fill('input[name="confirmPassword"]', TEST_USERS.adminUser.password); + await page.click('button[type="submit"]'); + + // Ensure there are no validation errors displayed under the input fields + await expect(page.locator('[data-strapi-field-error="true"]')).toHaveCount(0); + + // Verify redirection to the authorized admin dashboard with the welcome message + await expect(page.locator('//h1')).toHaveText('Welcome 👋'); +}); + test('login to strapi-admin', async ({ page }) => { checkTestUserCredentialsExist();