From ca850cf43b6d0c6f3ff1550964b0911866946441 Mon Sep 17 00:00:00 2001 From: CourtneySuhr-Solirius Date: Thu, 6 Feb 2025 11:03:16 +0000 Subject: [PATCH 1/3] Multiple Application GA Creation Test --- .../citizenFeatures/GA/pages/checkAndSend.js | 34 +++- .../citizenFeatures/GA/steps/createGASteps.js | 146 ++++++++++++++++++ .../nonprod/LipvLip_GA_creation_tests.js | 4 +- 3 files changed, 178 insertions(+), 6 deletions(-) diff --git a/src/test/functionalTests/citizenFeatures/GA/pages/checkAndSend.js b/src/test/functionalTests/citizenFeatures/GA/pages/checkAndSend.js index 16a9803b27c..9b842bdf04c 100644 --- a/src/test/functionalTests/citizenFeatures/GA/pages/checkAndSend.js +++ b/src/test/functionalTests/citizenFeatures/GA/pages/checkAndSend.js @@ -1,3 +1,4 @@ +/* eslint-disable no-unused-vars */ const ContactUs = require('../../common/contactUs'); const I = actor(); @@ -13,13 +14,17 @@ class CheckAndSend { I.click(nextAction); } - async verifyPageContent(caseNumber, parties, applicationType, communicationType) { + async verifyPageContent(caseNumber, parties, applicationType, communicationType, firstApplicationType = 'none', secondApplicationType = 'none') { this.checkPageFullyLoaded(); this.verifyBreadcrumbs(); this.verifyHeadingDetails(applicationType, caseNumber, parties); - this.applicationType(applicationType); + if (applicationType !== 'Make an application') { + this.applicationType(applicationType); + } else { + this.multipleApplicationType(firstApplicationType, secondApplicationType); + } if (applicationType !== 'Set aside (remove) a judgment' && applicationType !== 'Vary a judgment' && applicationType !== 'Court to make an order settling the claim by consent') { - this.additionalApplication(); + this.additionalApplication(applicationType); } this.partiesAgreed(communicationType); if (communicationType !== 'consent' && applicationType !== 'Set aside (remove) a judgment' && applicationType !== 'Vary a judgment' && applicationType !== 'Court to make an order settling the claim by consent') { @@ -60,10 +65,29 @@ class CheckAndSend { await I.see('Change', applicatonTypeSelector); } - async additionalApplication() { + async multipleApplicationType(firstApplicationType, secondApplicationType) { + const firstSummaryCardTitleSelector = '.govuk-summary-card:first-of-type .govuk-summary-card__title'; + const secondSummaryCardTitleSelector = '.govuk-summary-card:nth-of-type(2) .govuk-summary-card__title'; + const firstSummaryCardFirstRowSelector = '.govuk-summary-card:first-of-type .govuk-summary-list__row:first-of-type'; + const SecondSummaryCardFirstRowSelector = '.govuk-summary-card:nth-of-type(2) .govuk-summary-list__row:first-of-type'; + I.see('Application 1', firstSummaryCardTitleSelector); + I.see('Application type', firstSummaryCardFirstRowSelector); + I.see(firstApplicationType, firstSummaryCardFirstRowSelector); + await I.see('Change', firstSummaryCardFirstRowSelector); + I.see('Application 2', secondSummaryCardTitleSelector); + I.see('Application type', SecondSummaryCardFirstRowSelector); + I.see(secondApplicationType, SecondSummaryCardFirstRowSelector); + await I.see('Change', SecondSummaryCardFirstRowSelector); + } + + async additionalApplication(applicationType) { const applicatonTypeSelector = '//div[@class=\'govuk-summary-list__row\'][contains(., \'Do you want to add another application?\')]'; I.see('Do you want to add another application?', applicatonTypeSelector); - I.see('No', applicatonTypeSelector); + if (applicationType !== 'Make an application') { + I.see('No', applicatonTypeSelector); + } else { + I.see('Yes', applicatonTypeSelector); + } await I.see('Change', applicatonTypeSelector); } diff --git a/src/test/functionalTests/citizenFeatures/GA/steps/createGASteps.js b/src/test/functionalTests/citizenFeatures/GA/steps/createGASteps.js index 9da8f8eaceb..dac94cc6f17 100644 --- a/src/test/functionalTests/citizenFeatures/GA/steps/createGASteps.js +++ b/src/test/functionalTests/citizenFeatures/GA/steps/createGASteps.js @@ -1476,6 +1476,152 @@ class createGASteps { return generalApplicationID; } + + async createMultipleApplications(caseRef, parties, communicationType = 'consent') { + + const caseNumber = StringUtilsComponent.StringUtilsComponent.formatClaimReferenceToAUIDisplayFormat(caseRef); + const firstApplicationType = 'Change a hearing date'; + const secondApplicationType = 'Court to strike out all or part of the other parties\' case without a trial'; + const applicationType = 'Make an application'; + let feeAmount; + + switch(communicationType) { + case 'consent': + feeAmount = '119'; + break; + case 'notice': + feeAmount = '303'; + break; + case 'withoutnotice': + feeAmount = '119'; + break; + } + + // Primary application to Adjourn a hearing + await I.waitForContent('Contact the court to request a change to my case', 60); + await I.click('Contact the court to request a change to my case'); + await I.amOnPage(`case/${caseRef}/general-application/application-type`); + await applicationTypePage.verifyPageContent(); + await applicationTypePage.nextAction('Ask to change a hearing date'); + await applicationTypePage.nextAction('Continue'); + + if (communicationType == 'consent') { + await agreementFromOtherPartyPage.verifyPageContent(firstApplicationType); + await agreementFromOtherPartyPage.nextAction('Yes'); + await agreementFromOtherPartyPage.nextAction('Continue'); + } else { + await agreementFromOtherPartyPage.verifyPageContent(firstApplicationType); + await agreementFromOtherPartyPage.nextAction('No'); + await agreementFromOtherPartyPage.nextAction('Continue'); + if (communicationType == 'notice') { + await informOtherPartiesPage.verifyPageContent(firstApplicationType); + await informOtherPartiesPage.selectAndVerifyDoInformOption(); + } else { + await informOtherPartiesPage.verifyPageContent(firstApplicationType); + await informOtherPartiesPage.selectAndVerifyDontInformOption(); + } + } + + await applicationCostsPage.verifyPageContent(firstApplicationType, feeAmount); + await applicationCostsPage.nextAction('Start now'); + + await claimApplicationCostPage.verifyPageContent(firstApplicationType); + await claimApplicationCostPage.selectAndVerifyYesOption(); + await claimApplicationCostPage.nextAction('Continue'); + + await orderJudgePage.verifyPageContent(firstApplicationType); + await orderJudgePage.fillTextBox('Test order'); + await orderJudgePage.nextAction('Continue'); + + await requestingReasonPage.verifyPageContent(firstApplicationType); + await requestingReasonPage.fillTextBox('Test order'); + await requestingReasonPage.nextAction('Continue'); + + await addAnotherApplicationPage.verifyPageContent(firstApplicationType); + await addAnotherApplicationPage.nextAction('Yes'); + await addAnotherApplicationPage.nextAction('Continue'); + + // Secondary application to Strike out + await I.amOnPage(`case/${caseRef}/general-application/application-type?linkFrom=addAnotherApp`); + await applicationTypePage.verifyPageContent(); + await applicationTypePage.nextAction('Other applications'); + await applicationTypePage.nextAction('Ask the court to strike out all or part of the other parties\' case without a trial'); + await applicationTypePage.nextAction('Continue'); + + await orderJudgePage.verifyPageContent(secondApplicationType); + await orderJudgePage.fillTextBox('Test order'); + await orderJudgePage.nextAction('Continue'); + + await requestingReasonPage.verifyPageContent(secondApplicationType); + await requestingReasonPage.fillTextBox('Test order'); + await requestingReasonPage.nextAction('Continue'); + + await addAnotherApplicationPage.verifyPageContent(secondApplicationType); + await addAnotherApplicationPage.nextAction('No'); + await addAnotherApplicationPage.nextAction('Continue'); + + // Multiple application journey + await wantToUploadDocumentsPage.verifyPageContent(applicationType); + await wantToUploadDocumentsPage.nextAction('No'); + await wantToUploadDocumentsPage.nextAction('Continue'); + + await hearingArrangementsGuidancePage.verifyPageContent(applicationType); + await hearingArrangementsGuidancePage.nextAction('Continue'); + + await hearingArrangementPage.verifyPageContent(applicationType); + await hearingArrangementPage.nextAction('In person at the court'); + await hearingArrangementPage.fillTextAndSelectLocation('In person', config.gaCourtToBeSelected); + await hearingArrangementPage.nextAction('Continue'); + + await hearingContactDetailsPage.verifyPageContent(applicationType); + await hearingContactDetailsPage.fillContactDetails('07555655326', 'test@gmail.com'); + await hearingContactDetailsPage.nextAction('Continue'); + + await unavailableDatesConfirmationPage.verifyPageContent(applicationType); + unavailableDatesConfirmationPage.nextAction('Yes'); + unavailableDatesConfirmationPage.nextAction('Continue'); + + await unavailableDatesPage.verifyPageContent(applicationType); + unavailableDatesPage.fillFields(); + unavailableDatesPage.nextAction('Continue'); + + await hearingSupportPage.verifyPageContent(applicationType); + await hearingSupportPage.nextAction('Continue'); + + await payingForApplicationPage.verifyPageContent(applicationType, feeAmount); + await payingForApplicationPage.nextAction('Continue'); + + await checkAndSendPage.verifyPageContent(caseNumber, parties, applicationType, communicationType, firstApplicationType, secondApplicationType); + await checkAndSendPage.checkAndSign(); + await checkAndSendPage.nextAction('Submit'); + + await submitGAConfirmationPage.verifyPageContent(feeAmount); + await submitGAConfirmationPage.nextAction('Pay application fee'); + + I.wait(2); + + await applyHelpFeeSelectionPage.verifyPageContent(); + await applyHelpFeeSelectionPage.nextAction('No'); + await applyHelpFeeSelectionPage.nextAction('Continue'); + + await govPay.addValidCardDetails(feeAmount); + govPay.confirmPayment(); + + const generalApplicationID = (await I.grabCurrentUrl()).match(/\/general-application\/(\d+)\//)[1]; + + await paymentConfirmationPage.verifyPageContent(); + await paymentConfirmationPage.nextAction('Close and return to dashboard'); + + I.wait(5); + await I.refreshPage(); + await I.waitForClickable('View Applications', 5); + await I.click('.govuk-link >> text=View Applications'); + await I.amOnPage(`/case/${caseRef}/general-application/summary`); + await I.see('Adjourn a hearing, Strike out'); + await I.see('Awaiting Respondent Response'); + + return generalApplicationID; + } } module.exports = new createGASteps(); diff --git a/src/test/functionalTests/tests/nonprod/LipvLip_GA_creation_tests.js b/src/test/functionalTests/tests/nonprod/LipvLip_GA_creation_tests.js index 600758d0024..f2121904f52 100644 --- a/src/test/functionalTests/tests/nonprod/LipvLip_GA_creation_tests.js +++ b/src/test/functionalTests/tests/nonprod/LipvLip_GA_creation_tests.js @@ -2,7 +2,6 @@ const config = require('../../../config'); const {createAccount} = require('../../specClaimHelpers/api/idamHelper'); const LoginSteps = require('../../commonFeatures/home/steps/login'); const createGASteps = require('../../citizenFeatures/GA/steps/createGASteps'); -// eslint-disable-next-line no-unused-vars let claimRef, claimType, caseData, claimNumber; @@ -49,6 +48,9 @@ Scenario('LipvLip Applicant GA creation tests @citizenUI @nightly - @api @ga', a console.log('Creating change claim or defence GA app as claimant'); await createGASteps.askToChangeSubmittedGA(claimRef, 'Miss Jane Doe v Sir John Doe', 'withoutnotice'); + + console.log('Creating multiple applications as claimant'); + await createGASteps.createMultipleApplications(claimRef, 'Miss Jane Doe v Sir John Doe', 'consent'); } }); From 8897921c4d4cbf41bf967d566c77eae850bdf956 Mon Sep 17 00:00:00 2001 From: CourtneySuhr-Solirius Date: Thu, 6 Feb 2025 11:35:03 +0000 Subject: [PATCH 2/3] Update createGASteps.js --- .../citizenFeatures/GA/steps/createGASteps.js | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/test/functionalTests/citizenFeatures/GA/steps/createGASteps.js b/src/test/functionalTests/citizenFeatures/GA/steps/createGASteps.js index d66a0fa51d2..8f74fa824db 100644 --- a/src/test/functionalTests/citizenFeatures/GA/steps/createGASteps.js +++ b/src/test/functionalTests/citizenFeatures/GA/steps/createGASteps.js @@ -1477,6 +1477,18 @@ class createGASteps { return generalApplicationID; } + async additionalPayment(feeAmount) { + await applyHelpFeeSelectionPage.verifyPageContentForAdditionalFee(); + await applyHelpFeeSelectionPage.nextAction('No'); + await applyHelpFeeSelectionPage.nextAction('Continue'); + + await govPay.addValidCardDetails(feeAmount); + govPay.confirmPayment(); + + await paymentConfirmationPage.verifyAdditionalPaymentPageContent(); + await paymentConfirmationPage.nextAction('Close and return to dashboard'); + } + async createMultipleApplications(caseRef, parties, communicationType = 'consent') { const caseNumber = StringUtilsComponent.StringUtilsComponent.formatClaimReferenceToAUIDisplayFormat(caseRef); @@ -1623,12 +1635,6 @@ class createGASteps { return generalApplicationID; } - async additionalPayment(feeAmount) { - await applyHelpFeeSelectionPage.verifyPageContentForAdditionalFee(); - await paymentConfirmationPage.verifyAdditionalPaymentPageContent(); - await paymentConfirmationPage.nextAction('Close and return to dashboard'); - - } } module.exports = new createGASteps(); From df938bfe7de052eacd1f824b63aec8765a64bb7c Mon Sep 17 00:00:00 2001 From: Raja Date: Tue, 11 Feb 2025 13:34:51 +0000 Subject: [PATCH 3/3] added tests --- .../specClaimHelpers/api/steps.js | 3 + .../fixtures/events/makeAnOrderGA.js | 61 +++++++++++++++++++ .../tests/nonprod/LiPvLiP_GA_e2e_tests.js | 33 ++++++++++ .../nonprod/LipvLip_GA_creation_tests.js | 4 +- 4 files changed, 99 insertions(+), 2 deletions(-) diff --git a/src/test/functionalTests/specClaimHelpers/api/steps.js b/src/test/functionalTests/specClaimHelpers/api/steps.js index c9ec9c16683..5ba749f5906 100644 --- a/src/test/functionalTests/specClaimHelpers/api/steps.js +++ b/src/test/functionalTests/specClaimHelpers/api/steps.js @@ -102,6 +102,9 @@ module.exports = { case 'requestMoreInformation': payload = makeAnOrderGA.requestMoreInformation(document); break; + case 'listForHearing': + payload = makeAnOrderGA.listForHearing(document); + break; default: payload = makeAnOrderGA.makeAnOrderGA(document); break; diff --git a/src/test/functionalTests/specClaimHelpers/fixtures/events/makeAnOrderGA.js b/src/test/functionalTests/specClaimHelpers/fixtures/events/makeAnOrderGA.js index 28ed9f4bbab..bc4a2bae946 100644 --- a/src/test/functionalTests/specClaimHelpers/fixtures/events/makeAnOrderGA.js +++ b/src/test/functionalTests/specClaimHelpers/fixtures/events/makeAnOrderGA.js @@ -266,4 +266,65 @@ module.exports = { }, }; }, + listForHearing: (document) => { + return { + event: 'MAKE_DECISION', + caseDataUpdate: { + judicialDecision: { + decision: 'LIST_FOR_A_HEARING', + }, + applicationIsCloaked: 'No', + judgeTitle: 'Angel Morgan', + judicialByCourtsInitiativeListForHearing: 'OPTION_1', + hearingOrderDocument: [ + { + id: '1ebaf4dd-a1e5-4d8e-801d-bf27a1a3fa99', + value: { + createdBy: 'Civil', + createdDatetime: '2025-01-29T10:43:42.716255484', + documentLink: { + category_id: 'applications', + document_binary_url: document.document_binary_url, + document_filename: document.document_filename, + document_url: document.document_url, + }, + documentName: 'Request_for_information_for_application_2025-01-29 10:43:42.pdf', + documentSize: 56542, + documentType: 'REQUEST_FOR_INFORMATION', + }, + }, + ], + judicialGeneralHearingOrderRecital: 'The Judge considered the application of the claimant dated 11 February 2025', + judicialGeneralOrderHearingEstimationTimeText: 'Estimated length of hearing is 30 minutes', + judicialGOHearingDirections: 'test', + judicialHearingGeneralOrderHearingText: 'The hearing will be held via telephone.', + judicialHearingGOHearingReqText: 'Hearing requirements Hearing loop', + judicialListForHearing: { + addlnInfoCourtStaff: 'test', + hearingPreferencesPreferredType: 'TELEPHONE', + hearingPreferredLocation: { + list_items: [ + { + code: '1cfc5c6b-291c-433e-a797-539b70ddbb60', + label: 'Birmingham Civil and Family Justice Centre - Priory Courts, 33 Bull Street - B4 6DS', + }, + ], + value: { + code: '1cfc5c6b-291c-433e-a797-539b70ddbb60', + label: 'Birmingham Civil and Family Justice Centre - Priory Courts, 33 Bull Street - B4 6DS', + }, + }, + judicialSupportRequirement: [ + 'HEARING_LOOPS', + ], + judicialTimeEstimate: 'MINUTES_30', + judicialVulnerabilityText: 'No support required with regards to vulnerability', + }, + orderCourtOwnInitiativeListForHearing: { + orderCourtOwnInitiative: 'As this order was made on the court\'s own initiative, any party affected by the order may apply to set aside, vary, or stay the order. Any such application must be made by 4pm on', + orderCourtOwnInitiativeDate: '2025-02-18', + }, + }, + }; + }, }; diff --git a/src/test/functionalTests/tests/nonprod/LiPvLiP_GA_e2e_tests.js b/src/test/functionalTests/tests/nonprod/LiPvLiP_GA_e2e_tests.js index 15279f929f1..51e0e05f387 100644 --- a/src/test/functionalTests/tests/nonprod/LiPvLiP_GA_e2e_tests.js +++ b/src/test/functionalTests/tests/nonprod/LiPvLiP_GA_e2e_tests.js @@ -251,3 +251,36 @@ Scenario('LipvLip Applicant GA creation e2e tests - Request for more info @citiz } } }); + +Scenario('LipvLip Applicant GA creation e2e tests - List for hearing @citizenUI - @api @ga @nightly', async ({ + I, + api, +}) => { + courtResponseType = 'listForHearing'; + if (['preview', 'demo'].includes(config.runningEnv)) { + await LoginSteps.EnterCitizenCredentials(config.claimantCitizenUser.email, config.claimantCitizenUser.password); + + console.log('Creating an Adjourn Hearing Order GA app as Claimant'); + await I.amOnPage('/dashboard'); + await I.click(claimNumber); + gaID = await createGASteps.askToChangeHearingDateGA(claimRef, 'Miss Jane Doe v Sir John Doe', 'notice'); + + console.log('Responding to the GA as defendant'); + await LoginSteps.EnterCitizenCredentials(config.defendantCitizenUser.email, config.defendantCitizenUser.password); + await I.amOnPage('/dashboard'); + await I.click(claimNumber); + await respondGASteps.respondToGA(claimRef, gaID, 'Respond to an application to change a hearing date', 'Miss Jane Doe v Sir John Doe'); + + console.log('Perform List for hearing as the Judge'); + await api.makeOrderGA(gaID, courtResponseType); + + const isDashboardServiceEnabled = await isDashboardServiceToggleEnabled(); + + if (isDashboardServiceEnabled) { + const notification = orderMadeGA(); + await I.wait(10); + await verifyNotificationTitleAndContent(claimNumber, notification.title, notification.content); + await I.click(notification.nextSteps); + } + } +}); diff --git a/src/test/functionalTests/tests/nonprod/LipvLip_GA_creation_tests.js b/src/test/functionalTests/tests/nonprod/LipvLip_GA_creation_tests.js index f2121904f52..359e57a1108 100644 --- a/src/test/functionalTests/tests/nonprod/LipvLip_GA_creation_tests.js +++ b/src/test/functionalTests/tests/nonprod/LipvLip_GA_creation_tests.js @@ -11,7 +11,7 @@ Before(async ({api}) => { if (['preview', 'demo'].includes(config.runningEnv)) { await createAccount(config.claimantCitizenUser.email, config.claimantCitizenUser.password); await createAccount(config.defendantCitizenUser.email, config.defendantCitizenUser.password); - + claimType = 'FastTrack'; claimRef = await api.createLiPClaim(config.claimantCitizenUser, claimType); caseData = await api.retrieveCaseData(config.adminUser, claimRef); @@ -78,4 +78,4 @@ Scenario('LipvLip Defendant GA creation tests @citizenUI @nightly - @api @ga', a console.log('Creating not on list GA app as defendant'); await createGASteps.askSomethingNotOnListGA(claimRef, 'Miss Jane Doe v Sir John Doe', 'withoutnotice'); } -}); \ No newline at end of file +});