Skip to content

Commit ffcab81

Browse files
Added expect_gtl_no_records_with_text assertion to replace gtl_no_record
1 parent 50eb002 commit ffcab81

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/* eslint-disable no-undef */
2+
3+
/**
4+
* Command to verify that the GTL (Grid/Tile/List) view displays a "no records" message.
5+
* This assertion checks that the specified text is visible within the GTL view container.
6+
*
7+
* @param {Object} params - Parameters for the command
8+
* @param {string} [params.containsText='No records'] - The text to verify in the no records message
9+
* @returns {Cypress.Chainable} A Cypress chainable that asserts the text is visible
10+
* @example
11+
* // Check for default "No records" message
12+
* cy.expect_gtl_no_records_with_text();
13+
*
14+
* @example
15+
* // Check for custom message
16+
* cy.expect_gtl_no_records_with_text({ containsText: 'No items found' });
17+
*/
18+
Cypress.Commands.add(
19+
'expect_gtl_no_records_with_text',
20+
({ containsText = 'No records' } = {}) => {
21+
return cy.contains('#miq-gtl-view', containsText).should('be.visible');
22+
}
23+
);

cypress/support/e2e.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ import './assertions/expect_rates_table.js';
6363
import './assertions/expect_search_box.js';
6464
import './assertions/expect_text.js';
6565
import './assertions/expect_title.js';
66+
import './assertions/miq_data_table_assertions.js'
6667

6768
// cypress on rails setup:
6869
// ***********************************************************

0 commit comments

Comments
 (0)