Skip to content

Commit dd49903

Browse files
Added provider_helper_commands section in readme
1 parent 2b927ca commit dd49903

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

cypress/README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,28 @@ ManageIQ implements the following cypress extensions:
9494
* `cy.validateFormFields(fieldConfigs)` - validates form input fields based on provided configurations. `fieldConfigs` is an array of field configuration objects with properties: `id` (required) - the ID of the form field, `fieldType` (optional, default: 'input') - the type of field ('input', 'select', 'textarea'), `inputFieldType` (optional, default: 'text') - the type of input field ('text', 'password', 'number'), `shouldBeDisabled` (optional, default: false) - whether the field should be disabled, `expectedValue` (optional) - the expected value of the field. e.g. `cy.validateFormFields([{ id: 'name', shouldBeDisabled: true }, { id: 'role', fieldType: 'select', expectedValue: 'admin' }]);` or using constants: `cy.validateFormFields([{ [FIELD_CONFIG_KEYS.ID]: 'email', [FIELD_CONFIG_KEYS.INPUT_FIELD_TYPE]: 'email' }, { [FIELD_CONFIG_KEYS.ID]: 'name', [FIELD_CONFIG_KEYS.SHOULD_BE_DISABLED]: true }]);`
9595
* `cy.validateFormFooterButtons(buttonConfigs)` - validates form buttons based on provided configurations. `buttonConfigs` is an array of button configuration objects with properties: `buttonText` (required) - the text of the button, `buttonType` (optional, default: 'button') - the type of button (e.g., 'submit', 'reset'), `shouldBeDisabled` (optional, default: false) - whether the button should be disabled. e.g. `cy.validateFormFooterButtons([{ buttonText: 'Cancel' }, { buttonText: 'Submit', buttonType: 'submit', shouldBeDisabled: true }]);` or using constants: `cy.validateFormFooterButtons([{ [BUTTON_CONFIG_KEYS.TEXT]: 'Cancel' }]);`
9696

97+
##### provider_helper_commands
98+
99+
* `cy.fillCommonFormFields(providerConfig, nameValue)` - fills common form fields that are present in all provider forms. `providerConfig` is the provider configuration object. `nameValue` is the name to use for the provider.
100+
* `cy.fillFormFields(fields, values)` - fills form fields based on field definitions and values. `fields` is an array of field definition objects. `values` is an object containing field values.
101+
* `cy.fillProviderForm(providerConfig, nameValue, hostValue)` - fills a provider form based on provider configuration. `providerConfig` is the provider configuration object. `nameValue` is the name to use for the provider. `hostValue` is the hostname to use for the provider.
102+
* `cy.validateCommonFormFields(providerType, isEdit)` - validates common form fields that are present in all provider forms. `providerType` is the type of provider to be validated. `isEdit` is whether the form is in edit mode.
103+
* `cy.validateFormFields(fields, isEdit)` - validates form fields based on field definitions. `fields` is an array of field definition objects. `isEdit` is whether the form is in edit mode.
104+
* `cy.validateFormButtons(providerType, isEdit)` - validates form buttons (validate, add/save, reset, cancel). `providerType` is the type of provider to be validated. `isEdit` is whether the form is in edit mode.
105+
* `cy.validateProviderForm(providerConfig, isEdit)` - validates a provider form based on provider configuration. `providerConfig` is the provider configuration object. `isEdit` is whether the form is in edit mode.
106+
* `cy.updateProviderFieldsForEdit(providerConfig)` - updates provider fields for edit validation tests based on provider type. `providerConfig` is the provider configuration object.
107+
* `cy.selectCreatedProvider(providerName)` - selects a created provider from the data table. `providerName` is the name of the provider to select.
108+
* `cy.addProviderAndOpenEditForm(providerConfig, nameValue, hostValue)` - adds a provider and opens the edit form. `providerConfig` is the provider configuration object. `nameValue` is the name to use for the provider. `hostValue` is the hostname to use for the provider.
109+
* `cy.interceptAddAzureStackProviderApi()` - intercepts the API call when adding an Azure Stack provider and forces a successful response.
110+
* `cy.addAzureStackProviderAndOpenEditForm(providerConfig, nameValue, hostValue)` - special handling for Azure Stack provider which requires additional API interception. `providerConfig` is the provider configuration object. `nameValue` is the name to use for the provider. `hostValue` is the hostname to use for the provider.
111+
* `cy.assertValidationFailureMessage()` - asserts validation failure message.
112+
* `cy.assertValidationSuccessMessage()` - asserts validation success message.
113+
* `cy.assertNameAlreadyExistsError()` - asserts name already exists error.
114+
* `cy.validate({ stubErrorResponse, errorMessage })` - performs validation with optional error response stubbing. `stubErrorResponse` is whether to stub an error response. `errorMessage` is the error message to show.
115+
* `cy.selectProviderAndDeleteWithOptionalFlashMessage({ createdProviderName, assertDeleteFlashMessage })` - deletes a provider with optional flash message check. `createdProviderName` is the name of the provider to delete. `assertDeleteFlashMessage` is whether to assert the delete flash message.
116+
* `cy.cleanUp({ createdProviderName })` - cleans up a provider by deleting it. `createdProviderName` is the name of the provider to clean up.
117+
* `generateProviderTests(providerConfig)` - generates all test suites for a provider. `providerConfig` is the provider configuration object.
118+
97119
#### Assertions
98120

99121
* `cy.expect_explorer_title(title)` - check that the title on an explorer screen matches the provided title. `title`: String for the title.

0 commit comments

Comments
 (0)