Skip to content

Commit b1b55db

Browse files
Refactored namespace deletion to use direct API call
1 parent 13eb407 commit b1b55db

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

296296
afterEach(() => {
297-
// Selecting the created domain(Test_Domain) from the accordion list items
298-
selectAccordionTree(dataStoreAccordionItem);
299-
cy.accordionItem(domainName);
300-
cy.wait('@getCreatedDomainInfo');
301-
// Removing the domain
302-
cy.expect_browser_confirm_with_text({
303-
confirmTriggerFn: () =>
304-
cy.toolbar(toolbarConfiguration, toolbarRemoveDomain),
305-
containsText: browserConfirmRemoveMessage,
297+
// retrieve the id and token from the aliased state
298+
// to invoke api for deleting the created domain
299+
cy.get('@idAndToken').then((data) => {
300+
const { domainId, csrfToken } = data;
301+
if (domainId && csrfToken) {
302+
cy.request({
303+
method: 'POST',
304+
url: `/miq_ae_class/x_button/${domainId}?pressed=miq_ae_domain_delete`,
305+
headers: {
306+
'X-CSRF-Token': csrfToken,
307+
},
308+
}).then((response) => {
309+
expect(response.status).to.eq(200);
310+
});
311+
}
306312
});
307313
});
308314
});

0 commit comments

Comments
 (0)