@@ -90,13 +90,19 @@ describe("Reports > Activity Log > Home", () => {
90
90
) ;
91
91
} ) ;
92
92
93
- const from = moment ( )
93
+ /**
94
+ * Note: Date needs to be hard-coded here to make sure that when the datepicker opens,
95
+ * the cypress test runner can easily pick the date from the datepicker modal
96
+ * instead of having to determine how many times to click the next month arrow everytime
97
+ * to get to the current date.
98
+ */
99
+ const from = moment ( "2022-07-14" )
94
100
. hours ( 0 )
95
101
. minute ( 0 )
96
102
. second ( 0 )
97
103
. millisecond ( 0 )
98
104
. format ( "x" ) ;
99
- const to = moment ( )
105
+ const to = moment ( "2022-07-14" )
100
106
. add ( 1 , "day" )
101
107
. hours ( 0 )
102
108
. minute ( 0 )
@@ -105,7 +111,7 @@ describe("Reports > Activity Log > Home", () => {
105
111
. format ( "x" ) ;
106
112
107
113
// Set daterange filter
108
- cy . getBySelector ( "dateRange_default " ) . should ( "exist" ) . click ( ) ;
114
+ cy . getBySelector ( "dateRange_selected " ) . should ( "exist" ) . click ( ) ;
109
115
cy . getBySelector ( "dateRange_picker" ) . should ( "exist" ) ;
110
116
cy . get ( `[data-timestamp=${ from } ]` ) . should ( "exist" ) . click ( ) ;
111
117
cy . get ( `[data-timestamp=${ to } ]` ) . should ( "exist" ) . click ( ) ;
@@ -118,8 +124,10 @@ describe("Reports > Activity Log > Home", () => {
118
124
cy . getBySelector ( "resourceType_default" ) . should ( "exist" ) . click ( ) ;
119
125
cy . getBySelector ( "filter_value_content" ) . should ( "exist" ) . click ( ) ;
120
126
121
- const expectedFromDate = moment ( ) . format ( "YYYY-MM-DD" ) ;
122
- const expectedToDate = moment ( ) . add ( 1 , "day" ) . format ( "YYYY-MM-DD" ) ;
127
+ const expectedFromDate = moment ( "2022-07-14" ) . format ( "YYYY-MM-DD" ) ;
128
+ const expectedToDate = moment ( "2022-07-14" )
129
+ . add ( 1 , "day" )
130
+ . format ( "YYYY-MM-DD" ) ;
123
131
124
132
cy . location ( "search" ) . should (
125
133
"eq" ,
@@ -180,13 +188,19 @@ describe("Reports > Activity Log > Home", () => {
180
188
} ) ;
181
189
} ) . as ( "request" ) ;
182
190
183
- const from = moment ( )
191
+ /**
192
+ * Note: Date needs to be hard-coded here to make sure that when the datepicker opens,
193
+ * the cypress test runner can easily pick the date from the datepicker modal
194
+ * instead of having to determine how many times to click the next month arrow everytime
195
+ * to get to the current date.
196
+ */
197
+ const from = moment ( "2022-07-14" )
184
198
. hours ( 0 )
185
199
. minute ( 0 )
186
200
. second ( 0 )
187
201
. millisecond ( 0 )
188
202
. format ( "x" ) ;
189
- const to = moment ( )
203
+ const to = moment ( "2022-07-14" )
190
204
. add ( 1 , "day" )
191
205
. hours ( 0 )
192
206
. minute ( 0 )
@@ -195,7 +209,7 @@ describe("Reports > Activity Log > Home", () => {
195
209
. format ( "x" ) ;
196
210
197
211
// Set daterange filter
198
- cy . getBySelector ( "dateRange_default " ) . should ( "exist" ) . click ( ) ;
212
+ cy . getBySelector ( "dateRange_selected " ) . should ( "exist" ) . click ( ) ;
199
213
cy . getBySelector ( "dateRange_picker" ) . should ( "exist" ) ;
200
214
cy . get ( `[data-timestamp=${ from } ]` ) . should ( "exist" ) . click ( ) ;
201
215
cy . get ( `[data-timestamp=${ to } ]` ) . should ( "exist" ) . click ( ) ;
0 commit comments