Skip to content
Open
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions playwright-e2e/pages/orders.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ export class Orders extends BasePage {
readonly addExclusionDetails: Locator;
readonly endOfProceedings: Locator;
readonly endDate: Locator;
readonly applications: Locator;

constructor(page: Page) {
super(page);
Expand Down Expand Up @@ -132,6 +133,7 @@ export class Orders extends BasePage {
this.addExclusionDetails = page.getByRole('textbox', { name: 'Add exclusion details' });
this.endOfProceedings = page.getByRole('radio', { name: 'The end of proceedings' });
this.endDate = page.getByRole('group', { name: 'End Date' });
this.applications = page.getByLabel('Applications');

}

Expand Down Expand Up @@ -382,4 +384,21 @@ export class Orders extends BasePage {
await this.radioButton.check();
await this.endOfProceedings.check();
}

async uploadsSupervisionOrder(_supervisionOrderYesNo: string) {
await this.orderApproved.getByLabel('Yes').click();
await this.approvedHearing.selectOption('Case management hearing, 3 November 2012');
await this.applicationOrder.getByLabel('Yes').check();
await this.applications.selectOption('C2, 25 March 2021, 3:16pm');
await this.clickContinue();
await this.clickContinue();
await this.childInvolved.getByLabel('Yes').check();
await this.clickContinue();
await this.orderFurtherDirectionDetails.fill('test');
await this.clickContinue();
await this.orderEndsOn.getByLabel('In a set number of months').check();
await this.orderLength.fill('2');
await this.clickContinue();
await this.closeOrder.getByLabel('No').check();
}
};
48 changes: 47 additions & 1 deletion playwright-e2e/tests/manage-orders.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ test.describe('manage orders', () => {
await orders.tabNavigation('Orders');
await expect(page.getByText('c42_family_assistance_order.pdf', { exact: true })).toBeVisible();

})
});

test('CTSC uploads Interim care order (C33)', async ({ page, signInPage, orders }) => {
caseName = 'Interim care order (C33) ' + dateTime.slice(0, 10);
Expand Down Expand Up @@ -469,4 +469,50 @@ test.describe('manage orders', () => {
await expect(page.getByRole('link', { name: 'c33_interim_care_order.pdf', exact: true })).toBeVisible();

})

test('CTSC uploads Supervision order (C35A)', async ({ page, signInPage, orders }) => {
caseName = 'Supervision order (C35A) ' + dateTime.slice(0, 10);
await updateCase(caseName, caseNumber, caseData);
await signInPage.visit();
await signInPage.login(CTSCUser.email, CTSCUser.password);
await signInPage.navigateTOCaseDetails(caseNumber);
await orders.gotoNextStep('Manage orders');

await orders.selectOrderOperation('Create an order');
await orders.clickContinue();

await orders.selectOrder('Supervision order (C35A)');
await orders.clickContinue();

await orders.uploadsSupervisionOrder('Yes');
await orders.clickContinue();

await orders.checkYourAnsAndSubmit();

await orders.tabNavigation('Orders');
await expect(page.getByRole('link', { name: 'c35a_supervision_order.pdf', exact: true })).toBeVisible();
})

test('Judge uploads Supervision order (C35A)', async ({ page, signInPage, orders }) => {
caseName = 'Supervision order (C35A) ' + dateTime.slice(0, 10);
await updateCase(caseName, caseNumber, caseData);
await signInPage.visit();
await signInPage.login(judgeUser.email, judgeUser.password);
await signInPage.navigateTOCaseDetails(caseNumber);
await orders.gotoNextStep('Manage orders');

await orders.selectOrderOperation('Create an order');
await orders.clickContinue();

await orders.selectOrder('Supervision order (C35A)');
await orders.clickContinue();

await orders.uploadsSupervisionOrder('Yes');
await orders.clickContinue();

await orders.checkYourAnsAndSubmit();

await orders.tabNavigation('Orders');
await expect(page.getByRole('link', { name: 'c35a_supervision_order.pdf', exact: true })).toBeVisible();
})
})