@@ -198,19 +198,22 @@ Cypress.Commands.add('validateFormFields', (fieldConfigs) => {
198198 * @param {string } buttonConfigs[].buttonText - The text of the button
199199 * @param {string } [buttonConfigs[].buttonType='button'] - The type of button (e.g., 'submit', 'reset')
200200 * @param {boolean } [buttonConfigs[].shouldBeDisabled=false] - Whether the button should be disabled
201+ * @param {string } [buttonConfigs[].buttonWrapperClass='bx--btn-set'] - The CSS class of the wrapper element containing the buttons
201202 *
202203 * Example:
203204 * cy.validateFormFooterButtons([
204205 * { [BUTTON_CONFIG_KEYS.BUTTON_TEXT]: 'Cancel' },
205206 * { [BUTTON_CONFIG_KEYS.BUTTON_TEXT]: 'Reset', [BUTTON_CONFIG_KEYS.SHOULD_BE_DISABLED]: true },
206- * { [BUTTON_CONFIG_KEYS.BUTTON_TEXT]: 'Submit', [BUTTON_CONFIG_KEYS.BUTTON_TYPE]: 'submit' }
207+ * { [BUTTON_CONFIG_KEYS.BUTTON_TEXT]: 'Submit', [BUTTON_CONFIG_KEYS.BUTTON_TYPE]: 'submit' },
208+ * { [BUTTON_CONFIG_KEYS.BUTTON_TEXT]: 'Save', [BUTTON_CONFIG_KEYS.BUTTON_WRAPPER_CLASS]: 'custom-wrapper' }
207209 * ]);
208210 *
209211 * Or using regular object keys:
210212 * cy.validateFormFooterButtons([
211213 * { buttonText: 'Cancel' },
212214 * { buttonText: 'Reset', shouldBeDisabled: true },
213- * { buttonText: 'Submit', buttonType: 'submit' }
215+ * { buttonText: 'Submit', buttonType: 'submit' },
216+ * { buttonText: 'Save', buttonWrapperClass: 'custom-wrapper' }
214217 * ]);
215218 *
216219 * Both approaches work but using config-keys object(BUTTON_CONFIG_KEYS) is recommended to avoid typos and unknown keys
@@ -231,6 +234,7 @@ Cypress.Commands.add('validateFormFooterButtons', (buttonConfigs) => {
231234 const buttonType = config [ BUTTON_CONFIG_KEYS . BUTTON_TYPE ] || 'button' ;
232235 const shouldBeDisabled =
233236 config [ BUTTON_CONFIG_KEYS . SHOULD_BE_DISABLED ] || false ;
237+ const buttonWrapperClass = config [ BUTTON_CONFIG_KEYS . BUTTON_WRAPPER_CLASS ] ;
234238
235239 if ( ! buttonText ) {
236240 cy . logAndThrowError (
@@ -242,6 +246,7 @@ Cypress.Commands.add('validateFormFooterButtons', (buttonConfigs) => {
242246 . getFormFooterButtonByTypeWithText ( {
243247 buttonText,
244248 buttonType,
249+ buttonWrapperClass,
245250 } )
246251 . should ( 'be.visible' ) ;
247252
0 commit comments