Skip to content

Commit 23edbd2

Browse files
committed
CCM-10424 Revert change to add login function
1 parent be80d59 commit 23edbd2

File tree

2 files changed

+22
-6
lines changed

2 files changed

+22
-6
lines changed

tests/test-team/config/component/component.setup.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
import path from 'node:path';
66
import { test as setup } from '@playwright/test';
77
import { BackendConfigHelper } from 'nhs-notify-web-template-management-util-backend-config';
8+
import { TemplateMgmtSignInPage } from '../../pages/templates-mgmt-login-page';
89
import {
910
createAuthHelper,
1011
testUsers,
1112
} from '../../helpers/auth/cognito-auth-helper';
12-
import { loginAsUser } from '../../helpers/auth/login-as-user';
1313

1414
setup('component test setup', async ({ page }) => {
1515
const backendConfig = BackendConfigHelper.fromTerraformOutputsFile(
@@ -24,7 +24,11 @@ setup('component test setup', async ({ page }) => {
2424

2525
const user = await auth.getTestUser(testUsers.User1.userId);
2626

27-
await loginAsUser(user, page);
27+
const loginPage = new TemplateMgmtSignInPage(page);
28+
29+
await loginPage.loadPage();
30+
31+
await loginPage.cognitoSignIn(user);
2832

2933
await page.waitForURL('/templates/create-and-submit-templates');
3034

tests/test-team/template-mgmt-component-tests/template-mgmt-logout-warning.component.modal.spec.ts

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {
44
type TestUser,
55
testUsers,
66
} from '../helpers/auth/cognito-auth-helper';
7-
import { loginAsUser } from '../helpers/auth/login-as-user';
7+
import { TemplateMgmtSignInPage } from '../pages/templates-mgmt-login-page';
88

99
test.use({ storageState: { cookies: [], origins: [] } });
1010

@@ -26,7 +26,11 @@ test.describe('Logout warning', () => {
2626
test('logout warning should pop up and close after clicking "Stay signed in"', async ({
2727
page,
2828
}) => {
29-
await loginAsUser(staySignedInUser, page);
29+
const loginPage = new TemplateMgmtSignInPage(page);
30+
31+
await loginPage.loadPage();
32+
33+
await loginPage.cognitoSignIn(staySignedInUser);
3034

3135
const dialog = page.locator('dialog');
3236

@@ -40,7 +44,11 @@ test.describe('Logout warning', () => {
4044
test('logout warning should pop up and close after user clicks "Sign out"', async ({
4145
page,
4246
}) => {
43-
await loginAsUser(manualSignOutUser, page);
47+
const loginPage = new TemplateMgmtSignInPage(page);
48+
49+
await loginPage.loadPage();
50+
51+
await loginPage.cognitoSignIn(manualSignOutUser);
4452

4553
const dialog = page.locator('dialog');
4654

@@ -52,7 +60,11 @@ test.describe('Logout warning', () => {
5260
});
5361

5462
test('logout warning should force logout after timeout', async ({ page }) => {
55-
await loginAsUser(automaticallySignedOutUser, page);
63+
const loginPage = new TemplateMgmtSignInPage(page);
64+
65+
await loginPage.loadPage();
66+
67+
await loginPage.cognitoSignIn(automaticallySignedOutUser);
5668

5769
const dialog = page.locator('dialog');
5870

0 commit comments

Comments
 (0)