Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Share a Case Scotland Automation #221

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions test/e2e/codecept.conf.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const { setCommonPlugins } = require('@codeceptjs/configure');
//const manageorgPage = require('../pages/manageorg/index.js.js.js');
//const manageorgPage = require('../pages/manageOrg.pages.js/index.js.js.js');

const testConfig = require('./config.js');

Expand Down Expand Up @@ -44,7 +44,8 @@ exports.config = {
applicationsTabsPages: '../pages/applicationsTabs.pages.js',
sendNotificationPages: '../pages/sendNotification.pages.js',
legalRepNOCPages: '../pages/legalRep.pages.js',
respondentRepresentativePage: '../pages/respondentRepresentative.pages.js'
respondentRepresentativePage: '../pages/respondentRepresentative.pages.js',
manageOrgPage: '../pages/manageOrg.pages.js',
},
bootstrap: null,
mocha: {
Expand Down
17 changes: 10 additions & 7 deletions test/e2e/config.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
module.exports = {
TestUrl: process.env.TEST_URL || 'https://et-sya.aat.platform.hmcts.net',
TestUrlForManageCaseAAT: process.env.TEST_MANAGE_CASE_URL || 'https://manage-case.aat.platform.hmcts.net',
TestShowBrowserWindow: process.env.SHOW_BROWSER_WINDOW || false,
TestUrlForManageOrgAAT: process.env.TEST_MANAGE_ORG_URL || 'https://manage-org.aat.platform.hmcts.net',
TestShowBrowserWindow: process.env.SHOW_BROWSER_WINDOW || true,
TestsPathToRun: process.env.E2E_TEST_PATH || './**/*.js',
TestReportFolder: process.env.E2E_OUTPUT_DIR || './functional-output/reports',
TestEnvETUser: process.env.TEST_CASE_USERNAME || '',
TestEnvETPassword: process.env.TEST_CASE_PASSWORD || '',
TestEnvETManageCaseUser: process.env.ET_CASEWORKER_USER_NAME || '',
TestEnvETManageCasePassword: process.env.ET_CASEWORKER_PASSWORD || '',
TestEnvETLegalRepUser: process.env.TEST_LEGAL_REP_USERNAME || '',
TestEnvETLegalRepPassword: process.env.TEST_LEGAL_REP_PASSWORD || '',
TestEnvETUser: process.env.TEST_CASE_USERNAME || '[email protected]',
TestEnvETPassword: process.env.TEST_CASE_PASSWORD || 'Nagoya0102',
TestEnvETManageCaseUser: process.env.ET_CASEWORKER_USER_NAME || '[email protected]',
TestEnvETManageCasePassword: process.env.ET_CASEWORKER_PASSWORD || 'h8$w%vWk',
TestEnvETLegalRepUser: process.env.TEST_LEGAL_REP_USERNAME || '[email protected]',
TestEnvETLegalRepPassword: process.env.TEST_LEGAL_REP_PASSWORD || 'Nagoya0102',
TestEnvETSuperUserUsername: process.env.TEST_MANAGE_ORG_SUPER_USERNAME || '[email protected]',
TestEnvETSuperUserPassword: process.env.TEST_MANAGE_ORG_SUPER_PASSWORD || 'Nagoya0102',
};
22 changes: 15 additions & 7 deletions test/e2e/scenario/ETCaseSubmission-Scotland.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ Scenario(
citizenHubPages,
caseOverviewPage,
respondentRepresentativePage,

}) => {
I.amOnPage('/');
await basePage.processPreLoginPagesForTheDraftApplication(postcode);
Expand All @@ -40,10 +39,10 @@ Scenario(
//I.click('Sign out');
I.amOnPage(testConfig.TestUrlForManageCaseAAT);
await loginPage.processLogin(testConfig.TestEnvETManageCaseUser, testConfig.TestEnvETManageCasePassword);
await caseListPage.searchCaseApplicationWithSubmissionReference('Scotland - Singles', submissionReference);
await caseListPage.searchCaseApplicationWithSubmissionReference('Scotland - Singles (RET)', submissionReference);
console.log('The value of the Case Number ' + submissionReference);
let caseNumber = await caseListPage.processCaseFromCaseList(submissionReference);
//vet the case
//vet the case
await caseListPage.verifyCaseDetailsPage();
await caseListPage.selectNextEvent('1: Object'); //Firing the ET1 Event.
await et1CaseVettingPages.processET1CaseVettingPages(caseNumber);
Expand All @@ -52,7 +51,7 @@ Scenario(
await et1CaseServingPages.processET1CaseServingPages(caseNumber);
// add org to case to enable cui applications
await caseListPage.selectNextEvent('6: Object'); //Case acceptance or rejection Event
await respondentRepresentativePage.addRespondentRepresentative('registered')
await respondentRepresentativePage.addRespondentRepresentative('registered');
I.click('Sign out');
await citizenHubPages.processCitizenHubLogin(
testConfig.TestEnvETUser,
Expand All @@ -67,8 +66,17 @@ Scenario(
// record a decision by JCM
I.amOnPage(testConfig.TestUrlForManageCaseAAT);
await loginPage.processLogin(testConfig.TestEnvETManageCaseUser, testConfig.TestEnvETManageCasePassword);
await caseListPage.searchCaseApplicationWithSubmissionReference('Scotland - Singles', submissionReference);
await caseListPage.searchCaseApplicationWithSubmissionReference('Scotland - Singles (RET)', submissionReference);
await caseListPage.processCaseFromCaseList(submissionReference);
await caseOverviewPage.recordAdecisionOnAcase(submissionReference,'1 - Withdraw all/part of claim','granted','cmo-responding','legal officer','both')
await caseOverviewPage.recordAdecisionOnAcase(
submissionReference,
'1 - Withdraw all/part of claim',
'granted',
'cmo-responding',
'legal officer',
'both',
);
},
).tag('@RET-BAT').retry(1);
)
.tag('@RET-BAT')
.retry(1);
91 changes: 71 additions & 20 deletions test/e2e/scenario/Manage-OrgTest.js
Original file line number Diff line number Diff line change
@@ -1,27 +1,78 @@
//const manageorgPage = require('../../pages/manageorg/index.js.js.js');
//const manageorgPage = require('../../pages/manageOrg.pages.js/index.js.js.js');
//Get case accepted
const testConfig = require('../config.js');
const postcode = 'FK15 9ET';
const addressOption = '3e, Station Road, Dunblane, FK15 9ET';
const workPostcode = 'EH45 9BU';
const selectedWorkAddress = 'Unit 4, Cherry Court, Cavalry Park, Peebles, EH45 9BU';
const firstLineOfAddress = 'Unit 4, Cherry Court, Cavalry Park';

testConfig = require('../config.js');
postcode = 'LS9 9HE';
workPostcode = 'LS7 4QE';
selectedWorkAddress = '7, Valley Gardens, Leeds, LS7 4QE';
addressOption = '3, Skelton Avenue, Leeds, LS9 9HE';
firstLineOfAddress = '7, Valley Gardens?';


Feature('End to End Tests for Manage Organisation for Assigning and Non Assigning Cases');
Feature('End To End; Share a Case Scotland');
Scenario(
'Verify Assigned Cases for England and Wales',
'Assign a Scottish Case through Manage Org',
async ({
I,
manageOrgPage,
basePage,
loginPage,
}) => {
I.amOnPage(testConfig.TestUrlForManageOrg);
await loginPage.processLogin(testConfig.TestEnvETManageOrgSuperUserName, testConfig.TestEnvETManageOrgSuperPassword);
await manageOrgPage.assignCaseToSolicitor();
await manageorgPage.unassignCaseFromSolicitor();
taskListPage,
personalDetailsPage,
employmentAndRespondentDetailsPage,
claimDetailsPage,
submitClaimPage,
caseListPage,
et1CaseVettingPages,
et1CaseServingPages,
caseOverviewPage,
respondentRepresentativePage,
manageOrgPage,

}) => {
I.amOnPage('/');
await basePage.processPreLoginPagesForTheDraftApplication(postcode);
await loginPage.processLogin(testConfig.TestEnvETUser, testConfig.TestEnvETPassword);
await taskListPage.processPostLoginPagesForTheDraftApplication();
await personalDetailsPage.processPersonalDetails(postcode, 'Scotland', addressOption);
await employmentAndRespondentDetailsPage.processStillWorkingJourney(
workPostcode,
selectedWorkAddress,
firstLineOfAddress,
);
await claimDetailsPage.processClaimDetails();
const submissionReference = await submitClaimPage.submitClaim();
//I.click('Sign out');
I.amOnPage(testConfig.TestUrlForManageCaseAAT);
await loginPage.processLogin(testConfig.TestEnvETManageCaseUser, testConfig.TestEnvETManageCasePassword);
await caseListPage.searchCaseApplicationWithSubmissionReference('Scotland - Singles', submissionReference);
console.log('The value of the Case Number ' + submissionReference);
let caseNumber = await caseListPage.processCaseFromCaseList(submissionReference);
//vet the case
await caseListPage.verifyCaseDetailsPage();
await caseListPage.selectNextEvent('1: Object'); //Firing the ET1 Event.
await et1CaseVettingPages.processET1CaseVettingPages(caseNumber);
//accept the case
await caseListPage.selectNextEvent('2: Object'); //Case acceptance or rejection Event
await et1CaseServingPages.processET1CaseServingPages(caseNumber);
// add org to case to enable cui applications
await caseListPage.selectNextEvent('6: Object'); //Case acceptance or rejection Event
await respondentRepresentativePage.addRespondentRepresentative('registered', 'ET QA Test Solicitor');
I.click('Sign out');
//Share A Case Journey Through Manage Org
I.amOnPage(testConfig.TestUrlForManageOrgAAT);
await loginPage.processLogin(testConfig.TestEnvETSuperUserUsername, testConfig.TestEnvETSuperUserPassword);
await manageOrgPage.searchForUnassignedCaseUsingFilter(submissionReference);
await // record a decision by JCM
I.amOnPage(testConfig.TestUrlForManageCaseAAT);
await loginPage.processLogin(testConfig.TestEnvETManageCaseUser, testConfig.TestEnvETManageCasePassword);
await caseListPage.searchCaseApplicationWithSubmissionReference('Scotland - Singles', submissionReference);
await caseListPage.processCaseFromCaseList(submissionReference);
await caseOverviewPage.recordAdecisionOnAcase(
submissionReference,
'1 - Withdraw all/part of claim',
'granted',
'cmo-responding',
'legal officer',
'both',
);
},
)
.tag('@RET-ETSC')
.retry(2);
).tag('@RET-SC');
//.retry(1);
29 changes: 14 additions & 15 deletions test/pages/caselist.page.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ module.exports = {
submitEventButton: '[type="submit"]',
tab: '[role="tab"] div:contains("Applications")',


searchCaseApplication(option) {
I.waitForElement(this.caseTypeDropdown, 30);
I.see(this.caseListText);
Expand All @@ -41,18 +40,19 @@ module.exports = {
try {
switch (option) {
case 'Eng/Wales - Singles':
I.selectOption(this.caseTypeDropdown, '2: Object');
I.selectOption(this.caseTypeDropdown, 'Eng/Wales - Singles');
break;
case 'Scotland - Singles':
I.selectOption(this.caseTypeDropdown, '5: Object');
I.selectOption(this.caseTypeDropdown, 'Scotland - Singles (RET)');
I.wait(3);
break;
default:
throw new Error('... check you options or add new option');
}
} catch (error) {
console.error('invalid option', error.message);
}
I.selectOption(this.caseTypeDropdown, option);
//I.selectOption(this.caseTypeDropdown, option);
I.scrollPageToBottom();
I.waitForVisible(this.submissionReferenceLocator, 10);
I.click(this.submissionReferenceLocator);
Expand All @@ -79,18 +79,17 @@ module.exports = {
I.forceClick(this.submitEventButton);
},

selectTab(title){
I.wait(5);
I.waitForClickable(`//div[@role='tab']/div[contains(text(), '${title}')]`, 30);
I.forceClick(`//div[@role='tab']/div[contains(text(), '${title}')]`);
selectTab(title) {
I.wait(5);
I.waitForClickable(`//div[@role='tab']/div[contains(text(), '${title}')]`, 30);
I.forceClick(`//div[@role='tab']/div[contains(text(), '${title}')]`);
},

navigateToMakeAnApplication(submissionReference) {
let makeAnApplicationLink = `/cases/case-details/${submissionReference}/trigger/respondentTSE/respondentTSE1`;
I.wait(10);
pause();
I.forceClick(`[href="${makeAnApplicationLink}"]`);
},
navigateToMakeAnApplication(submissionReference) {
let makeAnApplicationLink = `/cases/case-details/${submissionReference}/trigger/respondentTSE/respondentTSE1`;
I.wait(10);
I.forceClick(`[href="${makeAnApplicationLink}"]`);
},

verifyCaseDetailsPage(et1VettingFlag = false) {
I.waitForElement('[tabindex="0"]', 30);
Expand All @@ -104,4 +103,4 @@ module.exports = {
I.see('ET1Vetting');
}
},
};
};
Loading