Skip to content

Commit a6e81d1

Browse files
Replaced accordionItem with selectAccordionItem cypress-command
1 parent 32724ca commit a6e81d1

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',
@@ -98,6 +101,7 @@ const {
98101
flashMessageNameAlreadyExists,
99102
flashMessageResetNamespace,
100103
browserConfirmRemoveMessage,
104+
dataStoreAccordionItem,
101105
nameInputFieldId,
102106
descriptionInputFieldId,
103107
namespacePathInputFieldId,
@@ -124,7 +128,10 @@ function selectAccordionTree(textValue) {
124128
'POST',
125129
new RegExp(`/miq_ae_class/tree_select\\?id=.*&text=${textValue}`)
126130
).as(aliasObject[textValue]);
127-
cy.accordionItem(textValue);
131+
// Datastore is already set in the tree path, add domain/namespace to the path
132+
const pathToTargetNode =
133+
textValue === namespaceName ? [domainName, namespaceName] : [domainName];
134+
cy.selectAccordionItem([dataStoreAccordionItem, ...pathToTargetNode]);
128135
cy.wait(`@${aliasObject[textValue]}`);
129136
}
130137

0 commit comments

Comments
 (0)