Skip to content

Commit

Permalink
Mbp 137 - Changes to support multiple envs (#22)
Browse files Browse the repository at this point in the history
* update tests to support multiple envs

update tests to support multiple envs

* update env vars

update env vars

* remove console logs

remove console logs

* increasing waiting times

increasing waiting times

* change functions

* change search id

* add waiting time

* add waiting time2

* add waiting time3

* add waiting time4

* add waiting time5

* add waiting time6

* add waiting time7

* add waiting time8

* add waiting time9

* add waiting time10

* add waiting time11

* add waiting time12

* add waiting time13

* add testspeed pageload

* test only one

* test only one2

* test all

* test all2

* test all3

* test all4

* add scroll function

* add function report

* remove htmlfile

* remove report command

* add timeout to download error test

* add timeout to download error test2

* generate spec report

* generate spec report2

* generate spec report3

* generate spec report4

* fix test

* prepare PR

* fix test2

* update yaml file add env

update yaml file add env
  • Loading branch information
modusemerson authored Jun 15, 2022
1 parent c173c65 commit e26361a
Show file tree
Hide file tree
Showing 7 changed files with 434 additions and 232 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ui-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@ jobs:
- name: Run tests
working-directory: ui-tests/tests
run: |-
PM4ML_ENDPOINT="http://localhost:8081" SIM_CORE_CONNECTOR_ENDPOINT="http://localhost:3003" npm run test:headless
ENV="local" PM4ML_ENDPOINT="http://localhost:8081" SIM_CORE_CONNECTOR_ENDPOINT="http://localhost:3003" npm run test:headless
Binary file not shown.
143 changes: 0 additions & 143 deletions ui-tests/tests/report.html

This file was deleted.

52 changes: 47 additions & 5 deletions ui-tests/tests/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,26 @@
import * as dotenv from 'dotenv';
import * as assert from 'assert';

dotenv.config();
//dotenv.config();

function ensureEnv(e: string): string {
const result = process.env[e];
assert.notStrictEqual(typeof result, 'undefined', `Required ${e} to be set in the environment`);
return result as string;
}

let tmpConfig;
// TODO: ajv
export const config = {
pm4mlEndpoint: ensureEnv('PM4ML_ENDPOINT'),
simCoreConnectorEndpoint: ensureEnv('SIM_CORE_CONNECTOR_ENDPOINT'),
if (process.env.ENV === "local"){
tmpConfig = {
//pm4mlEndpoint: ensureEnv('PM4ML_ENDPOINT'),
//simCoreConnectorEndpoint: ensureEnv('SIM_CORE_CONNECTOR_ENDPOINT'),
pm4mlEndpoint: "http://localhost:8081",
simCoreConnectorEndpoint: "http://localhost:3003",
senderpartyID:"22507008181" ,
receiverpartyID:"22556999125",
simcurrency: "USD",

credentials: {
test: {
username: 'test',
Expand All @@ -41,5 +49,39 @@ export const config = {
password: 'test',
},
},
voodooTimeoutMs: 30000,
voodooTimeoutMs: 30000
};

}else if(process.env.ENV === "other"){
tmpConfig = {
// pm4mlEndpoint: "https://portal.pm4mlsenderfsp.productdevk3s.dev.product.mbox-dev.io",
// simCoreConnectorEndpoint: "http://test.pm4mlsenderfsp.productdevk3s.dev.product.mbox-dev.io/cc-send",
pm4mlEndpoint: ensureEnv('PM4ML_ENDPOINT'),
simCoreConnectorEndpoint: ensureEnv('SIM_CORE_CONNECTOR_ENDPOINT'),
senderpartyID:"25644444444" ,
receiverpartyID:"25633333333",
simcurrency: "USD",
credentials: {
test: {
username: 'test',
password: 'test',
},
nofirstlastname: {
username: 'nofirstlastname',
password: 'test',
},
nofirstname: {
username: 'nofirstname',
password: 'test',
},
nolastname: {
username: 'nolastname',
password: 'test',
},
},
voodooTimeoutMs: 30000
};

}
const config = Object.assign({}, tmpConfig);
export { config };
6 changes: 3 additions & 3 deletions ui-tests/tests/src/page-objects/pages/LoginPage.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Selector } from "testcafe";

export const LoginPage = {
usernameField: Selector('#username'),
passwordField: Selector('#password'),
loginButton: Selector('.pf-c-button'),
usernameField: Selector('#username', { timeout: 25000 }),
passwordField: Selector('#password', { timeout: 25000 }),
loginButton: Selector('.pf-c-button', { timeout: 25000 }),
};
22 changes: 16 additions & 6 deletions ui-tests/tests/src/page-objects/pages/TransferDashboardPage.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Selector } from "testcafe";


export type Error = {
id: string,
direction: string,
Expand Down Expand Up @@ -27,6 +28,7 @@ export type Transfer = {
institution: string,
date: string,
senderIdType: string,
senderIdSubValue: string,
senderIdValue: string,
recipientIdType: string,
recipientIdValue: string,
Expand Down Expand Up @@ -60,7 +62,8 @@ export const TransferDashboardPage = {
DateFilterLabel: Selector('div').withText('Date'),

findATransferButton: Selector('.mb-input').withText('Find a Transfer'),
downloadErrorsButton: Selector('.transfers__errors__download__button'),
downloadErrorsButton: Selector('div.transfers__errors__section').nth(1).child('button').withAttribute('label','Download Errors'),// Selector('.transfers__errors__download__button'),

// viewAllErrorsButton: Selector('.transfers__errors__button'),

//Find a Transfer Popup window Page Objects
Expand All @@ -72,8 +75,8 @@ export const TransferDashboardPage = {
.withText(`Find a Transfer`)
.parent().parent('.el-modal__container'),

findATransferModalBasicFindTransferTab: Selector('.el-tabs__tab-item').withText('Basic Find a Transfer'),
findATransferModalAdvancedFiltering: Selector('.el-tabs__tab-item').withText('Advanced Filtering'),
findATransferModalBasicFindTransferTab: Selector('.el-tabs__tab-items').child(0),//.withText('Basic Find a Transfer'),XPathSelector('//input[@type="checkbox"]').nth(1);
findATransferModalAdvancedFiltering: Selector('.el-tabs__tab-items').child('div').withText('Advanced Filtering'),
backtoFilteringSubmitButton: Selector('span.input-button__label').withText('Back to filtering'),
ftPopupCloseButton: Selector('span.input-button__label').nth(3),
findATransferModalTransferDownloadTransfersButton: Selector('.mb-input').withText('Download Transfers'),
Expand All @@ -89,8 +92,8 @@ export const TransferDashboardPage = {
findATransferModalAliasSubValueField: Selector('.find-transfer-modal__aliasSubValue input'),
findATransferModalInstitutionField: Selector('.find-transfer-modal__institution input'),
findATransferModalTransferStatusField: Selector('.find-transfer-modal__transfer-status input'),
findATransferModalSubmit: Selector('.el-modal__submit'),
findATransferModalCloseButton: Selector('.input-button__content').withText('Close'),
findATransferModalSubmit: Selector('button').withAttribute('label', 'Find Transfers'), //Selector('div.el-modal__footer-right').child(1),Selector('.el-modal__submit'),
findATransferModalCloseButton: Selector('.input-button__content').child('span').withText('Close'),

//Find a Transfer results Page objects
noresults: Selector('span').withText('No items'),
Expand Down Expand Up @@ -279,9 +282,16 @@ export const TransferDashboardPage = {
transferDetailsModalTechnicalDetailsDirection: Selector('#transfer-details-basic-modal__direction'),

async getTransferRowById(innerText: string): Promise<Selector> {
return Selector('.transfers__transfers__list .el-datalist__row').withText(innerText);
return Selector('.transfers__transfers__list .el-datalist__row').withText(innerText.substring(0, 22));
},

async getFirstTransferRow(): Promise<Selector> {
return Selector('.transfers__transfers__list .el-datalist__row').nth(0);
},

async getTransferByAmount(innerText: string): Promise<Selector> {
return Selector('.transfers__transfers__list .el-datalist__item-cell').child("div").withText(innerText);
},
async getFindATransferRows(): Promise<TransferRow[]> {
const rows = Selector('.transfers__transfers__list .el-datalist__row');
const length = await rows.count;
Expand Down
Loading

0 comments on commit e26361a

Please sign in to comment.