Skip to content

Commit dfcb373

Browse files
Refactored namespace deletion to use direct API call
1 parent 4139520 commit dfcb373

File tree

1 file changed

+15
-9
lines changed

1 file changed

+15
-9
lines changed

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

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -281,15 +281,21 @@ describe('Automate operations on Namespaces: Automation -> Embedded Automate ->
281281
});
282282

283283
afterEach(() => {
284-
// Selecting the created domain(Test_Domain) from the accordion list items
285-
selectAccordionTree(dataStoreAccordionItem);
286-
cy.accordionItem(domainName);
287-
cy.wait('@getCreatedDomainInfo');
288-
// Removing the domain
289-
cy.expect_browser_confirm_with_text({
290-
confirmTriggerFn: () =>
291-
cy.toolbar(toolbarConfiguration, toolbarRemoveDomain),
292-
containsText: browserConfirmRemoveMessage,
284+
// retrieve the id and token from the aliased state
285+
// to invoke api for deleting the created domain
286+
cy.get('@idAndToken').then((data) => {
287+
const { domainId, csrfToken } = data;
288+
if (domainId && csrfToken) {
289+
cy.request({
290+
method: 'POST',
291+
url: `/miq_ae_class/x_button/${domainId}?pressed=miq_ae_domain_delete`,
292+
headers: {
293+
'X-CSRF-Token': csrfToken,
294+
},
295+
}).then((response) => {
296+
expect(response.status).to.eq(200);
297+
});
298+
}
293299
});
294300
});
295301
});

0 commit comments

Comments
 (0)