Skip to content

Commit eee7abf

Browse files
Removed buttonWrapperClass argument from getFormButtonByTypeWithText
1 parent 84e2da6 commit eee7abf

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

cypress/support/commands/element_selectors.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,21 @@
44
* @param {Object} options - The options object.
55
* @param {string} options.buttonText - The text content of the button (required).
66
* @param {string} [options.buttonType='button'] - The HTML button type (e.g., 'button', 'submit', 'reset'). Defaults to 'button'.
7-
* @param {string} [options.buttonWrapperClass='bx--btn-set'] - The CSS class of the wrapper element containing the buttons. Defaults to 'bx--btn-set'.
87
* @returns {Element} The matched button element.
98
* @throws {Error} If buttonText is not provided.
109
*
1110
* Example:
1211
* cy.getFormButtonByTypeWithText({ buttonText: 'Save Changes' });
1312
* cy.getFormButtonByTypeWithText({ buttonText: 'Submit', buttonType: 'submit' });
14-
* cy.getFormButtonByTypeWithText({ buttonText: 'Cancel', buttonWrapperClass: 'custom-wrapper' });
1513
*/
1614
Cypress.Commands.add(
1715
'getFormButtonByTypeWithText',
18-
({ buttonType = 'button', buttonText, buttonWrapperClass = 'bx--btn-set' } = {}) => {
16+
({ buttonType = 'button', buttonText } = {}) => {
1917
if (!buttonText) {
2018
cy.logAndThrowError('buttonText is required');
2119
}
2220
return cy.contains(
23-
`#main-content .${buttonWrapperClass} button[type="${buttonType}"]`,
21+
`#main-content button[type="${buttonType}"]`,
2422
buttonText
2523
);
2624
}

0 commit comments

Comments
 (0)