Skip to content

Commit

Permalink
test: add register strapi-admin test
Browse files Browse the repository at this point in the history
  • Loading branch information
vtshly committed Jan 4, 2025
1 parent 41bd3d3 commit a66cd6f
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions cms/tests/playwright/strapi-admin-ui-tests.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down

0 comments on commit a66cd6f

Please sign in to comment.