Skip to content

Commit 357845b

Browse files
authored
Added playwright tests for default portal selection for admin login use case (#205)
1 parent 2a5bb17 commit 357845b

File tree

5 files changed

+105
-158
lines changed

5 files changed

+105
-158
lines changed

.prettierrc.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"$schema": "http://json.schemastore.org/prettierrc",
3+
"extends": "@pega/prettier-config",
4+
"printWidth": 150,
5+
"singleQuote": true,
6+
"trailingComma": "none"
7+
}

src/app/_samples/full-portal/top-app-mashup/top-app-mashup.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<div *ngIf="portalSelectionScreen; else loadPortal" class="portal-load-error">
2-
<div>
2+
<div data-test-id="defaultPortalErrorMessage">
33
Default portal ( <span class="portal-name">{{ defaultPortalName }}</span> ) for current operator is not compatible with SDK. <br /><br />
44
Please select one of the portals available to the operator's access group:
55
</div>

src/app/_services/server-config.service.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { Utils } from '../_helpers/utils';
33
import { endpoints } from '../_services/endpoints';
44

55
@Injectable({
6-
providedIn: 'root',
6+
providedIn: 'root'
77
})
88
export class ServerConfigService {
99
PCore: any;
@@ -130,14 +130,14 @@ export class ServerConfigService {
130130
const arExcludedPortals = serverConfig['excludePortals'];
131131
let headers = {
132132
Authorization: Utils.sdkGetAuthHeader(),
133-
'Content-Type': 'application/json',
133+
'Content-Type': 'application/json'
134134
};
135135

136136
// Using v1 API here as v2 data_views is not able to access same data page currently. Should move to avoid having this logic to find
137137
// a default portal or constellation portal and rather have Constellation JS Engine API just load the default portal
138-
fetch(`${serverUrl}${appAliasPath}${endpoints.API}${endpoints.DATA}/${dataPageName}`, {
138+
fetch(`${serverUrl}${appAliasPath}/${endpoints.API}${endpoints.DATA}/${dataPageName}`, {
139139
method: 'GET',
140-
headers,
140+
headers
141141
})
142142
.then((response) => {
143143
if (response.ok && response.status === 200) {

tests/config.js

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,32 @@
11
// require('lighthouse/lighthouse-core/config/lr-desktop-config.js');
22

33
const config = {
4-
baseUrl: "http://localhost:3500/portal",
4+
baseUrl: 'http://localhost:3500/portal',
55
apps: {
66
mediaCo: {
77
rep: {
8-
username: "rep@mediaco",
9-
password: "pega",
8+
username: 'rep@mediaco',
9+
password: 'pega'
1010
},
1111
manager: {
12-
username: "manager@mediaco",
13-
password: "pega",
12+
username: 'manager@mediaco',
13+
password: 'pega'
1414
},
1515
tech: {
16-
username: "tech@mediaco",
17-
password: "pega",
16+
username: 'tech@mediaco',
17+
password: 'pega'
1818
},
19+
admin: {
20+
username: 'admin@mediaco',
21+
password: 'pega'
22+
}
1923
},
2024
digv2: {
2125
user: {
22-
username: "user.digv2",
23-
password: "pega",
24-
},
25-
},
26+
username: 'user.digv2',
27+
password: 'pega'
28+
}
29+
}
2630
},
2731
testsetting: {
2832
// Enable network throttling(Default is false)
@@ -43,8 +47,8 @@ const config = {
4347
width: 1920,
4448
height: 1080,
4549
headless: true,
46-
devtools: false,
47-
},
50+
devtools: false
51+
}
4852
};
4953

5054
exports.config = config;

0 commit comments

Comments
 (0)