Skip to content

Commit b241181

Browse files
authored
Merge pull request #304 from ForgeRock/SDKS-3944-protect-e2e
SDKS-3944: Add protect e2e tests
2 parents 1eddb21 + dd0e993 commit b241181

28 files changed

+1211
-40
lines changed

e2e/davinci-suites/package.json

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
{
22
"name": "@forgerock/davinci-suites",
3-
"description": "DaVinci Client E2E Suites",
4-
"private": true,
5-
"type": "module",
63
"version": "0.0.0",
7-
"main": "src/index.js",
8-
"author": "",
9-
"license": "ISC",
10-
"nx": {
11-
"implicitDependencies": ["@forgerock/davinci-app", "@forgerock/mock-api-v2"]
4+
"private": true,
5+
"description": "DaVinci Client E2E Suites",
6+
"homepage": "https://github.com/ForgeRock/ping-javascript-sdk#readme",
7+
"bugs": {
8+
"url": "https://github.com/ForgeRock/ping-javascript-sdk/issues"
129
},
1310
"repository": {
1411
"type": "git",
1512
"url": "git+https://github.com/ForgeRock/ping-javascript-sdk.git"
1613
},
17-
"bugs": {
18-
"url": "https://github.com/ForgeRock/ping-javascript-sdk/issues"
19-
},
20-
"homepage": "https://github.com/ForgeRock/ping-javascript-sdk#readme"
14+
"license": "ISC",
15+
"author": "",
16+
"type": "module",
17+
"main": "src/index.js",
18+
"nx": {
19+
"implicitDependencies": ["@forgerock/davinci-app", "@forgerock/mock-api-v2"]
20+
}
2121
}

e2e/davinci-suites/src/mfa.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ import { expect, test } from '@playwright/test';
88
import { asyncEvents } from './utils/async-events.js';
99
import { password } from './utils/demo-user.js';
1010

11-
test('Using ACR Values, lets render an OTP form and submit the request', async ({ page }) => {
11+
// TODO: This test is currently failing due to an issue with device registration in the flow.
12+
test.skip('Using ACR Values, lets render an OTP form and submit the request', async ({ page }) => {
1213
const { navigate } = asyncEvents(page);
1314
await navigate(
1415
'/?clientId=20dd0ed0-bb9b-4c8f-9a60-9ebeb4b348e0&acr_value=22eb75b5d31d371afe089d6e4a824f5c',

e2e/protect-app/.gitignore

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
pnpm-debug.log*
8+
lerna-debug.log*
9+
10+
node_modules
11+
dist
12+
dist-ssr
13+
*.local
14+
15+
# Editor directories and files
16+
.vscode/*
17+
!.vscode/extensions.json
18+
.idea
19+
.DS_Store
20+
*.suo
21+
*.ntvs*
22+
*.njsproj
23+
*.sln
24+
*.sw?

e2e/protect-app/eslint.config.mjs

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
import baseConfig from '../../eslint.config.mjs';
2+
3+
export default [
4+
{
5+
ignores: [
6+
'node_modules',
7+
'*.md',
8+
'LICENSE',
9+
'.babelrc',
10+
'.env*',
11+
'.bin',
12+
'dist',
13+
'.eslintignore',
14+
'**/*.html',
15+
'*.svg',
16+
'**/*.css',
17+
'public',
18+
'*.json',
19+
'*.d.ts',
20+
'.gitignore',
21+
'tsconfig.tsbuildinfo',
22+
],
23+
},
24+
...baseConfig,
25+
{
26+
files: ['*.ts', '*.tsx', '*.js', '*.jsx'],
27+
rules: {},
28+
},
29+
{
30+
files: ['*.ts', '*.tsx'],
31+
rules: {},
32+
},
33+
{
34+
files: ['*.js', '*.jsx'],
35+
rules: {},
36+
},
37+
];

e2e/protect-app/package.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"name": "@pingidentity/protect-app",
3+
"version": "0.0.0",
4+
"description": "Ping Protect Test Apps",
5+
"private": true,
6+
"type": "module",
7+
"scripts": {
8+
"build": "pnpm nx nxBuild",
9+
"lint": "pnpm nx nxLint",
10+
"preview": "pnpm nx nxPreview",
11+
"serve": "pnpm nx nxServe"
12+
},
13+
"dependencies": {
14+
"@forgerock/javascript-sdk": "4.7.0",
15+
"@pingidentity/protect": "workspace:*"
16+
},
17+
"nx": {
18+
"tags": ["scope:e2e"]
19+
}
20+
}

e2e/protect-app/public/callback.html

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<!doctype html>
2+
<html>
3+
<head>
4+
<title>Logged In</title>
5+
</head>
6+
<body>
7+
<p>Logged In</p>
8+
</body>
9+
</html>

e2e/protect-app/public/typescript.svg

Lines changed: 1 addition & 0 deletions
Loading

e2e/protect-app/public/vite.svg

Lines changed: 1 addition & 0 deletions
Loading

e2e/protect-app/src/index.html

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
6+
<link rel="stylesheet" href="style.css" />
7+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
8+
<title>Vite + TS</title>
9+
</head>
10+
<body>
11+
<div id="app">
12+
<a href="https://vite.dev" target="_blank">
13+
<img src="/vite.svg" class="logo" alt="Vite logo" />
14+
</a>
15+
<a href="https://www.typescriptlang.org/" target="_blank">
16+
<img src="/typescript.svg" class="logo vanilla" alt="TypeScript logo" />
17+
</a>
18+
<h2>Protect Home</h2>
19+
<p class="read-the-docs">Click on the Vite and TypeScript logos to learn more</p>
20+
<a href="/" class="nav">Home</a>
21+
<a href="/protect-native.html" class="nav">Protect Native</a>
22+
<a href="/protect-marketplace.html" class="nav">Protect Marketplace</a>
23+
</div>
24+
</body>
25+
</html>
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<title>Ping Protect Marketplace</title>
8+
</head>
9+
<body>
10+
<div id="app">
11+
<a href="https://vite.dev" target="_blank">
12+
<img src="/vite.svg" class="logo" alt="Vite logo" />
13+
</a>
14+
<a href="https://www.typescriptlang.org/" target="_blank">
15+
<img src="/typescript.svg" class="logo vanilla" alt="TypeScript logo" />
16+
</a>
17+
<h2>Ping Protect Marketplace</h2>
18+
<p class="read-the-docs">Click on the Vite and TypeScript logos to learn more</p>
19+
<a href="/index.html" class="nav">Home</a>
20+
<div id="steps">
21+
<div id="loader" class="active">Loading...</div>
22+
<div id="UsernamePassword">
23+
<input class="form-control" type="text" name="username" placeholder="Username" />
24+
<input class="form-control" type="password" name="password" placeholder="Password" />
25+
<button class="btn btn-primary">Sign In</button>
26+
</div>
27+
<div id="ProtectInit">Protect initializing</div>
28+
<div id="ProtectEval">Protect evaluating</div>
29+
<div id="Metadata">Found metadata callback</div>
30+
<div id="User">
31+
<div>
32+
<p>Your user information:</p>
33+
<pre></pre>
34+
</div>
35+
<button class="btn btn-primary">Sign Out</button>
36+
</div>
37+
<div id="Error">
38+
<p>Error code: <span></span></p>
39+
<p><a id="start-over" href="/">Start over</a></p>
40+
</div>
41+
<div id="Fatal">
42+
<p>Something unexpected happened. Check the console for details.</p>
43+
<p><a id="start-over" href="/">Start over</a></p>
44+
</div>
45+
</div>
46+
</div>
47+
<script type="module" src="protect-marketplace.ts"></script>
48+
</body>
49+
</html>

0 commit comments

Comments
 (0)