@@ -21,12 +21,8 @@ test.describe("Out of office", () => {
21
21
await user . apiLogin ( ) ;
22
22
23
23
await page . goto ( "/settings/my-account/out-of-office" ) ;
24
- await page . waitForLoadState ( "domcontentloaded" ) ;
25
-
26
- const addOOOButton = page . getByTestId ( "add_entry_ooo" ) ;
27
- const dateButton = page . locator ( '[data-testid="date-range"]' ) ;
28
- await clickUntilDialogVisible ( addOOOButton , dateButton , page , "outOfOfficeReasonList?batch=1" ) ;
29
24
25
+ await page . getByTestId ( "add_entry_ooo" ) . click ( ) ;
30
26
await page . getByTestId ( "reason_select" ) . click ( ) ;
31
27
32
28
await page . getByTestId ( "select-option-4" ) . click ( ) ;
@@ -72,12 +68,8 @@ test.describe("Out of office", () => {
72
68
await user . apiLogin ( ) ;
73
69
74
70
await page . goto ( `/settings/my-account/out-of-office` ) ;
75
- await page . waitForLoadState ( "domcontentloaded" ) ;
76
-
77
- const addOOOButton = page . getByTestId ( "add_entry_ooo" ) ;
78
- const dateButton = page . locator ( '[data-testid="date-range"]' ) ;
79
- await clickUntilDialogVisible ( addOOOButton , dateButton , page , "outOfOfficeReasonList?batch=1" ) ;
80
71
72
+ await page . getByTestId ( "add_entry_ooo" ) . click ( ) ;
81
73
await page . getByTestId ( "reason_select" ) . click ( ) ;
82
74
83
75
await page . getByTestId ( "select-option-4" ) . click ( ) ;
@@ -212,13 +204,10 @@ test.describe("Out of office", () => {
212
204
await user . apiLogin ( ) ;
213
205
214
206
await page . goto ( "/settings/my-account/out-of-office" ) ;
215
- await page . waitForLoadState ( "domcontentloaded" ) ;
216
207
217
- const addOOOButton = page . getByTestId ( "add_entry_ooo" ) ;
218
- const dateButton = page . locator ( '[data-testid="date-range"]' ) ;
219
- await clickUntilDialogVisible ( addOOOButton , dateButton , page , "outOfOfficeReasonList?batch=1" ) ;
208
+ await page . getByTestId ( "add_entry_ooo" ) . click ( ) ;
220
209
221
- await dateButton . click ( ) ;
210
+ await page . locator ( '[data-testid="date-range"]' ) . click ( ) ;
222
211
223
212
await selectToAndFromDates ( page , "13" , "22" , true ) ;
224
213
@@ -255,13 +244,10 @@ test.describe("Out of office", () => {
255
244
await user . apiLogin ( ) ;
256
245
257
246
await page . goto ( "/settings/my-account/out-of-office" ) ;
258
- await page . waitForLoadState ( "domcontentloaded" ) ;
259
247
260
- const addOOOButton = page . getByTestId ( "add_entry_ooo" ) ;
261
- const dateButton = page . locator ( '[data-testid="date-range"]' ) ;
262
- await clickUntilDialogVisible ( addOOOButton , dateButton , page , "outOfOfficeReasonList?batch=1" ) ;
248
+ await page . getByTestId ( "add_entry_ooo" ) . click ( ) ;
263
249
264
- await dateButton . click ( ) ;
250
+ await page . locator ( '[data-testid="date-range"]' ) . click ( ) ;
265
251
266
252
await selectToAndFromDates ( page , "13" , "22" ) ;
267
253
@@ -270,8 +256,9 @@ test.describe("Out of office", () => {
270
256
await expect ( page . locator ( `data-testid=table-redirect-n-a` ) ) . toBeVisible ( ) ;
271
257
272
258
// add another entry
273
- await clickUntilDialogVisible ( addOOOButton , dateButton , page , "outOfOfficeReasonList?batch=1" ) ;
274
- await dateButton . click ( ) ;
259
+ await page . getByTestId ( "add_entry_ooo" ) . click ( ) ;
260
+
261
+ await page . locator ( '[data-testid="date-range"]' ) . click ( ) ;
275
262
276
263
await selectToAndFromDates ( page , "11" , "24" ) ;
277
264
@@ -287,13 +274,10 @@ test.describe("Out of office", () => {
287
274
await user . apiLogin ( ) ;
288
275
289
276
await page . goto ( "/settings/my-account/out-of-office" ) ;
290
- await page . waitForLoadState ( "domcontentloaded" ) ;
291
277
292
- const addOOOButton = page . getByTestId ( "add_entry_ooo" ) ;
293
- const dateButton = page . locator ( '[data-testid="date-range"]' ) ;
294
- await clickUntilDialogVisible ( addOOOButton , dateButton , page , "outOfOfficeReasonList?batch=1" ) ;
278
+ await page . getByTestId ( "add_entry_ooo" ) . click ( ) ;
295
279
296
- await dateButton . click ( ) ;
280
+ await page . locator ( '[data-testid="date-range"]' ) . click ( ) ;
297
281
298
282
await selectToAndFromDates ( page , "13" , "22" ) ;
299
283
@@ -302,8 +286,9 @@ test.describe("Out of office", () => {
302
286
await expect ( page . locator ( `data-testid=table-redirect-n-a` ) ) . toBeVisible ( ) ;
303
287
304
288
// add another entry
305
- await clickUntilDialogVisible ( addOOOButton , dateButton , page , "outOfOfficeReasonList?batch=1" ) ;
306
- await dateButton . click ( ) ;
289
+ await page . getByTestId ( "add_entry_ooo" ) . click ( ) ;
290
+
291
+ await page . locator ( '[data-testid="date-range"]' ) . click ( ) ;
307
292
308
293
await selectToAndFromDates ( page , "13" , "22" ) ;
309
294
@@ -323,13 +308,13 @@ test.describe("Out of office", () => {
323
308
324
309
//Creates 2 OOO entries:
325
310
//First OOO is created on Next month 1st - 3rd
326
- await clickUntilDialogVisible ( addOOOButton , dateButton , page , "outOfOfficeReasonList?batch=1" ) ;
311
+ await clickUntilDialogVisible ( addOOOButton , dateButton ) ;
327
312
await dateButton . click ( ) ;
328
313
await selectDateAndCreateOOO ( page , "1" , "3" ) ;
329
314
await expect ( page . locator ( `data-testid=table-redirect-n-a` ) . nth ( 0 ) ) . toBeVisible ( ) ;
330
315
331
316
//Second OOO is created on Next month 4th - 6th
332
- await clickUntilDialogVisible ( addOOOButton , dateButton , page , "outOfOfficeReasonList?batch=1" ) ;
317
+ await clickUntilDialogVisible ( addOOOButton , dateButton ) ;
333
318
await dateButton . click ( ) ;
334
319
await selectDateAndCreateOOO ( page , "4" , "6" ) ;
335
320
await expect ( page . locator ( `data-testid=table-redirect-n-a` ) . nth ( 1 ) ) . toBeVisible ( ) ;
@@ -356,7 +341,7 @@ test.describe("Out of office", () => {
356
341
const dateButton = await page . locator ( '[data-testid="date-range"]' ) ;
357
342
358
343
//As owner,OOO is created on Next month 1st - 3rd, forwarding to 'member-1'
359
- await clickUntilDialogVisible ( addOOOButton , dateButton , page , "outOfOfficeReasonList?batch=1" ) ;
344
+ await clickUntilDialogVisible ( addOOOButton , dateButton ) ;
360
345
await dateButton . click ( ) ;
361
346
await selectDateAndCreateOOO ( page , "1" , "3" , "member-1" ) ;
362
347
await expect (
@@ -367,7 +352,7 @@ test.describe("Out of office", () => {
367
352
await member1User ?. apiLogin ( ) ;
368
353
await page . goto ( "/settings/my-account/out-of-office" ) ;
369
354
await page . waitForLoadState ( ) ;
370
- await clickUntilDialogVisible ( addOOOButton , dateButton , page , "outOfOfficeReasonList?batch=1" ) ;
355
+ await clickUntilDialogVisible ( addOOOButton , dateButton ) ;
371
356
await dateButton . click ( ) ;
372
357
await selectDateAndCreateOOO ( page , "4" , "5" , "owner" ) ;
373
358
await expect ( page . locator ( `data-testid=table-redirect-${ owner . username ?? "n-a" } ` ) . nth ( 0 ) ) . toBeVisible ( ) ;
@@ -395,7 +380,7 @@ test.describe("Out of office", () => {
395
380
const dateButton = await page . locator ( '[data-testid="date-range"]' ) ;
396
381
397
382
//As owner,OOO is created on Next month 1st - 3rd, forwarding to 'member-1'
398
- await clickUntilDialogVisible ( addOOOButton , dateButton , page , "outOfOfficeReasonList?batch=1" ) ;
383
+ await clickUntilDialogVisible ( addOOOButton , dateButton ) ;
399
384
await dateButton . click ( ) ;
400
385
await selectDateAndCreateOOO ( page , "1" , "3" , "member-1" ) ;
401
386
await expect (
@@ -406,7 +391,7 @@ test.describe("Out of office", () => {
406
391
await member1User ?. apiLogin ( ) ;
407
392
await page . goto ( "/settings/my-account/out-of-office" ) ;
408
393
await page . waitForLoadState ( ) ;
409
- await clickUntilDialogVisible ( addOOOButton , dateButton , page , "outOfOfficeReasonList?batch=1" ) ;
394
+ await clickUntilDialogVisible ( addOOOButton , dateButton ) ;
410
395
await dateButton . click ( ) ;
411
396
await selectDateAndCreateOOO ( page , "2" , "5" , "owner" , 400 ) ;
412
397
await expect ( page . locator ( `text=${ t ( "booking_redirect_infinite_not_allowed" ) } ` ) ) . toBeTruthy ( ) ;
0 commit comments