Skip to content

Commit

Permalink
CIV-12200 Use Playwright for FT's (#3875)
Browse files Browse the repository at this point in the history
* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* updateg

* update

* update

* update

* update

* update

* Update conf

* update

* update

---------

Co-authored-by: Mounika Ammineni <[email protected]>
  • Loading branch information
mounikahmcts and Mounika Ammineni authored Feb 5, 2024
1 parent 25aaa02 commit 2f96428
Show file tree
Hide file tree
Showing 49 changed files with 642 additions and 986 deletions.
56 changes: 33 additions & 23 deletions codecept.conf.js
Original file line number Diff line number Diff line change
@@ -1,43 +1,53 @@
exports.config = {
tests: [
tests: process.env.CCD_PIPELINE == 'true' ? [
'./e2e/tests/*_test.js',
'./e2e/tests/api_tests/defaultJudgments/*_test.js',
'./e2e/tests/api_tests/damages/*_test.js',
'./e2e/tests/api_tests/lrspec_cui/*_test.js',
'./e2e/tests/api_tests/sdo/*_test.js',
'./e2e/tests/ui_tests/damages/*_test.js',
'./e2e/tests/ui_tests/lrspec/*_test.js',
'./e2e/tests/ui_tests/damages/nightly/*_test.js',
'./e2e/tests/ui_tests/noticeofchange/*_test.js',
'./e2e/tests/ui_tests/manageContactInformation/*_test.js',
'./e2e/tests/ui_tests/sdo/*_test.js',
'./e2e/tests/ui_tests/default_judgement/*_test.js',
'./e2e/tests/ui_tests/hearings/*_test.js',
] : [
'./e2e/tests/*_test.js',
'./e2e/tests/ui_tests/damages/*_test.js',
'./e2e/tests/ui_tests/lrspec/*_test.js',
'./e2e/tests/ui_tests/damages/nightly/*_test.js',
'./e2e/tests/ui_tests/noticeofchange/*_test.js',
'./e2e/tests/ui_tests/manageContactInformation/*_test.js',
'./e2e/tests/api_tests/lrspec/*_test.js',
'./e2e/tests/ui_tests/sdo/*_test.js',
'./e2e/tests/ui_tests/default_judgement/*_test.js',
'./e2e/tests/api_tests/hearings/*_test.js',
'./e2e/tests/api_tests/bulkclaim/*_test.js',
'./e2e/tests/ui_tests/hearings/*_test.js',
'./e2e/tests/api_tests/judgmentOnline/*_test.js',
'./e2e/tests/api_tests/mediation/*_test.js',
'./e2e/tests/api_tests/sdo_R2/*_test.js',
'./e2e/tests/**/**/**/*_test.js',
'./e2e/tests/api_tests/defaultJudgments/*_test.js',
'./e2e/tests/api_tests/damages/*_test.js',
'./e2e/tests/api_tests/lrspec_cui/*_test.js',
'./e2e/tests/api_tests/sdo/*_test.js',
'./e2e/tests/api_tests/hearings/*_test.js',
'./e2e/tests/api_tests/bulkclaim/*_test.js',
'./e2e/tests/api_tests/lrspec/*_test.js',
],
output: 'test-results/functional',
helpers: {
Puppeteer: {
restart: false,
keepCookies: true,
Playwright: {
url: process.env.URL || 'http://localhost:3333',
show: process.env.SHOW_BROWSER_WINDOW === 'true' || false,
windowSize: '1200x900',
waitForTimeout: parseInt(process.env.WAIT_FOR_TIMEOUT_MS || 90000),
chrome: {
ignoreHTTPSErrors: true
},
windowSize: '1280x960',
browser: 'chromium',
timeout: 20000,
waitForAction: 500,
bypassCSP: true,
ignoreHTTPSErrors: true,
},
BrowserHelpers: {
require: './e2e/helpers/browser_helper.js',
},
GenerateReportHelper: {
require: './e2e/helpers/generate_report_helper.js'
require: './e2e/helpers/generate_report_helper.js',
},
},
include: {
Expand All @@ -51,7 +61,7 @@ exports.config = {
api_spec_cui: './e2e/api/steps_LRspecCui.js',
noc: './e2e/api/steps_noc.js',
hearings: './e2e/api/steps_hearings.js',
bulks: './e2e/api/steps_Bulk.js'
bulks: './e2e/api/steps_Bulk.js',
},
plugins: {
autoDelay: {
Expand All @@ -61,7 +71,7 @@ exports.config = {
'fillField',
'checkOption',
'selectOption',
'attachFile',
'attach',
],
},
retryFailedStep: {
Expand Down Expand Up @@ -91,12 +101,12 @@ exports.config = {
stdout: '-',
options: {
reportDir: process.env.REPORT_DIR || 'test-results/functional',
reportFilename: `${process.env.MOCHAWESOME_REPORTFILENAME+'-'+new Date().getTime()}`,
reportFilename: `${process.env.MOCHAWESOME_REPORTFILENAME + '-' + new Date().getTime()}`,
inlineAssets: true,
overwrite: false,
json: false,
},
},
}
}
};
},
},
};
8 changes: 4 additions & 4 deletions e2e/fragments/addressPostCodeLookupLRspec.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ module.exports = {
lineTwo: `input[id$="spec${party}CorrespondenceAddressdetails__detailAddressLine2"]`,
lineThree: `input[id$="spec${party}CorrespondenceAddressdetails__detailAddressLine3"]`,
},
town: `input[id$="spec${party}CorrespondenceAddressdetails__detailPostTown"]`,
county: `input[id$="spec${party}CorrespondenceAddressdetails__detailPostTown"]`,
country: `input[id$="spec${party}CorrespondenceAddressdetails__detailCountry"]`,
postcode: `input[id$="spec${party}CorrespondenceAddressdetails__detailPostCode"]`,
town: `#spec${party}CorrespondenceAddressdetails__detailPostTown`,
county: `#spec${party}CorrespondenceAddressdetails__detailPostTown`,
country: `#spec${party}CorrespondenceAddressdetails__detailCountry`,
postcode: `#spec${party}CorrespondenceAddressdetails__detailPostCode`,
},
findAddressButton: 'Find address',
cantEnterPostcodeLink: locate('a').withText('I can\'t enter a UK postcode'),
Expand Down
8 changes: 4 additions & 4 deletions e2e/fragments/dq/disclosureOfElectrionicDocuments.page.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ module.exports = {
reachedAgreement: {
id: `#${party}DQDisclosureOfElectronicDocuments_reachedAgreement`,
options: {
yes: 'Yes',
no: 'No'
yes: `#${party}DQDisclosureOfElectronicDocuments_reachedAgreement_Yes`,
no: `#${party}DQDisclosureOfElectronicDocuments_reachedAgreement_No`
}
},
agreementLikely: {
id: `#${party}DQDisclosureOfElectronicDocuments_agreementLikely`,
options: {
yes: 'Yes',
no: 'No'
yes: `#${party}DQDisclosureOfElectronicDocuments_agreementLikely_Yes`,
no: `#${party}DQDisclosureOfElectronicDocuments_agreementLikely_No`
}
},
reasonForNoAgreement: `#${party}DQDisclosureOfElectronicDocuments_reasonForNoAgreement`,
Expand Down
4 changes: 2 additions & 2 deletions e2e/fragments/dq/disclosureOfNonElectrionicDocuments.page.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ module.exports = {
standardDirectionsRequired: {
id: `#${party}DQDisclosureOfNonElectronicDocuments_standardDirectionsRequired`,
options: {
yes: 'Yes',
no: 'No'
yes: `#${party}DQDisclosureOfNonElectronicDocuments_standardDirectionsRequired_Yes`,
no: `#${party}DQDisclosureOfNonElectronicDocuments_standardDirectionsRequired_No`
}
},
bespokeDirections: `#${party}DQDisclosureOfNonElectronicDocuments_bespokeDirections`
Expand Down
8 changes: 4 additions & 4 deletions e2e/fragments/dq/disclosureReport.page.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ module.exports = {
disclosureFormFiledAndServed: {
id: `#${party}DQDisclosureReport_disclosureFormFiledAndServed`,
options: {
yes: 'Yes',
no: 'No'
yes: `#${party}DQDisclosureReport_disclosureFormFiledAndServed_Yes`,
no: `#${party}DQDisclosureReport_disclosureFormFiledAndServed_No`
}
},
disclosureProposalAgreed: {
id: `#${party}DQDisclosureReport_disclosureProposalAgreed`,
options: {
yes: 'Yes',
no: 'No'
yes: `#${party}DQDisclosureReport_disclosureProposalAgreed_Yes`,
no: `#${party}DQDisclosureReport_disclosureProposalAgreed_No`
}
},
draftOrderNumber: `#${party}DQDisclosureReport_draftOrderNumber`,
Expand Down
12 changes: 6 additions & 6 deletions e2e/fragments/dq/experts.page.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,22 @@ module.exports = {
expertRequired: {
id: `#${party}DQExperts_expertRequired`,
options: {
yes: 'Yes',
no: 'No'
yes: `#${party}DQExperts_expertRequired_Yes`,
no: `#${party}DQExperts_expertRequired_No`
}
},
expertReportsSent: {
id: `#${party}DQExperts_expertReportsSent`,
options: {
yes: 'Yes',
no: 'No'
yes: `#${party}DQExperts_expertReportsSent-YES`,
no: `#${party}DQExperts_expertReportsSent-NO`
}
},
jointExpertSuitable: {
id: `#${party}DQExperts_jointExpertSuitable`,
options: {
yes: 'Yes',
no: 'No'
yes: `#${party}DQExperts_jointExpertSuitable_Yes`,
no: `#${party}DQExperts_jointExpertSuitable_No`
}
},
expertDetails: {
Expand Down
8 changes: 4 additions & 4 deletions e2e/fragments/dq/fileDirectionsQuestionnaire.page.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ module.exports = {
oneMonthStay: {
id: `#${party}DQFileDirectionsQuestionnaire_oneMonthStayRequested`,
options: {
yes: 'Yes',
no: 'No'
yes: `#${party}DQFileDirectionsQuestionnaire_oneMonthStayRequested_Yes`,
no: `#${party}DQFileDirectionsQuestionnaire_oneMonthStayRequested_No`
}
},
reactionProtocolCompliedWith: {
id: `#${party}DQFileDirectionsQuestionnaire_reactionProtocolCompliedWith`,
options: {
yes: 'Yes',
no: 'No'
yes: `#${party}DQFileDirectionsQuestionnaire_reactionProtocolCompliedWith_Yes`,
no: `#${party}DQFileDirectionsQuestionnaire_reactionProtocolCompliedWith_No`
}
},
reactionProtocolNotCompliedWithReason: `#${party}DQFileDirectionsQuestionnaire_reactionProtocolNotCompliedWithReason`,
Expand Down
8 changes: 4 additions & 4 deletions e2e/fragments/dq/fixedRecoverableCosts.page.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ module.exports = {
isSubjectToFixedRecoverableCostRegime: {
id: `#${party}DQFixedRecoverableCosts_isSubjectToFixedRecoverableCostRegime`,
options: {
yes: 'Yes',
no: 'No'
yes: `#${party}DQFixedRecoverableCosts_isSubjectToFixedRecoverableCostRegime_Yes`,
no: `#${party}DQFixedRecoverableCosts_isSubjectToFixedRecoverableCostRegime_No`
}
},
band: {
Expand All @@ -24,8 +24,8 @@ module.exports = {
complexityBandingAgreed: {
id: `#${party}DQFixedRecoverableCosts_complexityBandingAgreed`,
options: {
yes: 'Yes',
no: 'No'
yes: `#${party}DQFixedRecoverableCosts_complexityBandingAgreed_Yes`,
no: `#${party}DQFixedRecoverableCosts_complexityBandingAgreed_No`
}
},
reasons: `#${party}DQFixedRecoverableCosts_reasons`,
Expand Down
4 changes: 2 additions & 2 deletions e2e/fragments/dq/furtherInformation.page.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ module.exports = {
futureApplications: {
id: `#${party}DQFurtherInformation_futureApplications`,
options: {
yes: 'Yes',
no: 'No'
yes: `#${party}DQFurtherInformation_futureApplications_Yes`,
no: `#${party}DQFurtherInformation_futureApplications_No`
}
},
reasonForFutureApplications: `#${party}DQFurtherInformation_reasonForFutureApplications`,
Expand Down
4 changes: 2 additions & 2 deletions e2e/fragments/dq/hearing.page.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ module.exports = {
unavailableDatesRequired: {
id: `#${party}DQHearing_unavailableDatesRequired`,
options: {
yes: 'Yes',
no: 'No'
yes: `#${party}DQHearing_unavailableDatesRequired_Yes`,
no: `#${party}DQHearing_unavailableDatesRequired_No`
}
},
//respondent1DQHearing_unavailableDates_0_unavailableDateType
Expand Down
4 changes: 2 additions & 2 deletions e2e/fragments/dq/hearingSupportRequirements.page.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ module.exports = {
supportRequirements: {
id: `#${party}DQHearingSupport_supportRequirements`,
options: {
yes: 'Yes',
no: 'No'
yes: `#${party}DQHearingSupport_supportRequirements_Yes`,
no: `#${party}DQHearingSupport_supportRequirements_No`
}
},
supportRequirementsAdditional: `#${party}DQHearingSupport_supportRequirementsAdditional`
Expand Down
8 changes: 4 additions & 4 deletions e2e/fragments/dq/requestedCourt.page.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ module.exports = {
requestHearingAtSpecificCourt: {
id: `#${party}DQRequestedCourt_requestHearingAtSpecificCourt`,
options: {
yes: 'Yes',
no: 'No'
yes: `#${party}DQRequestedCourt_requestHearingAtSpecificCourt_Yes`,
no: `#${party}DQRequestedCourt_requestHearingAtSpecificCourt_No`
}
},
remoteHearingRequested: {
id: `#${party}DQRemoteHearing_remoteHearingRequested`,
options: {
yes: 'Yes',
no: 'No'
yes: `#${party}DQRemoteHearing_remoteHearingRequested_Yes`,
no: `#${party}DQRemoteHearing_remoteHearingRequested_No`
}
},
reasonForRemoteHearing: `#${party}DQRemoteHearing_reasonForRemoteHearing`,
Expand Down
4 changes: 2 additions & 2 deletions e2e/fragments/dq/vulnerabilityQuestions.page.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ module.exports = {
vulnerabilityAdjustmentsRequired: {
id: `#${party}DQVulnerabilityQuestions_vulnerabilityAdjustmentsRequired`,
options: {
yes: 'Yes',
no: 'No'
yes: `#${party}DQVulnerabilityQuestions_vulnerabilityAdjustmentsRequired_Yes`,
no: `#${party}DQVulnerabilityQuestions_vulnerabilityAdjustmentsRequired_No`
}
},
vulnerabilityAdjustments: `#${party}DQVulnerabilityQuestions_vulnerabilityAdjustments`
Expand Down
4 changes: 2 additions & 2 deletions e2e/fragments/dq/witnesses.page.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ module.exports = {
witnessesToAppear: {
id: `#${party}DQWitnesses_witnessesToAppear`,
options: {
yes: 'Yes',
no: 'No'
yes: `#${party}DQWitnesses_witnessesToAppear_Yes`,
no: `#${party}DQWitnesses_witnessesToAppear_No`
}
},
witnessDetails: {
Expand Down
4 changes: 2 additions & 2 deletions e2e/fragments/litigationFriend.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ module.exports = {
litigantInFriendDifferentAddress: {
id: `#${partyType}LitigationFriend_hasSameAddressAsLitigant`,
options: {
yes: 'Yes',
no: 'No'
yes: `#${partyType}LitigationFriend_hasSameAddressAsLitigant_Yes`,
no: `#${partyType}LitigationFriend_hasSameAddressAsLitigant_No`
}
},
litigantInFriendAddress: `#${partyType}LitigationFriend_primaryAddress_primaryAddress`,
Expand Down
16 changes: 8 additions & 8 deletions e2e/fragments/statementOfTruth.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@ module.exports = {

fields: {
claim: {
name: 'input[id$="uiStatementOfTruth_name"',
role: 'input[id$="uiStatementOfTruth_role"', },
name: 'input[id$="uiStatementOfTruth_name"]',
role: 'input[id$="uiStatementOfTruth_role"]', },
respondent1DQ: {
name: 'input[id$="uiStatementOfTruth_name"',
role: 'input[id$="uiStatementOfTruth_role"', },
name: 'input[id$="uiStatementOfTruth_name"]',
role: 'input[id$="uiStatementOfTruth_role"]', },
respondent2DQ: {
name: 'input[id$="uiStatementOfTruth_name"',
role: 'input[id$="uiStatementOfTruth_role"', },
name: 'input[id$="uiStatementOfTruth_name"]',
role: 'input[id$="uiStatementOfTruth_role"]', },
applicant1DQ: {
name: 'input[id$="uiStatementOfTruth_name"',
role: 'input[id$="uiStatementOfTruth_role"', }
name: 'input[id$="uiStatementOfTruth_name"]',
role: 'input[id$="uiStatementOfTruth_role"]', }
},

async enterNameAndRole(type = '', name = 'John Smith', role = 'Solicitor') {
Expand Down
8 changes: 4 additions & 4 deletions e2e/helpers/browser_helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ const {runAccessibility} = require('./accessibility/runner');
module.exports = class BrowserHelpers extends Helper {

getHelper() {
return this.helpers['Puppeteer'] || this.helpers['WebDriver'];
return this.helpers['Playwright'] || this.helpers['WebDriver'];
}

isPuppeteer(){
return this.helpers['Puppeteer'];
isPlaywirght(){
return this.helpers['Playwright'];
}

/**
Expand Down Expand Up @@ -39,7 +39,7 @@ module.exports = class BrowserHelpers extends Helper {
const helper = this.getHelper();
const waitTimeout = sec ? sec * 1000 : helper.options.waitForTimeout;
try {
if (this.isPuppeteer()) {
if (this.isPlaywirght()) {
const context = await helper._getContext();
return await context.waitForSelector(locator, {timeout: waitTimeout});
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const config = require('./../../config');
module.exports = {
fields: {
courtLocation: {
id: 'select[id$="hearingLocation"]',
id: '#hearingLocation',
options: {
preferredCourt: config.claimantSelectedCourt
}
Expand Down
2 changes: 1 addition & 1 deletion e2e/pages/createClaim/chooseCourt.page.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const config = require('./../../config');
module.exports = {
fields: {
courtLocation: {
id: 'select[id$="courtLocation_applicantPreferredCourtLocationList"]',
id: '#courtLocation_applicantPreferredCourtLocationList',
options: {
claimantPreferredCourt: config.claimantSelectedCourt
}
Expand Down
Loading

0 comments on commit 2f96428

Please sign in to comment.