-
Notifications
You must be signed in to change notification settings - Fork 4
CCM-16489: Add letter authoring e2e tests #930
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
Open
andykay-nhs
wants to merge
10
commits into
main
Choose a base branch
from
feature/CCM-16489
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
89e2235
Rename legacy letter e2e tests, add new standard letter happy path e2…
andykay-nhs 94a6529
Parameterise e2e test for different letter types
andykay-nhs d082c23
Complete happy path letter tests
andykay-nhs 7513a86
Add validation failed test
andykay-nhs e471aad
Add edit template test steps
andykay-nhs aa1ec8e
Add large print and arabic letters
andykay-nhs cdf1f4d
Update iframe src assertion, use match object, use getUrl, update tim…
andykay-nhs f59c722
Add compareSrc error msg, remove page reload on pending upload
andykay-nhs 99f60b3
Rename compareSrc, update template name, return updated render src va…
andykay-nhs d7ce671
Check short and long initial render urls match
andykay-nhs 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
Binary file not shown.
Binary file not shown.
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
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
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
21 changes: 21 additions & 0 deletions
21
tests/test-team/pages/letter/template-mgmt-upload-letter-base-page.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,21 @@ | ||
| import { Locator, Page } from '@playwright/test'; | ||
| import { TemplateMgmtBasePage } from 'pages/template-mgmt-base-page'; | ||
|
|
||
| export abstract class TemplateMgmtUploadLetterBasePage extends TemplateMgmtBasePage { | ||
| submitButton: Locator; | ||
|
|
||
| constructor(page: Page) { | ||
| super(page); | ||
|
|
||
| this.submitButton = page.getByRole('button', { | ||
| name: 'Upload letter template file', | ||
| }); | ||
| } | ||
|
|
||
| abstract fillForm(input: { | ||
| name: string; | ||
| campaignId: string; | ||
| filePath: string; | ||
| language?: string; | ||
| }): Promise<void>; | ||
| } |
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.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could this whole implementation go in TemplateMgmtUploadLetterBasePage? only difference is that the other ones don't have the language check, but this version handles the language being absent just fine
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think so, I will try and dedupe it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah wait, now I remember why i hesitated to do this. It would mean moving all of the references to the elements up into the base page class. When you do that you pretty much remove the need for
template-mgmt-upload-standard-english-letter-template-page.ts,template-mgmt-upload-large-print-letter-template-page.tsandtemplate-mgmt-upload-bsl-letter-template-page.tswhich would then mean going and changing all those references and then the PR becomes a lot bigger. Happy to go through and do this but felt like light touch was simpler despite some duplication of codeThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i don't think you'd need to change all the references in the tests, if you move everything shared up into the base class then won't the individual pages inherit them?
i'm not sure there's any reason to have a shared base class if you're not going to put all the shared attributes in it. the individual pages still have different URLs so you'd still have the individual classes.
not a big deal so happy to approve regardless but i don't see how moving all the shared attributes up would have any effect outside of these page classes