-
Notifications
You must be signed in to change notification settings - Fork 2
Hdpi 5180 automation #1022
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
Merged
Merged
Hdpi 5180 automation #1022
Changes from all commits
Commits
Show all changes
52 commits
Select commit
Hold shift + click to select a range
9e2d78f
HDPI-5180: Create gen app skeleton journey
scottstewart-sl 8a94076
Merge remote-tracking branch 'origin/master' into HDPI-5180_gen_app_s…
scottstewart-sl c3882a0
Merge remote-tracking branch 'origin/master' into HDPI-5180_gen_app_s…
scottstewart-sl 55690ec
HDPI-5180: Update CYA page for gen apps
scottstewart-sl 0b59970
HDPI-5180: Fix lint issues
scottstewart-sl 13fbd73
HDPI-5180: Fix unit test following property name change
scottstewart-sl 378da77
HDPI-5180: Use Continue button for now
scottstewart-sl 1a2adc3
HDPI-5180: Fix accidental space
scottstewart-sl ee93665
HDPI-5180: Remove Suspend as is no longer in scope
scottstewart-sl ee0c5d4
Merge branch 'master' into HDPI-5180_gen_app_skeleton
scottstewart-sl ff8cbf2
HDPI-5180: Resolve PR comments
scottstewart-sl 5c8d84c
Merge branch 'HDPI-5180_gen_app_skeleton' of github.com:hmcts/pcs-fro…
scottstewart-sl 7868fa8
Merge branch 'master' into HDPI-5180_gen_app_skeleton
scottstewart-sl e3f7e04
HDPI-5180: Use entity encoding in another HTML page title
scottstewart-sl 735f105
Merge remote-tracking branch 'origin/master' into HDPI-5180_gen_app_s…
scottstewart-sl 3fdd1b5
HDPI-5180: Adding placeholder banner to pages
scottstewart-sl 8a27cf6
HDPI-5180: Update brace-expansion to resolve CVE
scottstewart-sl 4064415
Merge remote-tracking branch 'origin/master' into HDPI-5180_gen_app_s…
scottstewart-sl ff80075
Merge branch 'master' into HDPI-5180_gen_app_skeleton
scottstewart-sl b929a54
Merge branch 'master' into HDPI-5180_gen_app_skeleton
scottstewart-sl ac758c9
Merge branch 'master' into HDPI-5180_gen_app_skeleton
scottstewart-sl e7e89b4
HDPI-5180: Fix merge issue
scottstewart-sl b692503
Merge branch 'master' into HDPI-5180_gen_app_skeleton
scottstewart-sl 4a991ac
initial commit
srinijg 77b125f
new gen app tests added
srinijg 1736136
Merge remote-tracking branch 'origin/HDPI-5180_gen_app_skeleton' into…
srinijg ee103ba
Merge branch 'master' into HDPI-5180_gen_app_skeleton
srinijg 0ab77a8
Merge remote-tracking branch 'origin/HDPI-5180_gen_app_skeleton' into…
srinijg 24f8855
lint fix
srinijg 8bd26b6
Merge branch 'master' into HDPI-5180_gen_app_skeleton
scottstewart-sl aa0a479
Merge branch 'master' into HDPI-5180_gen_app_skeleton
srinijg 93366f8
Merge remote-tracking branch 'origin/HDPI-5180_gen_app_skeleton' into…
srinijg 0593f40
new tests added
srinijg dd9e8a8
error message update
srinijg 545daca
tags added
srinijg 5230de3
lint fix
srinijg 151a179
Merge branch 'master' into HDPI-5180_gen_app_skeleton
srinijg a057a07
Merge remote-tracking branch 'origin/HDPI-5180_gen_app_skeleton' into…
srinijg 3226496
test update
srinijg 253c858
Merge branch 'master' into HDPI-5180_gen_app_skeleton
srinijg 589a9da
tests updated
srinijg 47cd7fa
Merge remote-tracking branch 'origin/HDPI-5180_gen_app_skeleton' into…
srinijg 7f55d97
Merge branch 'master' into HDPI-5180_gen_app_skeleton
srinijg 00edff3
separated spec files
srinijg d4ce7a3
Merge remote-tracking branch 'origin/HDPI-5180_gen_app_skeleton' into…
srinijg 760d585
button updates
srinijg 9ee1ee5
fixes to buttons
srinijg 6abca3c
spec file renamed
srinijg 2b20013
reference to improvements link added
srinijg 409f03b
Merge remote-tracking branch 'origin/master' into HDPI-5180-Automation
srinijg 311321f
separate Gen apps section
srinijg 5b05d23
Merge branch 'master' into HDPI-5180-Automation
PadmaDeenadayalan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
src/test/ui/data/page-data/genApps-page-data/checkYourAnswers.page.data.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| export const checkYourAnswers = { | ||
| mainHeader: `Check your answers`, | ||
| submitApplicationButton: `Submit application`, | ||
| }; |
15 changes: 15 additions & 0 deletions
15
src/test/ui/data/page-data/genApps-page-data/chooseAnApplication.page.data.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| export const chooseAnApplication = { | ||
| mainHeader: `Choose an application`, | ||
| whatDoYouWantToApplyForQuestion: `What do you want to apply for?`, | ||
| delayRadioOption: `Ask to adjourn (delay) the hearing`, | ||
| setAsideRadioOption: `Ask the court to change (set aside) their decision to evict you`, | ||
| somethingElseRadioOption: `Something else`, | ||
| continueButton: `Continue`, | ||
| cancelLink: `Cancel`, | ||
| thereIsAProblemErrorMessageHeader: `There is a problem`, | ||
| // if the below format is deemed complicated it will replaced as part of https://tools.hmcts.net/jira/browse/HDPI-5815 | ||
| errorValidationType: { one: `radioOptions`, two: `textField`, three: `checkBox` }, | ||
| errorValidationField: { | ||
| errorRadioOption: { type: `none`, input: ``, errMessage: `You must select an type of application to apply for` }, | ||
| }, | ||
| }; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| export * from './chooseAnApplication.page.data'; | ||
| export * from './checkYourAnswers.page.data'; |
38 changes: 38 additions & 0 deletions
38
src/test/ui/e2eTest/genApps-e2eTest/makeAnApplication.askToAdjourn.spec.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| import { test } from '@playwright/test'; | ||
| import config from 'config'; | ||
|
|
||
| import { createCaseApiData, submitCaseApiData } from '../../data/api-data'; | ||
| import { checkYourAnswers, chooseAnApplication } from '../../data/page-data/genApps-page-data'; | ||
| import { finaliseAllValidations, initializeExecutor, performAction, performValidation } from '../../utils/controller'; | ||
|
|
||
| const home_url = config.get('e2e.testUrl') as string; | ||
|
|
||
| test.beforeEach(async ({ page }) => { | ||
| initializeExecutor(page); | ||
| await performAction('createCaseAPI', { data: createCaseApiData.createCasePayload }); | ||
| await performAction('submitCaseAPI', { data: submitCaseApiData.submitCasePayloadDefault }); | ||
| await performAction('fetchPINsAPI'); | ||
| await performAction('createUser', 'citizen', ['citizen']); | ||
| await performAction('validateAccessCodeAPI'); | ||
| await performAction('navigateToUrl', home_url); | ||
| await performAction('login'); | ||
| await performAction( | ||
| 'navigateToUrl', | ||
| home_url + `/case/${process.env.CASE_NUMBER}/make-an-application/choose-an-application` | ||
| ); | ||
| }); | ||
|
|
||
| test.afterEach(async () => { | ||
| finaliseAllValidations(); | ||
| }); | ||
|
|
||
| test.describe('Make an Application - e2e Journey @nightly', async () => { | ||
| test('Select an Application - Ask to Adjourn journey @regression', async () => { | ||
| await performAction('chooseAnApplication', { | ||
| question: chooseAnApplication.whatDoYouWantToApplyForQuestion, | ||
| option: chooseAnApplication.delayRadioOption, | ||
| }); | ||
| await performValidation('mainHeader', checkYourAnswers.mainHeader); | ||
| await performAction('clickButton', checkYourAnswers.submitApplicationButton); | ||
| }); | ||
| }); |
38 changes: 38 additions & 0 deletions
38
src/test/ui/e2eTest/genApps-e2eTest/makeAnApplication.askToSetAside.spec.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| import { test } from '@playwright/test'; | ||
| import config from 'config'; | ||
|
|
||
| import { createCaseApiData, submitCaseApiData } from '../../data/api-data'; | ||
| import { checkYourAnswers, chooseAnApplication } from '../../data/page-data/genApps-page-data'; | ||
| import { finaliseAllValidations, initializeExecutor, performAction, performValidation } from '../../utils/controller'; | ||
|
|
||
| const home_url = config.get('e2e.testUrl') as string; | ||
|
|
||
| test.beforeEach(async ({ page }) => { | ||
| initializeExecutor(page); | ||
| await performAction('createCaseAPI', { data: createCaseApiData.createCasePayload }); | ||
| await performAction('submitCaseAPI', { data: submitCaseApiData.submitCasePayloadDefault }); | ||
| await performAction('fetchPINsAPI'); | ||
| await performAction('createUser', 'citizen', ['citizen']); | ||
| await performAction('validateAccessCodeAPI'); | ||
| await performAction('navigateToUrl', home_url); | ||
| await performAction('login'); | ||
| await performAction( | ||
| 'navigateToUrl', | ||
| home_url + `/case/${process.env.CASE_NUMBER}/make-an-application/choose-an-application` | ||
| ); | ||
| }); | ||
|
|
||
| test.afterEach(async () => { | ||
| finaliseAllValidations(); | ||
| }); | ||
|
|
||
| test.describe('Make an Application - e2e Journey @nightly', async () => { | ||
| test('Select an Application - Ask to Set aside @regression', async () => { | ||
| await performAction('chooseAnApplication', { | ||
| question: chooseAnApplication.whatDoYouWantToApplyForQuestion, | ||
| option: chooseAnApplication.setAsideRadioOption, | ||
| }); | ||
| await performValidation('mainHeader', checkYourAnswers.mainHeader); | ||
| await performAction('clickButton', checkYourAnswers.submitApplicationButton); | ||
| }); | ||
| }); |
38 changes: 38 additions & 0 deletions
38
src/test/ui/e2eTest/genApps-e2eTest/makeAnApplication.somethingElse.spec.ts
|
Gautham059 marked this conversation as resolved.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| import { test } from '@playwright/test'; | ||
| import config from 'config'; | ||
|
|
||
| import { createCaseApiData, submitCaseApiData } from '../../data/api-data'; | ||
| import { checkYourAnswers, chooseAnApplication } from '../../data/page-data/genApps-page-data'; | ||
| import { finaliseAllValidations, initializeExecutor, performAction, performValidation } from '../../utils/controller'; | ||
|
|
||
| const home_url = config.get('e2e.testUrl') as string; | ||
|
|
||
| test.beforeEach(async ({ page }) => { | ||
| initializeExecutor(page); | ||
| await performAction('createCaseAPI', { data: createCaseApiData.createCasePayload }); | ||
| await performAction('submitCaseAPI', { data: submitCaseApiData.submitCasePayloadDefault }); | ||
| await performAction('fetchPINsAPI'); | ||
| await performAction('createUser', 'citizen', ['citizen']); | ||
| await performAction('validateAccessCodeAPI'); | ||
| await performAction('navigateToUrl', home_url); | ||
| await performAction('login'); | ||
| await performAction( | ||
| 'navigateToUrl', | ||
| home_url + `/case/${process.env.CASE_NUMBER}/make-an-application/choose-an-application` | ||
| ); | ||
| }); | ||
|
|
||
| test.afterEach(async () => { | ||
| finaliseAllValidations(); | ||
| }); | ||
|
|
||
| test.describe('Make an Application - e2e Journey @nightly', async () => { | ||
| test('Select an Application - Something else @regression', async () => { | ||
| await performAction('chooseAnApplication', { | ||
| question: chooseAnApplication.whatDoYouWantToApplyForQuestion, | ||
| option: chooseAnApplication.somethingElseRadioOption, | ||
| }); | ||
| await performValidation('mainHeader', checkYourAnswers.mainHeader); | ||
| await performAction('clickButton', checkYourAnswers.submitApplicationButton); | ||
| }); | ||
| }); |
13 changes: 13 additions & 0 deletions
13
src/test/ui/functional/genApps-functional/chooseAnApplication.pft.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| import { chooseAnApplication } from '../../data/page-data/genApps-page-data'; | ||
| import { performAction } from '../../utils/controller'; | ||
|
|
||
| export async function chooseAnApplicationErrorValidation(): Promise<void> { | ||
| await performAction('inputErrorValidationGenApp', { | ||
| validationType: chooseAnApplication.errorValidationType.one, | ||
| inputArray: chooseAnApplication.errorValidationField.errorRadioOption, | ||
| header: chooseAnApplication.thereIsAProblemErrorMessageHeader, | ||
| question: chooseAnApplication.whatDoYouWantToApplyForQuestion, | ||
| option: chooseAnApplication.delayRadioOption, | ||
| button: chooseAnApplication.continueButton, | ||
| }); | ||
| } |
45 changes: 45 additions & 0 deletions
45
src/test/ui/utils/actions/custom-actions/genApps.action.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| import { Page } from '@playwright/test'; | ||
|
|
||
| import { chooseAnApplication } from '../../../data/page-data/genApps-page-data'; | ||
| import { performAction, performValidation } from '../../controller'; | ||
| import { IAction, actionData, actionRecord } from '../../interfaces'; | ||
|
|
||
| export class GenAppsAction implements IAction { | ||
| async execute(page: Page, action: string, fieldName: actionData | actionRecord): Promise<void> { | ||
| const actionsMap = new Map<string, () => Promise<void>>([ | ||
| ['chooseAnApplication', () => this.chooseAnApplication(fieldName as actionRecord)], | ||
| ['inputErrorValidationGenApp', () => this.inputErrorValidationGenApp(fieldName as actionRecord)], | ||
| ]); | ||
| const actionToPerform = actionsMap.get(action); | ||
| if (!actionToPerform) { | ||
| throw new Error(`No action found for '${action}'`); | ||
| } | ||
| await actionToPerform(); | ||
| } | ||
|
|
||
| private async chooseAnApplication(chooseApp: actionRecord) { | ||
| await performAction('clickRadioButton', { | ||
| question: chooseApp.question, | ||
| option: chooseApp.option, | ||
| }); | ||
| await performAction('clickButton', chooseAnApplication.continueButton); | ||
| } | ||
|
|
||
| private async inputErrorValidationGenApp(validationArr: actionRecord) { | ||
| const inputs = Array.isArray(validationArr.inputArray) ? validationArr.inputArray : [validationArr.inputArray]; | ||
|
|
||
| for (const item of inputs) { | ||
| switch (validationArr.validationType) { | ||
| case 'radioOptions': | ||
| await performAction('clickButton', validationArr.button); | ||
| await performValidation( | ||
| 'errorMessage', | ||
| !validationArr?.header ? (validationArr.header = 'There is a problem') : validationArr.header, | ||
| item.errMessage | ||
| ); | ||
| await performAction('clickRadioButton', { question: validationArr.question, option: validationArr.option }); | ||
| break; | ||
| } | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.