Skip to content

Commit de09d9a

Browse files
Refactored namespace deletion to use direct API call
1 parent f47d71d commit de09d9a

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
@@ -303,15 +303,21 @@ describe('Automate operations on Namespaces: Automation -> Embedded Automate ->
303303
});
304304

305305
afterEach(() => {
306-
// Selecting the created domain(Test_Domain) from the accordion list items
307-
selectAccordionTree(dataStoreAccordionItem);
308-
cy.accordionItem(domainName);
309-
cy.wait('@getCreatedDomainInfo');
310-
// Removing the domain
311-
cy.expect_browser_confirm_with_text({
312-
confirmTriggerFn: () =>
313-
cy.toolbar(toolbarConfiguration, toolbarRemoveDomain),
314-
containsText: browserConfirmRemoveMessage,
306+
// retrieve the id and token from the aliased state
307+
// to invoke api for deleting the created domain
308+
cy.get('@idAndToken').then((data) => {
309+
const { domainId, csrfToken } = data;
310+
if (domainId && csrfToken) {
311+
cy.request({
312+
method: 'POST',
313+
url: `/miq_ae_class/x_button/${domainId}?pressed=miq_ae_domain_delete`,
314+
headers: {
315+
'X-CSRF-Token': csrfToken,
316+
},
317+
}).then((response) => {
318+
expect(response.status).to.eq(200);
319+
});
320+
}
315321
});
316322
});
317323
});

0 commit comments

Comments
 (0)