-
Notifications
You must be signed in to change notification settings - Fork 51
Expand file tree
/
Copy pathregister-basic.lc.test.ts
More file actions
46 lines (42 loc) · 2.36 KB
/
register-basic.lc.test.ts
File metadata and controls
46 lines (42 loc) · 2.36 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
38
39
40
41
42
43
44
45
46
/*
* @forgerock/javascript-sdk
*
* register-basic.lc.test.ts
*
* Copyright (c) 2020 - 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 { v4 } from 'uuid';
import { test, expect } from '@playwright/test';
import { setupAndGo } from '../utilities/setup-and-go';
test.describe('Test basic registration flow', () => {
const un = v4();
const email = `${un}@me.com`;
test(`should register user successfully and then log out`, async ({ page, browserName }) => {
const { messageArray } = await setupAndGo(page, browserName, 'register-basic/', {
un,
email,
});
// Test assertions
expect(messageArray.includes('Prompt from UsernameCallback is Username')).toBe(true);
expect(messageArray.includes('Prompt from PasswordCallback is Password')).toBe(true);
expect(messageArray.includes('Prompt 1: First Name')).toBe(true);
expect(messageArray.includes('Prompt 2: Last Name')).toBe(true);
expect(messageArray.includes('Prompt 3: Email Address')).toBe(true);
expect(messageArray.includes('Prompt 4: Send me special offers and services')).toBe(true);
expect(messageArray.includes('Prompt 5: Send me news and updates')).toBe(true);
// expect(messageArray.includes('Prompt 6: Age')).toBe(true);
expect(messageArray.includes('Prompt 7: Select a security question')).toBe(true);
expect(messageArray.includes(`Predefined Question1: What's your favorite color?`)).toBe(true);
expect(messageArray.includes(`kbCb2 is allowed user defined questions: true`)).toBe(true);
expect(messageArray.includes(`Custom Question from kbCb2: Who was your first pet?`)).toBe(true);
expect(messageArray.includes('Terms version: 0.0')).toBe(true);
expect(
messageArray.includes(
// eslint-disable-next-line
'Terms text: Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.',
),
).toBe(true);
});
});