CCM-16489: Add letter authoring e2e tests#930
Conversation
bcfb235 to
5de6a57
Compare
5cb1262 to
5a8a9d4
Compare
5a8a9d4 to
aa1ec8e
Compare
| }); | ||
| } | ||
|
|
||
| // Method not intended for use |
There was a problem hiding this comment.
Could this be made to work as an abstract method?
There was a problem hiding this comment.
i had no idea there even was an abstract keyword in typescript! will give this a go
| await chooseTemplateTypePage.clickContinueButton(); | ||
|
|
||
| await expect(page).toHaveURL( | ||
| TemplateMgmtBasePage.appUrlSegment + uploadPage.pathTemplate |
|
|
||
| await expect(async () => { | ||
| const template = await templateStorageHelper.getTemplate(key); | ||
| expect(template.campaignId).toEqual(campaignId); |
There was a problem hiding this comment.
I wonder if it's better to use toMatchObject or similar, instead of individual assertions, because then if an assertion fails, you get the whole object printed out, which can be more useful than just the single property
| const choosePrintingAndPostagePage = | ||
| new TemplateMgmtChoosePrintingAndPostagePage(page); | ||
| const letterVariants = | ||
| await context.letterVariants.getGlobalLetterVariants(); |
There was a problem hiding this comment.
What did you think to the idea of using client or campaign specific, rather than global letter variants in some of these tests?
There was a problem hiding this comment.
I thought that because it was covered off in depth else where then it wouldn't really add much value to this but I suppose it could be another parameter to add in to the tests so each letter type is tested with a different variant
There was a problem hiding this comment.
That's fine, I don't disagree, just wondered
| await shortTab.clickUpdatePreview(); | ||
|
|
||
| await expect(async () => { | ||
| const template = await templateStorageHelper.getTemplate(templateKey); |
There was a problem hiding this comment.
The backend rendering test is already doing this kind of assertion on personalisationParameters, status, etc. I think it might be better to depend more on UI assertions here.
also would be good to show that the iframe URL has been updated since viewing the intial (unpersonalised) render
There was a problem hiding this comment.
yeah totally agree, think I copied this over from the existing pdf letter e2e tests but in hindsight it should really only be making assertions based on whats in the UI
There was a problem hiding this comment.
I guess there's not much you can get from the UI, though, so there's a case for leaving this in
| }, 'Persisted long form render is updated with correct personalisation details').toPass( | ||
| { timeout: 40_000 } | ||
| ); | ||
| }); |
There was a problem hiding this comment.
maybe flip between the tabs and assert on the changing iframe URL, and the personalisation fields?
| TemplateMgmtReviewAndApproveLetterTemplatePage.urlRegexp | ||
| ); | ||
|
|
||
| await expect(reviewAndApprovePage.shortRenderIFrame).toBeAttached(); |
There was a problem hiding this comment.
the iframe URLs should match those of the personalised renders from earlier
|
|
||
| await test.step('Template is listed and approved', async () => { | ||
| await expect(page).toHaveURL( | ||
| `/templates${TemplateMgmtMessageTemplatesPage.pathTemplate}` |
There was a problem hiding this comment.
new TemplateMgmtMessageTemplatesPage(page).getUrl()?
| expect(templateStatus).toEqual('Approved'); | ||
| }); | ||
|
|
||
| await test.step('Approved template cannot be edited', async () => { |
There was a problem hiding this comment.
it can be deleted, so that could be added as a final step
| await chooseTemplateTypePage.getLetterTypeRadio('x0').click(); | ||
| await chooseTemplateTypePage.clickContinueButton(); | ||
|
|
||
| await expect(page).toHaveURL( |
There was a problem hiding this comment.
as elsewhere, can you use getUrl?
| expect(template.files?.docxTemplate?.virusScanStatus).toEqual( | ||
| 'PASSED' | ||
| ); | ||
| expect(template.templateStatus).toEqual('PENDING_VALIDATION'); |
There was a problem hiding this comment.
If you're going to assert on the (transitory) PENDING_VALIDATION, you might as well assert on the spinner being visible too
|
|
||
| await expect(async () => { | ||
| const template = await templateStorageHelper.getTemplate(key); | ||
| expect(template.campaignId).toEqual(campaignId); |
There was a problem hiding this comment.
as above, consider using toMatchObject, and whether all these details need to be checked
Description
for each letter type
templateStorageHelper. (Saw this in the existing pdf-letter e2e tests)One test covers off invalid template scenario (missing address).
Added arabic and large print letters.
Tests succeeding locally:

Context
Type of changes
Checklist
Sensitive Information Declaration
To ensure the utmost confidentiality and protect your and others privacy, we kindly ask you to NOT including PII (Personal Identifiable Information) / PID (Personal Identifiable Data) or any other sensitive data in this PR (Pull Request) and the codebase changes. We will remove any PR that do contain any sensitive information. We really appreciate your cooperation in this matter.
Description
Raising draft to check CI pipeline status
for each letter type
templateStorageHelper. (Saw this in the existing pdf-letter e2e tests)Context
Type of changes
Checklist
Sensitive Information Declaration
To ensure the utmost confidentiality and protect your and others privacy, we kindly ask you to NOT including PII (Personal Identifiable Information) / PID (Personal Identifiable Data) or any other sensitive data in this PR (Pull Request) and the codebase changes. We will remove any PR that do contain any sensitive information. We really appreciate your cooperation in this matter.