@@ -332,7 +332,58 @@ test.describe('error handling', () => {
332
332
await expect . soft ( errorModal ) . not . toBeAttached ( ) ;
333
333
await expect . soft ( RecordeditLocators . getPageTitle ( page ) ) . toHaveText ( 'Create 1 Accommodations record' ) ;
334
334
} ) ;
335
+ } ) ;
336
+
337
+ test ( 'navigating to a page with invalid sort criteria' , async ( { page, baseURL } , testInfo ) => {
338
+ const errorModal = ModalLocators . getErrorModal ( page ) ;
339
+
340
+ await test . step ( 'should display the Invalid Sort Criteria error' , async ( ) => {
341
+ await page . goto ( getChaiseURL ( APP_NAMES . RECORDEDIT , 'accommodation' , baseURL , testInfo ) + '/id=2002@sort(some_column_that_does_not_exist)' ) ;
342
+ await expect . soft ( errorModal ) . toBeVisible ( ) ;
343
+ await testModalTitleAndText ( errorModal ,
344
+ 'Invalid Sort Criteria' ,
345
+ 'Given column name `some_column_that_does_not_exist` in sort is not valid.Click OK to reload this page without Invalid Sort Criteria.'
346
+ ) ;
347
+ } ) ;
348
+
349
+ await test . step ( 'On click of OK button the page should reload the page without the sort.' , async ( ) => {
350
+ await ModalLocators . getOkButton ( errorModal ) . click ( ) ;
351
+ await RecordeditLocators . waitForRecordeditPageReady ( page ) ;
352
+ await expect . soft ( errorModal ) . not . toBeAttached ( ) ;
353
+ await expect . soft ( RecordeditLocators . getPageTitle ( page ) ) . toHaveText ( 'Edit Accommodations: Sherathon Hotel' ) ;
354
+ } ) ;
355
+ } ) ;
356
+
357
+ test ( 'navigating to a page with invalid sort criteria and valid facets' , async ( { page, baseURL } , testInfo ) => {
358
+ const errorModal = ModalLocators . getErrorModal ( page ) ;
359
+
360
+ await test . step ( 'should display the Invalid Page Criteria error' , async ( ) => {
361
+ /**
362
+ * facet blob:
363
+ * {
364
+ * "and": [
365
+ * {
366
+ * "source": ["id"],
367
+ * "choices": ["2001", "2003"]
368
+ * }
369
+ * ]
370
+ * }
371
+ */
372
+ const facet = 'N4IghgdgJiBcDaoDOB7ArgJwMYFM7xAEsYBdAGhCwAsVDcl8QAmABhYEYQLWWBmEEgF8hQA' ;
373
+ await page . goto ( getChaiseURL ( APP_NAMES . RECORDEDIT , 'accommodation' , baseURL , testInfo ) + '/*::facets::' + facet + '@sort(invalid_col)' ) ;
374
+ await expect . soft ( errorModal ) . toBeVisible ( ) ;
375
+ await testModalTitleAndText ( errorModal ,
376
+ 'Invalid Sort Criteria' ,
377
+ 'Given column name `invalid_col` in sort is not valid.Click OK to reload this page without Invalid Sort Criteria.'
378
+ ) ;
379
+ } ) ;
335
380
381
+ await test . step ( 'On click of OK button the page should reload the page without the sort but keep the facets.' , async ( ) => {
382
+ await ModalLocators . getOkButton ( errorModal ) . click ( ) ;
383
+ await RecordeditLocators . waitForRecordeditPageReady ( page ) ;
384
+ await expect . soft ( errorModal ) . not . toBeAttached ( ) ;
385
+ await expect . soft ( RecordeditLocators . getPageTitle ( page ) ) . toHaveText ( 'Edit 2 Accommodations records' ) ;
386
+ } ) ;
336
387
} ) ;
337
388
338
389
test ( 'editting a record without changing data' , async ( { baseURL, page } , testInfo ) => {
0 commit comments