-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGetFileImportDetails.feature
More file actions
159 lines (128 loc) · 8.99 KB
/
GetFileImportDetails.feature
File metadata and controls
159 lines (128 loc) · 8.99 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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
@base @shared @getfileimportdetails
Feature: GetFileImportDetails
Background:
Given I create the following api scopes
| Name | DisplayName | Description |
| estateManagement | Estate Managememt REST Scope | A scope for Estate Managememt REST |
| transactionProcessor | Transaction Processor REST Scope | A scope for Transaction Processor REST |
| voucherManagement | Voucher Management REST Scope | A scope for Voucher Management REST |
| fileProcessor | File Processor REST Scope | A scope for File Processor REST |
Given the following api resources exist
| Name | DisplayName | Secret | Scopes | UserClaims |
| estateManagement | Estate Managememt REST | Secret1 | estateManagement | MerchantId, EstateId, role |
| transactionProcessor | Transaction Processor REST | Secret1 | transactionProcessor | |
| voucherManagement | Voucher Management REST | Secret1 | voucherManagement | |
| fileProcessor | File Processor REST | Secret1 | fileProcessor | |
Given the following clients exist
| ClientId | ClientName | Secret | Scopes | GrantTypes |
| serviceClient | Service Client | Secret1 | estateManagement,transactionProcessor,voucherManagement,fileProcessor | client_credentials |
Given I have a token to access the estate management and transaction processor resources
| ClientId |
| serviceClient |
Given I have created the following estates
| EstateName |
| Test Estate 1 |
Given I have created the following operators
| EstateName | OperatorName | RequireCustomMerchantNumber | RequireCustomTerminalNumber |
| Test Estate 1 | Safaricom | True | True |
| Test Estate 1 | Voucher | True | True |
And I have assigned the following operators to the estates
| EstateName | OperatorName |
| Test Estate 1 | Safaricom |
| Test Estate 1 | Voucher |
Given I create a contract with the following values
| EstateName | OperatorName | ContractDescription |
| Test Estate 1 | Safaricom | Safaricom Contract |
| Test Estate 1 | Voucher | Hospital 1 Contract |
When I create the following Products
| EstateName | OperatorName | ContractDescription | ProductName | DisplayText | Value | ProductType |
| Test Estate 1 | Safaricom | Safaricom Contract | Variable Topup | Custom | | MobileTopup |
| Test Estate 1 | Voucher | Hospital 1 Contract | 10 KES | 10 KES | | Voucher |
When I add the following Transaction Fees
| EstateName | OperatorName | ContractDescription | ProductName | CalculationType | FeeDescription | Value |
| Test Estate 1 | Safaricom | Safaricom Contract | Variable Topup | Fixed | Merchant Commission | 2.50 |
Given I create the following merchants
| MerchantName | AddressLine1 | Town | Region | Country | ContactName | EmailAddress | EstateName |
| Test Merchant 1 | Address Line 1 | TestTown | Test Region | United Kingdom | Test Contact 1 | [email protected] | Test Estate 1 |
| Test Merchant 2 | Address Line 1 | TestTown | Test Region | United Kingdom | Test Contact 1 | [email protected] | Test Estate 1 |
Given I have assigned the following operator to the merchants
| OperatorName | MerchantName | MerchantNumber | TerminalNumber | EstateName |
| Safaricom | Test Merchant 1 | 00000001 | 10000001 | Test Estate 1 |
| Voucher | Test Merchant 1 | 00000001 | 10000001 | Test Estate 1 |
| Safaricom | Test Merchant 2 | 00000002 | 10000002 | Test Estate 1 |
| Voucher | Test Merchant 2 | 00000002 | 10000002 | Test Estate 1 |
Given I have assigned the following devices to the merchants
| DeviceIdentifier | MerchantName | EstateName |
| 123456780 | Test Merchant 1 | Test Estate 1 |
| 123456781 | Test Merchant 2 | Test Estate 1 |
When I add the following contracts to the following merchants
| EstateName | MerchantName | ContractDescription |
| Test Estate 1 | Test Merchant 1 | Safaricom Contract |
| Test Estate 1 | Test Merchant 1 | Hospital 1 Contract |
| Test Estate 1 | Test Merchant 2 | Safaricom Contract |
| Test Estate 1 | Test Merchant 2 | Hospital 1 Contract |
Given I make the following manual merchant deposits
| Reference | Amount | DateTime | MerchantName | EstateName |
| Deposit1 | 300.00 | Today | Test Merchant 1 | Test Estate 1 |
| Deposit1 | 300.00 | Today | Test Merchant 2 | Test Estate 1 |
@PRTest1
@Nightly1
Scenario: Get File Import Log Details
Given I have a file named 'SafarcomTopup1.txt' with the following contents
| Column1 | Column2 | Column3 |
| H | 20210508 | |
| D | 07777777775 | 100 |
| T | 1 | |
And I upload this file for processing
| EstateName | MerchantName | FileProfileId | UserId |
| Test Estate 1 | Test Merchant 1 | B2A59ABF-293D-4A6B-B81B-7007503C3476 | ABA59ABF-293D-4A6B-B81B-7007503C3476 |
Given I have a file named 'SafarcomTopup2.txt' with the following contents
| Column1 | Column2 | Column3 |
| H | 20210508 | |
| D | 07777777776 | 150 |
| T | 1 | |
And I upload this file for processing
| EstateName | MerchantName | FileProfileId | UserId |
| Test Estate 1 | Test Merchant 2 | B2A59ABF-293D-4A6B-B81B-7007503C3476 | ABA59ABF-293D-4A6B-B81B-7007503C3476 |
Given I have a file named 'VoucherIssue1.txt' with the following contents
| Column1 | Column2 | Column3 | Column4 |
| H | 20210508 | | |
| D | Hospital 1 | 07777777775 | 10 |
| D | Hospital 1 | [email protected] | 10 |
| T | 1 | | |
And I upload this file for processing
| EstateName | MerchantName | FileProfileId | UserId |
| Test Estate 1 | Test Merchant 1 | 8806EDBC-3ED6-406B-9E5F-A9078356BE99 | ABA59ABF-293D-4A6B-B81B-7007503C3476 |
When I get the 'Test Estate 1' import logs between 'Yesterday' and 'Today' the following data is returned
| ImportLogDate | FileCount |
| Today | 3 |
When I get the 'Test Estate 1' import log for 'Today' the following file information is returned
| MerchantName | OriginalFileName |
| Test Merchant 1 | SafarcomTopup1.txt |
| Test Merchant 2 | SafarcomTopup2.txt |
| Test Merchant 1 | VoucherIssue1.txt |
When I get the file 'SafarcomTopup1.txt' for Estate 'Test Estate 1' the following file information is returned
| ProcessingCompleted | NumberOfLines | TotaLines | SuccessfulLines | IgnoredLines | FailedLines | NotProcessedLines |
| True | 3 | 3 | 1 | 2 | 0 | 0 |
When I get the file 'SafarcomTopup1.txt' for Estate 'Test Estate 1' the following file lines are returned
| LineNumber | Data | Result |
| 1 | H,20210508, | Ignored |
| 2 | D,07777777775,100 | Successful |
| 3 | T,1, | Ignored |
When I get the file 'SafarcomTopup2.txt' for Estate 'Test Estate 1' the following file information is returned
| ProcessingCompleted | NumberOfLines | TotaLines | SuccessfulLines | IgnoredLines | FailedLines | NotProcessedLines |
| True | 3 | 3 | 1 | 2 | 0 | 0 |
When I get the file 'SafarcomTopup2.txt' for Estate 'Test Estate 1' the following file lines are returned
| LineNumber | Data | Result |
| 1 | H,20210508, | Ignored |
| 2 | D,07777777776,150 | Successful |
| 3 | T,1, | Ignored |
When I get the file 'VoucherIssue1.txt' for Estate 'Test Estate 1' the following file information is returned
| ProcessingCompleted | NumberOfLines | TotaLines | SuccessfulLines | IgnoredLines | FailedLines | NotProcessedLines |
| True | 4 | 4 | 2 | 2 | 0 | 0 |
When I get the file 'VoucherIssue1.txt' for Estate 'Test Estate 1' the following file lines are returned
| LineNumber | Data | Result |
| 1 | H,20210508,, | Ignored |
| 2 | D,Hospital 1,07777777775,10 | Successful |
| 3 | D,Hospital 1,[email protected],10 | Successful |
| 4 | T,1,, | Ignored |