0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2025-01-06 20:40:08 -05:00

test: add ui cloud tests

This commit is contained in:
Gao Sun 2023-03-07 21:51:37 +08:00
parent 3287c2c232
commit dd40863ca6
No known key found for this signature in database
GPG key ID: 13EBE123E4773688

View file

@ -65,7 +65,7 @@ describe('smoke testing for cloud', () => {
// Wait for our beautiful logto to show up
await page.waitForSelector('div[class$=topbar] > svg[viewbox][class$=logo]');
expect(page.url()).toBe(new URL(`/${tenantId ?? ''}/onboard/welcome`, logtoCloudUrl).href);
expect(page.url()).toBe(new URL(`/${tenantId ?? ''}/onboarding/welcome`, logtoCloudUrl).href);
});
it('can sign out of admin console', async () => {
@ -81,4 +81,28 @@ describe('smoke testing for cloud', () => {
expect(page.url()).toBe(new URL('sign-in', logtoConsoleUrl).href);
});
it('can create another account', async () => {
const newUsername = 'another_admin';
const newPassword = generatePassword();
await expect(page).toClick('a', { text: 'Create account' });
await expect(page).toMatchElement('button', { text: 'Create account' });
await expect(page).toFill('input[name=identifier]', newUsername);
await expect(page).toClick('button[name=submit]');
await page.waitForNavigation({ waitUntil: 'networkidle0' });
expect(page.url()).toBe(new URL('/register/password', logtoConsoleUrl).href);
await expect(page).toFillForm('form', {
newPassword,
confirmPassword: newPassword,
});
await expect(page).toClick('button[name=submit]');
await page.waitForNavigation({ waitUntil: 'networkidle0' });
expect(page.url().startsWith(logtoCloudUrl.href)).toBeTruthy();
expect(new URL(page.url()).pathname.endsWith('/onboarding/welcome')).toBeTruthy();
});
});