From d8ac06b5be4ca4755b0bfbbde272aa7516b203c2 Mon Sep 17 00:00:00 2001 From: Fede Alonso Date: Wed, 18 Dec 2024 17:26:54 +0100 Subject: [PATCH] Fede cypress rhoaieng 17124 (#2) * fix: workbenches test * Add storageClasses steps --- .../workbenches/workbenches.cy.ts | 2 +- .../e2e/storageClasses/storageClasses.cy.ts | 30 +++++++++++-------- 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/frontend/src/__tests__/cypress/cypress/tests/e2e/dataScienceProjects/workbenches/workbenches.cy.ts b/frontend/src/__tests__/cypress/cypress/tests/e2e/dataScienceProjects/workbenches/workbenches.cy.ts index 2ba00f9d7f..c1d1444e46 100644 --- a/frontend/src/__tests__/cypress/cypress/tests/e2e/dataScienceProjects/workbenches/workbenches.cy.ts +++ b/frontend/src/__tests__/cypress/cypress/tests/e2e/dataScienceProjects/workbenches/workbenches.cy.ts @@ -72,7 +72,7 @@ describe('Workbench and PVSs tests', () => { cy.step(`Create Workbench ${projectName} using storage ${PVCDisplayName}`); workbenchPage.findCreateButton().click(); createSpawnerPage.getNameInput().fill(workbenchName); - createSpawnerPage.findNotebookImage('jupyter-minimal-notebook').click(); + createSpawnerPage.findNotebookImage('s2i-minimal-notebook').click(); createSpawnerPage.findAttachExistingStorageButton().click(); attachExistingStorageModal.selectExistingPersistentStorage(PVCDisplayName); attachExistingStorageModal.findStandardPathInput().fill(workbenchName); diff --git a/frontend/src/__tests__/cypress/cypress/tests/e2e/storageClasses/storageClasses.cy.ts b/frontend/src/__tests__/cypress/cypress/tests/e2e/storageClasses/storageClasses.cy.ts index f09a759a38..17f88e2780 100644 --- a/frontend/src/__tests__/cypress/cypress/tests/e2e/storageClasses/storageClasses.cy.ts +++ b/frontend/src/__tests__/cypress/cypress/tests/e2e/storageClasses/storageClasses.cy.ts @@ -51,47 +51,53 @@ describe('An admin user can manage Storage Classes from Settings -> Storage clas }); it('An admin user can disable an enabled Storage Class', () => { + cy.step('Navigate to Storage Classes view'); cy.visitWithLogin('/', HTPASSWD_CLUSTER_ADMIN_USER); storageClassesPage.navigate(); + const scEnabledName = `${scName}-enabled-non-default`; - // SC row exist + + cy.step('Check SC row exist'); storageClassesTable.findRowByName(scEnabledName).should('be.visible'); const scEnabledRow = storageClassesTable.getRowByConfigName(scEnabledName); - // There's no Default label + cy.step("Check there's no Default label"); scEnabledRow.findOpenshiftDefaultLabel().should('not.exist'); - // The Enable switch is set to enabled + cy.step('Check the Enable switch is set to enabled'); scEnabledRow.findEnableSwitchInput().should('have.attr', 'aria-checked', 'true'); - // The Default radio button is enabled but not checked + cy.step('Check the Default radio button is enabled but not checked'); scEnabledRow.findDefaultRadioInput().should('be.enabled'); scEnabledRow.findDefaultRadioInput().should('not.have.attr', 'checked'); - // Enable the SC + cy.step('Enable the Storage Class'); scEnabledRow.findEnableSwitchInput().click({ force: true }); - // The Enable switch is set to disabled + cy.step('Check the Enable switch is set to disabled'); scEnabledRow.findEnableSwitchInput().should('have.attr', 'aria-checked', 'false'); - // The Default radio button is disabled + cy.step('Check the Default radio button is disabled'); scEnabledRow.findDefaultRadioInput().should('be.disabled'); verifyStorageClassConfig(scEnabledName, false, false); }); it('An admin user can set an enabled Storage Class as the default one', () => { + cy.step('Navigate to Storage Classes view'); cy.visitWithLogin('/', HTPASSWD_CLUSTER_ADMIN_USER); storageClassesPage.navigate(); + const scToDefaultName = `${scName}-enabled-to-default`; const scToDefaultRow = storageClassesTable.getRowByConfigName(scToDefaultName); - // There's no Default label + + cy.step("Check there's no Default label"); scToDefaultRow.findOpenshiftDefaultLabel().should('not.exist'); - // The Default radio button is enabled but not checked + cy.step('Check the Default radio button is enabled but not checked'); scToDefaultRow.findDefaultRadioInput().should('be.enabled'); scToDefaultRow.findDefaultRadioInput().should('not.have.attr', 'checked'); - // Set the SC to be the default one + cy.step('Set the SC to be the default one'); scToDefaultRow.findDefaultRadioInput().click(); - // The Default radio button is enabled + cy.step('Check the Default radio button is enabled'); scToDefaultRow.findDefaultRadioInput().should('be.enabled'); - // The Enable switch is disabled + cy.step('Check the Enable switch is disabled'); scToDefaultRow.findEnableSwitchInput().should('be.disabled'); verifyStorageClassConfig(scToDefaultName, true, true); });