Skip to content

Commit aae8b13

Browse files
Replaced accordionItem with selectAccordionItem cypress-command
1 parent 84f8da7 commit aae8b13

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

cypress/e2e/ui/Automation/Embedded-Automate/Explorer/namespace.cy.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ const textConstants = {
4040
editNamespaceFormHeader: 'Editing Automate Namespace',
4141
namespaceFormSubHeader: 'Info',
4242

43+
// List items
44+
dataStoreAccordionItem: 'Datastore',
45+
4346
// Buttons
4447
addButton: 'Add',
4548
cancelButton: 'Cancel',
@@ -99,6 +102,7 @@ const {
99102
flashMessageNameAlreadyExists,
100103
flashMessageResetNamespace,
101104
browserConfirmRemoveMessage,
105+
dataStoreAccordionItem,
102106
nameInputFieldId,
103107
descriptionInputFieldId,
104108
namespacePathInputFieldId,
@@ -125,7 +129,10 @@ function selectAccordionTree(textValue) {
125129
'POST',
126130
new RegExp(`/miq_ae_class/tree_select\\?id=.*&text=${textValue}`)
127131
).as(aliasObject[textValue]);
128-
cy.accordionItem(textValue);
132+
// Datastore is already set in the tree path, add domain/namespace to the path
133+
const pathToTargetNode =
134+
textValue === namespaceName ? [domainName, namespaceName] : [domainName];
135+
cy.selectAccordionItem([dataStoreAccordionItem, ...pathToTargetNode]);
129136
cy.wait(`@${aliasObject[textValue]}`);
130137
}
131138

0 commit comments

Comments
 (0)