|
1 | | -import { expect, test } from '@playwright/test'; |
| 1 | +import { test } from '@playwright/test'; |
2 | 2 |
|
3 | 3 | import { appConfigs } from '../presets'; |
4 | 4 | import type { FakeUser } from '../testUtils'; |
@@ -27,23 +27,47 @@ testAgainstRunningApps({ withEnv: [appConfigs.envs.withSessionTasks] })( |
27 | 27 | await app.teardown(); |
28 | 28 | }); |
29 | 29 |
|
30 | | - test('navigate to task on after sign-up', async ({ page, context }) => { |
31 | | - // Performs sign-up |
| 30 | + // test('navigate to task on after sign-up', async ({ page, context }) => { |
| 31 | + // // Performs sign-up |
| 32 | + // const u = createTestUtils({ app, page, context }); |
| 33 | + // await u.po.signUp.goTo(); |
| 34 | + // await u.po.signUp.signUpWithEmailAndPassword({ |
| 35 | + // email: fakeUser.email, |
| 36 | + // password: fakeUser.password, |
| 37 | + // }); |
| 38 | + // await u.po.expect.toBeSignedIn(); |
| 39 | + |
| 40 | + // // Redirects back to tasks when accessing protected route by `auth.protect` |
| 41 | + // await u.page.goToRelative('/page-protected'); |
| 42 | + // expect(u.page.url()).toContain('tasks'); |
| 43 | + |
| 44 | + // // Resolves task |
| 45 | + // const fakeOrganization = Object.assign(u.services.organizations.createFakeOrganization(), { |
| 46 | + // slug: u.services.organizations.createFakeOrganization().slug + '-with-sign-up', |
| 47 | + // }); |
| 48 | + // await u.po.sessionTask.resolveForceOrganizationSelectionTask(fakeOrganization); |
| 49 | + // await u.po.expect.toHaveResolvedTask(); |
| 50 | + |
| 51 | + // // Navigates to after sign-up |
| 52 | + // await u.page.waitForAppUrl('/'); |
| 53 | + // }); |
| 54 | + |
| 55 | + test('with sso, navigate to task on after sign-up', async ({ page, context }) => { |
32 | 56 | const u = createTestUtils({ app, page, context }); |
| 57 | + |
33 | 58 | await u.po.signUp.goTo(); |
34 | | - await u.po.signUp.signUpWithEmailAndPassword({ |
35 | | - email: fakeUser.email, |
36 | | - password: fakeUser.password, |
37 | | - }); |
38 | | - await u.po.expect.toBeSignedIn(); |
| 59 | + await u.page.getByRole('button', { name: 'E2E OAuth Provider' }).click(); |
39 | 60 |
|
40 | | - // Redirects back to tasks when accessing protected route by `auth.protect` |
41 | | - await u.page.goToRelative('/page-protected'); |
42 | | - expect(u.page.url()).toContain('tasks'); |
| 61 | + u.po.signIn.getGoToSignUp(); |
| 62 | + await u.po.signUp.waitForMounted(); |
| 63 | + await u.po.signUp.setIdentifier(fakeUser.email); |
| 64 | + await u.po.signUp.continue(); |
| 65 | + await u.po.signUp.enterTestOtpCode(); |
43 | 66 |
|
44 | 67 | // Resolves task |
| 68 | + await u.po.signIn.waitForMounted(); |
45 | 69 | const fakeOrganization = Object.assign(u.services.organizations.createFakeOrganization(), { |
46 | | - slug: u.services.organizations.createFakeOrganization().slug + '-with-sign-up', |
| 70 | + slug: u.services.organizations.createFakeOrganization().slug + '-with-sign-in-sso', |
47 | 71 | }); |
48 | 72 | await u.po.sessionTask.resolveForceOrganizationSelectionTask(fakeOrganization); |
49 | 73 | await u.po.expect.toHaveResolvedTask(); |
|
0 commit comments