From de5be43e1e9b9b34c33a788d6c91d421f2766fc7 Mon Sep 17 00:00:00 2001 From: Sahil Budhwar Date: Wed, 24 Apr 2024 11:24:57 +0530 Subject: [PATCH] fix(e2eTests): fix advance happy path and environment page tests --- .../pages/tabs/IntegrationTestsTabPage.ts | 2 - .../tests/advanced-happy-path.spec.ts | 28 +--------- .../tests/environments-tests.spec.ts | 53 ------------------- .../ApplicationDetails/component-actions.tsx | 5 +- 4 files changed, 4 insertions(+), 84 deletions(-) diff --git a/integration-tests/support/pages/tabs/IntegrationTestsTabPage.ts b/integration-tests/support/pages/tabs/IntegrationTestsTabPage.ts index d8279f57f..8a0eced3f 100644 --- a/integration-tests/support/pages/tabs/IntegrationTestsTabPage.ts +++ b/integration-tests/support/pages/tabs/IntegrationTestsTabPage.ts @@ -30,7 +30,6 @@ export class IntegrationTestsTabPage { githubURL: string, revision: string, pathInRepository: string, - env: string, markOptionalForRelease?: string, ) { this.verifySaveChangesIsDisabled(); @@ -41,7 +40,6 @@ export class IntegrationTestsTabPage { }).should('be.visible'); UIhelper.inputValueInTextBoxByLabelName('Revision', revision); UIhelper.inputValueInTextBoxByLabelName('Path in repository', pathInRepository); - UIhelper.selectValueInDropdownbyLabelName('Environment', env); if (markOptionalForRelease === 'uncheck') { cy.get(addIntegrationTestStepPO.optionalreleaseCheckbox).uncheck(); } else if (markOptionalForRelease === 'check') { diff --git a/integration-tests/tests/advanced-happy-path.spec.ts b/integration-tests/tests/advanced-happy-path.spec.ts index 9c9001ed8..5dd25e387 100644 --- a/integration-tests/tests/advanced-happy-path.spec.ts +++ b/integration-tests/tests/advanced-happy-path.spec.ts @@ -64,7 +64,6 @@ describe('Advanced Happy path', () => { integrationTestNameTemp: Common.generateAppName('integration-tests-temp'), githubURL: 'https://github.com/redhat-hac-qe/integration-examples', pathInRepository: 'pipelines/integration_pipeline_pass.yaml', - env: 'development', }; const integrationTestTaskNames = ['task-success', 'task-green', 'task-skipped']; @@ -200,11 +199,6 @@ describe('Advanced Happy path', () => { Applications.clickBreadcrumbLink(applicationName); }); - it('Verify the status code and response body of the deployment URL of each component', () => { - ComponentDetailsPage.openTab(ComponentPageTabs.deployments); - DeploymentsTab.verifyRoute(componentInfo.deploymentBodyOriginal); - }); - it('Verify SBOM on components tab', () => { ComponentDetailsPage.openTab(ComponentPageTabs.detail); ComponentDetailsPage.checkSBOM(); @@ -224,7 +218,6 @@ describe('Advanced Happy path', () => { integrationTestDetails.githubURL, 'main', integrationTestDetails.pathInRepository, - integrationTestDetails.env, 'check', ); integrationTestsTabPage.verifyRowInIntegrationTestsTable({ @@ -242,7 +235,6 @@ describe('Advanced Happy path', () => { integrationTestDetails.githubURL, 'main', integrationTestDetails.pathInRepository, - 'No environment', ); integrationTestsTabPage.verifyRowInIntegrationTestsTable({ name: integrationTestDetails.integrationTestNameTemp, @@ -258,7 +250,6 @@ describe('Advanced Happy path', () => { 'Edit', ); Common.waitForLoad(); - UIhelper.verifyValueInDropdownbyLabelName('Environment', integrationTestDetails.env, true); integrationTestsTabPage.editIntegrationTest(integrationTestDetails.githubURL, 'uncheck'); integrationTestsTabPage.verifyRowInIntegrationTestsTable({ name: integrationTestDetails.integrationTestName, @@ -430,18 +421,6 @@ describe('Advanced Happy path', () => { ComponentsTabPage.openComponent(componentName); }); - it('Verify that the component deployment reflects latest changes', () => { - ComponentDetailsPage.openTab(ComponentPageTabs.deployments); - DeploymentsTab.verifyRoute(componentInfo.deploymentBodyUpdated); - }); - - it('Verify view pod logs', () => { - ComponentDetailsPage.openPodLogs(); - cy.contains('Pod status: Running').should('be.visible'); - applicationDetailPage.checkPodLog('my-go', 'TEST_ENV_VAR : Test go app'); - applicationDetailPage.closeBuildLog(); - }); - it('Verify Commit Trigger', () => { ComponentDetailsPage.openTab(ComponentPageTabs.detail); UIhelper.verifyLabelAndValue('Triggered by', componentInfo.updatedCommitMessage); @@ -493,11 +472,7 @@ describe('Advanced Happy path', () => { latestCommitsTabPage.verifyBranch('main', repoLink); UIhelper.verifyLabelAndValue('By', gitHubUser); UIhelper.verifyLabelAndValue('Status', 'Succeeded'); - latestCommitsTabPage.verifyNodesOnCommitOverview([ - 'commit', - `${componentName}-build`, - 'development', - ]); + latestCommitsTabPage.verifyNodesOnCommitOverview(['commit', `${componentName}-build`]); }); it('verify the Commit Pipeline runs Tab', () => { @@ -528,7 +503,6 @@ describe('Advanced Happy path', () => { UIhelper.verifyGraphNodes('Components', false); UIhelper.verifyGraphNodes('Builds'); UIhelper.verifyGraphNodes('Tests', false); - UIhelper.verifyGraphNodes('Static environments'); }); }); diff --git a/integration-tests/tests/environments-tests.spec.ts b/integration-tests/tests/environments-tests.spec.ts index f3499ed7f..15a7b6331 100644 --- a/integration-tests/tests/environments-tests.spec.ts +++ b/integration-tests/tests/environments-tests.spec.ts @@ -1,5 +1,4 @@ import { NavItem } from '../support/constants/PageTitle'; -import { EnvironmentsPage } from '../support/pages/EnvironmentsPage'; import { DetailsTab } from '../support/pages/tabs/PipelinerunsTabPage'; import { Applications } from '../utils/Applications'; import { Common } from '../utils/Common'; @@ -10,37 +9,8 @@ describe('Create Env using Non-OpenShift Cluster', () => { const publicRepo = 'https://github.com/devfile-samples/devfile-sample-python-basic.git'; const componentName: string = Common.generateAppName('python-basic'); - const envName = Common.generateAppName('env'); - const clusterInformation = { - cluster: 'I want to bring my own cluster', - type: 'Non-OpenShift', - ingressDomain: 'apps.hac-devsandbox.5unc.p1.openshiftapps.com', - kubeconfig: Buffer.from(Cypress.env('VC_KUBECONFIG'), 'base64').toString('utf8'), - targetNamespace: 'default', - }; - after(function () { Applications.deleteApplication(applicationName); - EnvironmentsPage.deleteEnvironmentUsingAPI(envName); - }); - - describe('Create a environment', () => { - it('Create environment', () => { - Common.navigateTo(NavItem.environments); - EnvironmentsPage.clickOnCreateEnv(); - EnvironmentsPage.createEnvironment( - envName, - clusterInformation.cluster, - clusterInformation.type, - clusterInformation.ingressDomain, - clusterInformation.kubeconfig, - clusterInformation.targetNamespace, - ); - }); - - it('Verify new Env on Environments Tab', () => { - EnvironmentsPage.verifyEnvCardDetails(envName, 'Self Managed', 'Automatic', 'Kubernetes'); - }); }); describe('Create an Application', () => { @@ -67,27 +37,4 @@ describe('Create Env using Non-OpenShift Cluster', () => { DetailsTab.waitForPLRAndDownloadAllLogs(false); }); }); - - describe('Verify application in deployments Tab and delete application and env', () => { - it('verify application status in Deployments Tab', () => { - Applications.clickBreadcrumbLink(applicationName); - UIhelper.clickTab('Deployments'); - EnvironmentsPage.verifyEnvCardDetails( - envName, - 'Self Managed', - 'Automatic', - 'Kubernetes', - 'Healthy', - ); - }); - - it('Delete Application', () => { - Applications.deleteApplication(applicationName); - }); - - it('Delete Environment', () => { - Common.navigateTo(NavItem.environments); - EnvironmentsPage.deleteEnvironment(envName); - }); - }); }); diff --git a/src/components/ApplicationDetails/component-actions.tsx b/src/components/ApplicationDetails/component-actions.tsx index 50cdffaf2..73b7ef57e 100644 --- a/src/components/ApplicationDetails/component-actions.tsx +++ b/src/components/ApplicationDetails/component-actions.tsx @@ -52,8 +52,9 @@ export const useComponentActions = (component: ComponentKind, name: string): Act app_name: applicationName, workspace, }, - }); - } + }, + ]; + updatedActions.push({ cta: () => showModal(componentDeleteModal(component)), id: `delete-${name.toLowerCase()}`,