From db6d8bf186a76fd52bf6442bc3709747e150dccc Mon Sep 17 00:00:00 2001 From: Alex Corey Date: Mon, 26 Aug 2024 14:29:46 -0400 Subject: [PATCH] Fixes tests --- cypress/e2e/hub/collections-detail.cy.ts | 15 +++------------ cypress/e2e/hub/collections-list.cy.ts | 3 +-- 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/cypress/e2e/hub/collections-detail.cy.ts b/cypress/e2e/hub/collections-detail.cy.ts index 6fe0bdac18..94491a3bd3 100644 --- a/cypress/e2e/hub/collections-detail.cy.ts +++ b/cypress/e2e/hub/collections-detail.cy.ts @@ -89,9 +89,7 @@ describe('Collections Details', () => { `/collections/validated/${namespace.name}/${collectionName}/details?version=1.0.0` ); cy.selectDetailsPageKebabAction('delete-version-from-system'); - cy.clickButton(/^Close$/); //Verify the version has been deleted - cy.navigateTo('hub', Collections.url); cy.getByDataCy('table-view').click(); cy.filterTableBySingleText(collectionName, true); cy.clickLink(collectionName); @@ -227,30 +225,24 @@ describe('Collections Details', () => { cy.clickButton(/^Close$/); cy.getModal().should('not.exist'); // Verify collection has been deprecated - cy.contains('span', 'Deprecated'); + cy.contains('span', 'Deprecated').should('exist'); // Undeprecate collection cy.selectDetailsPageKebabAction('undeprecate-collection'); cy.clickButton(/^Close$/); - cy.getModal().should('not.exist'); // Verify collection has been undeprecated cy.contains('span', 'Deprecated').should('not.exist'); // deprecate collection again cy.selectDetailsPageKebabAction('deprecate-collection'); cy.clickButton(/^Close$/); - cy.getModal().should('not.exist'); // Verify collection has been deprecated cy.contains('span', 'Deprecated'); cy.contains('a', namespace.name).click(); cy.contains(`[role="tab"]`, 'Collections').click(); - cy.filterTableBySingleText(collectionName, true); - cy.get(`[aria-label="Simple table"]`).within(() => { - cy.contains('td', collectionName).click(); - cy.contains('span', 'Deprecated'); - }); - cy.getByDataCy('table-view').click(); + cy.selectTableRowByCheckbox('name', collectionName, true); + cy.get(`[aria-label="Simple table"]`).within(() => { cy.getByDataCy('actions-dropdown').click(); }); @@ -265,7 +257,6 @@ describe('Collections Details', () => { cy.getModal().should('not.exist'); cy.get(`[aria-label="Simple table"]`).within(() => { - cy.contains('td', collectionName).click(); cy.contains('span', 'Deprecated').should('not.exist'); }); cy.deleteHubCollectionByName(collectionName); diff --git a/cypress/e2e/hub/collections-list.cy.ts b/cypress/e2e/hub/collections-list.cy.ts index 16af68226d..2f0839a63d 100644 --- a/cypress/e2e/hub/collections-list.cy.ts +++ b/cypress/e2e/hub/collections-list.cy.ts @@ -132,11 +132,10 @@ describe('Collections List', () => { cy.get('[data-ouia-component-id="Permanently delete collections versions"]').within(() => { cy.get('[data-ouia-component-id="confirm"]').click(); cy.get('[data-ouia-component-id="submit"]').click(); - cy.clickButton(/^Close$/); }); + cy.deleteHubCollectionByName(collectionName); } ); - cy.deleteHubCollectionByName(collectionName); }); it('can copy a version to repository and then delete it from repository', () => {