-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathApplicationsActionBar.cy.ts
More file actions
261 lines (238 loc) · 7.37 KB
/
ApplicationsActionBar.cy.ts
File metadata and controls
261 lines (238 loc) · 7.37 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
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
/// <reference types="cypress" />
import { loginIfNeeded } from "../support/auth";
import { ApplicationsListPage } from "../pages/ApplicationDetailsPage";
describe("Unity Login and check data from CHEFS", () => {
const page = new ApplicationsListPage();
// Column visibility test data - organized by scroll position for maintainability
const COLUMN_VISIBILITY_DATA = {
scrollPosition0: [
"Applicant Name",
"Category",
"Submission #",
"Submission Date",
"Status",
"Sub-Status",
"Community",
"Requested Amount",
"Approved Amount",
"Project Name",
"Applicant Id",
],
scrollPosition1500: [
"Tags",
"Assignee",
"SubSector",
"Economic Region",
"Regional District",
"Registered Organization Number",
"Org Book Status",
],
scrollPosition3000: [
"Project Start Date",
"Project End Date",
"Projected Funding Total",
"Total Paid Amount $",
"Project Electoral District",
"Applicant Electoral District",
],
scrollPosition4500: [
"Forestry or Non-Forestry",
"Forestry Focus",
"Acquisition",
"City",
"Community Population",
"Likelihood of Funding",
"Total Score",
],
scrollPosition6000: [
"Assessment Result",
"Recommended Amount",
"Due Date",
"Owner",
"Decision Date",
"Project Summary",
"Organization Type",
"Business Number",
],
scrollPosition7500: [
"Due Diligence Status",
"Decline Rationale",
"Contact Full Name",
"Contact Title",
"Contact Email",
"Contact Business Phone",
"Contact Cell Phone",
],
scrollPosition9000: [
"Signing Authority Full Name",
"Signing Authority Title",
"Signing Authority Email",
"Signing Authority Business Phone",
"Signing Authority Cell Phone",
"Place",
"Risk Ranking",
"Notes",
"Red-Stop",
"Indigenous",
"FYE Day",
"FYE Month",
"Payout",
"Unity Application Id",
],
};
// Columns to toggle during the test - organized for scalability
const COLUMNS_TO_TOGGLE = {
// Columns that need single toggle (off by default, turn on)
singleToggle: [
"% of Total Project Budget",
"Acquisition",
"Applicant Electoral District",
"Assessment Result",
"Business Number",
"City",
"Community Population",
"Contact Business Phone",
"Contact Cell Phone",
"Contact Email",
"Contact Full Name",
"Contact Title",
"Decision Date",
"Decline Rationale",
"Due Date",
"Due Diligence Status",
"Economic Region",
"Forestry Focus",
"Forestry or Non-Forestry",
"FYE Day",
"FYE Month",
"Indigenous",
"Likelihood of Funding",
"Non-Registered Organization Name",
"Notes",
"Org Book Status",
"Organization Type",
"Other Sector/Sub/Industry Description",
"Owner",
"Payout",
"Place",
"Project Electoral District",
"Project End Date",
"Project Start Date",
"Project Summary",
"Projected Funding Total",
"Recommended Amount",
"Red-Stop",
"Regional District",
"Registered Organization Name",
"Registered Organization Number",
"Risk Ranking",
"Sector",
"Signing Authority Business Phone",
"Signing Authority Cell Phone",
"Signing Authority Email",
"Signing Authority Full Name",
"Signing Authority Title",
"SubSector",
"Total Paid Amount $",
"Total Project Budget",
"Total Score",
"Unity Application Id",
],
// Columns that need double toggle (on by default, toggle off then on)
doubleToggle: [
"Applicant Id",
"Applicant Name",
"Approved Amount",
"Assignee",
"Category",
"Community",
"Project Name",
"Requested Amount",
"Status",
"Sub-Status",
"Submission #",
"Submission Date",
"Tags",
],
};
// TEST renders the Submission tab inside an open shadow root (Form.io).
// Enabling this makes cy.get / cy.contains pierce shadow DOM consistently across envs.
before(() => {
Cypress.config("includeShadowDom", true);
loginIfNeeded({ timeout: 20000 });
});
it("Switch to Default Grants Program if available", () => {
page.switchToGrantProgram("Default Grants Program");
});
it("Tests the existence and functionality of the Submitted Date From and Submitted Date To filters", () => {
// Set date filters using page object methods
page
.setSubmittedFromDate("2022-01-01")
.waitForTableRefresh()
.setSubmittedToDate(page.getTodayIsoLocal())
.waitForTableRefresh();
});
// With no rows selected verify the visibility of Filter, Export, Save View, and Columns.
it("Verify the action buttons are visible with no rows selected", () => {
// Placeholder for future implementation
});
// With one row selected verify the visibility of Filter, Export, Save View, and Columns.
it("Verify the action buttons are visible with one row selected", () => {
// Placeholder for future implementation
});
it("Clicks Payment and force-closes the modal", () => {
// Ensure table has data and select two rows using page object
page
.verifyTableHasData()
.selectMultipleRows([0, 1])
.verifyActionBarExists()
.clickPaymentButton()
.waitForPaymentModalVisible()
.closePaymentModal()
.verifyPaymentModalClosed();
// Verify right-side buttons are still usable
page
.verifyDynamicButtonContainerExists()
.verifyExportButtonVisible()
.verifySaveViewButtonVisible()
.verifyColumnsButtonVisible();
});
// Walk the Columns menu and toggle each column on, verifying the column is visible.
it("Verify all columns in the menu are visible when and toggled on.", () => {
// Reset to default view and open columns menu
page.closeOpenDropdowns().resetToDefaultView().openColumnsMenu();
// Toggle all single-toggle columns (off by default, turn on)
page.toggleColumns(COLUMNS_TO_TOGGLE.singleToggle);
// Toggle all double-toggle columns (toggle twice to ensure visibility)
COLUMNS_TO_TOGGLE.doubleToggle.forEach((column) => {
page.clickColumnsItem(column).clickColumnsItem(column);
});
// Close the columns menu
page.closeColumnsMenu();
// Verify columns by scrolling through the table horizontally
page
.scrollTableHorizontally(0)
.assertVisibleHeadersInclude(COLUMN_VISIBILITY_DATA.scrollPosition0);
page
.scrollTableHorizontally(1500)
.assertVisibleHeadersInclude(COLUMN_VISIBILITY_DATA.scrollPosition1500);
page
.scrollTableHorizontally(3000)
.assertVisibleHeadersInclude(COLUMN_VISIBILITY_DATA.scrollPosition3000);
page
.scrollTableHorizontally(4500)
.assertVisibleHeadersInclude(COLUMN_VISIBILITY_DATA.scrollPosition4500);
page
.scrollTableHorizontally(6000)
.assertVisibleHeadersInclude(COLUMN_VISIBILITY_DATA.scrollPosition6000);
page
.scrollTableHorizontally(7500)
.assertVisibleHeadersInclude(COLUMN_VISIBILITY_DATA.scrollPosition7500);
page
.scrollTableHorizontally(9000)
.assertVisibleHeadersInclude(COLUMN_VISIBILITY_DATA.scrollPosition9000);
});
it("Verify Logout", () => {
cy.logout();
});
});