Skip to content

Commit

Permalink
Added playwright tests for default portal selection for admin login u…
Browse files Browse the repository at this point in the history
…se case (#205)
  • Loading branch information
tumms2021389 authored Sep 26, 2023
1 parent 2a5bb17 commit 357845b
Show file tree
Hide file tree
Showing 5 changed files with 105 additions and 158 deletions.
7 changes: 7 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"$schema": "http://json.schemastore.org/prettierrc",
"extends": "@pega/prettier-config",
"printWidth": 150,
"singleQuote": true,
"trailingComma": "none"
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div *ngIf="portalSelectionScreen; else loadPortal" class="portal-load-error">
<div>
<div data-test-id="defaultPortalErrorMessage">
Default portal ( <span class="portal-name">{{ defaultPortalName }}</span> ) for current operator is not compatible with SDK. <br /><br />
Please select one of the portals available to the operator's access group:
</div>
Expand Down
8 changes: 4 additions & 4 deletions src/app/_services/server-config.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Utils } from '../_helpers/utils';
import { endpoints } from '../_services/endpoints';

@Injectable({
providedIn: 'root',
providedIn: 'root'
})
export class ServerConfigService {
PCore: any;
Expand Down Expand Up @@ -130,14 +130,14 @@ export class ServerConfigService {
const arExcludedPortals = serverConfig['excludePortals'];
let headers = {
Authorization: Utils.sdkGetAuthHeader(),
'Content-Type': 'application/json',
'Content-Type': 'application/json'
};

// 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
// a default portal or constellation portal and rather have Constellation JS Engine API just load the default portal
fetch(`${serverUrl}${appAliasPath}${endpoints.API}${endpoints.DATA}/${dataPageName}`, {
fetch(`${serverUrl}${appAliasPath}/${endpoints.API}${endpoints.DATA}/${dataPageName}`, {
method: 'GET',
headers,
headers
})
.then((response) => {
if (response.ok && response.status === 200) {
Expand Down
30 changes: 17 additions & 13 deletions tests/config.js
Original file line number Diff line number Diff line change
@@ -1,28 +1,32 @@
// require('lighthouse/lighthouse-core/config/lr-desktop-config.js');

const config = {
baseUrl: "http://localhost:3500/portal",
baseUrl: 'http://localhost:3500/portal',
apps: {
mediaCo: {
rep: {
username: "rep@mediaco",
password: "pega",
username: 'rep@mediaco',
password: 'pega'
},
manager: {
username: "manager@mediaco",
password: "pega",
username: 'manager@mediaco',
password: 'pega'
},
tech: {
username: "tech@mediaco",
password: "pega",
username: 'tech@mediaco',
password: 'pega'
},
admin: {
username: 'admin@mediaco',
password: 'pega'
}
},
digv2: {
user: {
username: "user.digv2",
password: "pega",
},
},
username: 'user.digv2',
password: 'pega'
}
}
},
testsetting: {
// Enable network throttling(Default is false)
Expand All @@ -43,8 +47,8 @@ const config = {
width: 1920,
height: 1080,
headless: true,
devtools: false,
},
devtools: false
}
};

exports.config = config;
Loading

0 comments on commit 357845b

Please sign in to comment.