Skip to content

Commit

Permalink
fix(e2eTests): fix advance happy path and environment page tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sahil143 authored and rohitkrai03 committed Apr 29, 2024
1 parent 72058f9 commit de5be43
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 84 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ export class IntegrationTestsTabPage {
githubURL: string,
revision: string,
pathInRepository: string,
env: string,
markOptionalForRelease?: string,
) {
this.verifySaveChangesIsDisabled();
Expand All @@ -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') {
Expand Down
28 changes: 1 addition & 27 deletions integration-tests/tests/advanced-happy-path.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'];
Expand Down Expand Up @@ -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();
Expand All @@ -224,7 +218,6 @@ describe('Advanced Happy path', () => {
integrationTestDetails.githubURL,
'main',
integrationTestDetails.pathInRepository,
integrationTestDetails.env,
'check',
);
integrationTestsTabPage.verifyRowInIntegrationTestsTable({
Expand All @@ -242,7 +235,6 @@ describe('Advanced Happy path', () => {
integrationTestDetails.githubURL,
'main',
integrationTestDetails.pathInRepository,
'No environment',
);
integrationTestsTabPage.verifyRowInIntegrationTestsTable({
name: integrationTestDetails.integrationTestNameTemp,
Expand All @@ -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,
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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', () => {
Expand Down Expand Up @@ -528,7 +503,6 @@ describe('Advanced Happy path', () => {
UIhelper.verifyGraphNodes('Components', false);
UIhelper.verifyGraphNodes('Builds');
UIhelper.verifyGraphNodes('Tests', false);
UIhelper.verifyGraphNodes('Static environments');
});
});

Expand Down
53 changes: 0 additions & 53 deletions integration-tests/tests/environments-tests.spec.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -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', () => {
Expand All @@ -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);
});
});
});
5 changes: 3 additions & 2 deletions src/components/ApplicationDetails/component-actions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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()}`,
Expand Down

0 comments on commit de5be43

Please sign in to comment.