-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathfeeAndPay.spec.ts
More file actions
110 lines (104 loc) · 5.28 KB
/
feeAndPay.spec.ts
File metadata and controls
110 lines (104 loc) · 5.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
import {
initializeExecutor,
performAction,
performValidation
} from '@utils/controller';
import { caseNumber } from '@utils/actions/custom-actions/createCase.action';
import { expect, test } from '@utils/test-fixtures';
import { createCaseApiData, submitCaseApiData } from '@data/api-data';
import { getCaseTypeId } from '@utils/common/caseType.utils';
import { VERY_LONG_TIMEOUT } from 'playwright.config';
import { cancelPayment, confirmYourPayment, enterPaymentDetails, serviceRequest } from '@data/page-data';
test.beforeEach(async ({ page }) => {
initializeExecutor(page);
await performAction('createCaseAPI', { data: createCaseApiData.createCasePayload });
await performAction('submitCaseAPI', { data: submitCaseApiData.submitCasePayloadNoDefendants });
await performAction('navigateToUrl', `${process.env.MANAGE_CASE_BASE_URL}/cases/case-details/PCS/${getCaseTypeId()}/${process.env.CASE_NUMBER}#Service%20Request`);
await expect(async () => {
await page.waitForURL(`${process.env.MANAGE_CASE_BASE_URL}/**/**/**/**/**#Service%20Request`);
}).toPass({
timeout: VERY_LONG_TIMEOUT,
});
});
test.afterEach(async () => {
if (caseNumber) {
await performAction('deleteCaseRole', '[CLAIMANTSOLICITOR]');
}
});
test.describe('[Common Component Fee And Pay] @CC' , async () => {
test('Fee And Pay - Pay by account PBA @nightly @feeAndPay', async () => {
await performAction('clickButton', serviceRequest.payNowLink);
await performAction('selectPaymentTypePBA', {
amountLabel: serviceRequest.amountToPayLabel,
expectedAmount: serviceRequest.amount404,
payByOption: serviceRequest.payByAccountRadioOption,
pbaLabel: serviceRequest.selectPBALabel,
pbaValue: serviceRequest.pbaValue,
referenceLabel: serviceRequest.pbaReferenceLable,
referenceText: serviceRequest.pbaReferenceInputText,
confirmButton: serviceRequest.confirmPaymentButton,
});
await performValidation('mainHeader', serviceRequest.paymentSuccessMainHeader);
});
test('Fee And Pay - Pay by Card @nightly @feeAndPay', async () => {
await performAction('clickButton', serviceRequest.payNowLink);
await performAction('selectPaymentByCard', {
amountLabel: serviceRequest.amountToPayLabel,
payByOption: serviceRequest.payByCardRadioOption,
continueButton: serviceRequest.continueButton
});
await performValidation('mainHeader', enterPaymentDetails.mainHeader);
await performAction('enterPaymentDetails', {
cardInput: enterPaymentDetails.cardNoInputText,
monthInput: enterPaymentDetails.monthTextInput,
yearInput: enterPaymentDetails.yearTextInput,
nameInput: enterPaymentDetails.nameOnCardTextInput,
cardSecInput: enterPaymentDetails.cardSecurityCodeTextInput,
address1Input: enterPaymentDetails.addressLine1TextInput,
address2Input: enterPaymentDetails.addressLine2TextInput,
townInput: enterPaymentDetails.TownOrCityTextInput,
countryInput: enterPaymentDetails.countryTextInput,
postCodeInput: enterPaymentDetails.postcodeTextInput,
emailInput: enterPaymentDetails.emailTextInput
});
await performValidation('mainHeader', confirmYourPayment.mainHeader);
await performAction('clickButton', confirmYourPayment.confirmButton);
await performValidation('mainHeader', serviceRequest.paymentSuccessMainHeader);
});
test('Fee And Pay - Cancel Payment from You Card Details Page @nightly @feeAndPay', async () => {
await performAction('clickButton', serviceRequest.payNowLink);
await performAction('selectPaymentByCard', {
amountLabel: serviceRequest.amountToPayLabel,
payByOption: serviceRequest.payByCardRadioOption,
continueButton: serviceRequest.continueButton
});
await performValidation('mainHeader', enterPaymentDetails.mainHeader);
await performAction('clickButton', enterPaymentDetails.cancelPaymentButton);
await performValidation('mainHeader', cancelPayment.mainHeader);
});
test('Fee And Pay - Cancel Payment from Confirm Card Details Page @nightly @feeAndPay', async () => {
await performAction('clickButton', serviceRequest.payNowLink);
await performAction('selectPaymentByCard', {
amountLabel: serviceRequest.amountToPayLabel,
payByOption: serviceRequest.payByCardRadioOption,
continueButton: serviceRequest.continueButton
});
await performValidation('mainHeader', enterPaymentDetails.mainHeader);
await performAction('enterPaymentDetails', {
cardInput: enterPaymentDetails.cardNoInputText,
monthInput: enterPaymentDetails.monthTextInput,
yearInput: enterPaymentDetails.yearTextInput,
nameInput: enterPaymentDetails.nameOnCardTextInput,
cardSecInput: enterPaymentDetails.cardSecurityCodeTextInput,
address1Input: enterPaymentDetails.addressLine1TextInput,
address2Input: enterPaymentDetails.addressLine2TextInput,
townInput: enterPaymentDetails.TownOrCityTextInput,
countryInput: enterPaymentDetails.countryTextInput,
postCodeInput: enterPaymentDetails.postcodeTextInput,
emailInput: enterPaymentDetails.emailTextInput
});
await performValidation('mainHeader', confirmYourPayment.mainHeader);
await performAction('clickButton', confirmYourPayment.cancelPaymentButton);
await performValidation('mainHeader', cancelPayment.mainHeader);
});
});