-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathlogin.test.ts
More file actions
37 lines (29 loc) · 1.17 KB
/
login.test.ts
File metadata and controls
37 lines (29 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/*
* Copyright (c) 2025 Ping Identity Corporation. All rights reserved.
*
* This software may be modified and distributed under the terms
* of the MIT license. See the LICENSE file for details.
*/
import { expect, test } from '@forgerock/e2e-shared/coverage-fixture';
import { asyncEvents } from './utils/async-events.js';
import { password, username } from './utils/demo-user.js';
test('Test happy paths on test page', async ({ page }) => {
const { clickButton, navigate } = asyncEvents(page);
await navigate('/?journey=Login');
const messageArray: string[] = [];
// Listen for events on page
page.on('console', async (msg) => {
messageArray.push(msg.text());
return Promise.resolve(true);
});
// Perform basic login
await page.getByLabel('User Name').fill(username);
await page.getByLabel('Password').fill(password);
await clickButton('Submit', '/authenticate');
await expect(page.getByText('Complete')).toBeVisible();
// Perform logout
await clickButton('Logout', '/authenticate');
// Test assertions
expect(messageArray.includes('Journey completed successfully')).toBe(true);
expect(messageArray.includes('Logout successful')).toBe(true);
});