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:
parent
3287c2c232
commit
dd40863ca6
1 changed files with 25 additions and 1 deletions
|
@ -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();
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue