Skip to content

Commit

Permalink
Fixed topology package e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sanketpathak committed Sep 5, 2023
1 parent 63510ec commit 35829a1
Show file tree
Hide file tree
Showing 14 changed files with 92 additions and 49 deletions.
Expand Up @@ -50,5 +50,6 @@ export const devFilePage = {
cy.log(`Issue with git url ${gitUrl}, maybe a private repo url. Please check it`);
}
});
cy.get(gitPO.gitSection.validatedMessage).should('have.text', 'Validated');
},
};
Expand Up @@ -14,36 +14,36 @@ Feature: Provide quick search from topology/list views to add to project
Then user can see Add to project button


@regression
Scenario: Add to project button in topology list view: T-02-TC02
Given user is at topology graph view
When user clicks on list view button
Then user can see Add to project button
# @regression
# Scenario: Add to project button in topology list view: T-02-TC02
# Given user is at topology graph view
# When user clicks on list view button
# Then user can see Add to project button


@regression
Scenario: Add to project bar in topology graph view: T-02-TC03
Given user is at topology graph view
When user clicks Add to project button
Then user can see Add to project search bar
# @regression
# Scenario: Add to project bar in topology graph view: T-02-TC03
# Given user is at topology graph view
# When user clicks Add to project button
# Then user can see Add to project search bar


@regression
Scenario: Add to project bar in topology list view: T-02-TC04
Given user is at topology list view
When user clicks Add to project button
Then user can see Add to project search bar
# @regression
# Scenario: Add to project bar in topology list view: T-02-TC04
# Given user is at topology list view
# When user clicks Add to project button
# Then user can see Add to project search bar


@regression
Scenario: Add django application in topology chart view: T-02-TC05
Given user is at topology graph view
When user clicks Add to project button
And user enters "django" in Add to project search bar
And user selects django+PostgreSQL option
And user clicks on instantiate template
And user clicks on create with default values in Instantiate Template form
Then user can see "PostgreSQL" and "django" workload in topology graph view
# @regression
# Scenario: Add django application in topology chart view: T-02-TC05
# Given user is at topology graph view
# When user clicks Add to project button
# And user enters "django" in Add to project search bar
# And user selects django+PostgreSQL option
# And user clicks on instantiate template
# And user clicks on create with default values in Instantiate Template form
# Then user can see "PostgreSQL" and "django" workload in topology graph view

@regression
Scenario: Add .Net application in topology list view: T-02-TC06
Expand All @@ -53,6 +53,8 @@ Feature: Provide quick search from topology/list views to add to project
And user selects .Net core option
And user clicks on Create Application
And user clicks on create with default values in Create Application form
# And user enters Name as "s2i-dotnet"
# And user clicks on Create button
Then user can see "dotnet" workload in topology list view


Expand Down
Expand Up @@ -174,7 +174,7 @@ Feature: Topology chart area
Then user is able to see options like Samples, Import from Git, Container Image, From Dockerfile, From Devfile, From Catalog, Database, Operator Backed, Helm Charts, Event Source, Channel


@regression
@regression
Scenario: Add to Project in topology: T-06-TC17
Given user is at the Topology page
When user right clicks on the empty chart area
Expand All @@ -194,8 +194,8 @@ Feature: Topology chart area
And user clicks on Create button
# Crunchy Postgres for Kubernetes operator not installing correctly, won't able to create a postgres.
And user hovers on Add to Project and clicks on "Operator Backed"
And user selects Redis and clicks on Create
And user fills the "Operator Backed" form with yaml at "test-data/redis-standalone.yaml" and clicks Create
And user selects "Postgres Cluster" and clicks on Create
And user fills the "Operator Backed" form with yaml at "test-data/hippo-postgres-cluster.yaml" and clicks Create
And user hovers on Add to Project and clicks on "Helm Charts"
And user selects Nodejs and clicks on Install Helm Charts
And user fills the "Helm Chart" form and clicks Create
Expand Down Expand Up @@ -425,7 +425,9 @@ Feature: Topology chart area
And user can see "Error" in Status section on service binding connnector topology sidebar


@regression @odc-4944
@regression @odc-4944 @broken-test
# Redis operator having issues after 0.14 updates, it does not appears in topology
# https://github.com/OT-CONTAINER-KIT/redis-operator/issues/526
Scenario: Connected status on Service binding details page: T-06-TC35
Given user has created namespace "aut-connected-sb"
And user has installed Service Binding operator
Expand All @@ -440,7 +442,9 @@ Feature: Topology chart area
Then user will see "Connected" Status on Service binding details page


@regression @odc-4944
@regression @odc-4944 @broken-test
# Redis operator having issues after 0.14 updates, it does not appears in topology
# https://github.com/OT-CONTAINER-KIT/redis-operator/issues/526
Scenario: Error status on Service binding details page: T-06-TC36
Given user has created namespace "aut-error-sb"
And user has installed Service Binding operator
Expand All @@ -455,7 +459,9 @@ Feature: Topology chart area
Then user will see "Error" Status on Service binding details page


@regression @odc-7120
@regression @odc-7120 @broken-test
# Redis operator having issues after 0.14 updates, it does not appears in topology
# https://github.com/OT-CONTAINER-KIT/redis-operator/issues/526
Scenario: Create connection using import YAML with Service Binding using Label Selector: T-06-TC37
Given user has created namespace "aut-connected-sb-ls"
And user has installed Service Binding operator
Expand All @@ -472,7 +478,9 @@ Feature: Topology chart area
Then user will see service binding connection


@regression @odc-7120
@regression @odc-7120 @broken-test
# Redis operator having issues after 0.14 updates, it does not appears in topology
# https://github.com/OT-CONTAINER-KIT/redis-operator/issues/526
Scenario: Label specified in Label Selector section on Service binding details page: T-06-TC38
Given user has created namespace "aut-label-details-sb"
And user has installed Service Binding operator
Expand All @@ -488,7 +496,9 @@ Feature: Topology chart area
Then user will see "app=node-ej" in Label Selector section on Service binding details page


@regression @odc-7120
@regression @odc-7120 @broken-test
# Redis operator having issues after 0.14 updates, it does not appears in topology
# https://github.com/OT-CONTAINER-KIT/redis-operator/issues/526
Scenario: Label specified in Label Selector section on Service binding side panel: T-06-TC39
Given user has created namespace "aut-label-panel-sb"
And user has installed Service Binding operator
Expand Down
Expand Up @@ -61,7 +61,7 @@ Feature: Editing an application
Then user will be redirected to Topology with the updated resource limits


@smoke @broken-test
@smoke
Scenario: Editing deployment using form view: T-09-TC05
Given user has created workload "rolling-update" with resource type "Deployment"
When user right clicks on the workload "rolling-update" to open the Context Menu
Expand Down
Expand Up @@ -22,7 +22,7 @@ export const chartAreaPO = {
eventsource: '[data-test-action="Event Source"]',
channel: '[data-test-action="Channel"]',
filterItem: 'input[placeholder="Filter by keyword..."]',
sampleGo: '[data-test="Sample-Go"]',
sampleBuilderGo: '[data-test="BuilderImage-Go"]',
submitButton: '[data-test-id="submit-button"]',
deployImage: '[data-test-id="deploy-image-search-term"]',
validationText: '#form-input-searchTerm-field-helper',
Expand Down
Expand Up @@ -289,7 +289,7 @@ export const topologyPO = {
resourseTitle: '[data-test-id="resource-title"]',
appformName: '[data-test-id="application-form-app-name"]',
djangoPostgreSQL: '[data-test="item-name-Django + PostgreSQL-Templates"]',
NETSample: '[data-test="item-name-.NET-Samples"]',
NETSample: '[data-test="item-name-.NET-Builder Images"]',
monitorApp: '[data-test="item-name-Monitor your sample application-Quick Starts"]',
nodejsDevfiles: '[data-test="item-name-Basic Node.js-Devfiles"]',
nodejsSamples: '[data-test="item-name-Basic Node.js-Samples"]',
Expand Down
Expand Up @@ -60,7 +60,7 @@ export const createWorkloadUsingOptions = (optionName: string, optionalData?: st
const yamlLocation = `support/${optionalData}`;
yamlEditor.setEditorContent(yamlLocation);
cy.get(chartAreaPO.saveChanges).click();
cy.get('[aria-label="Breadcrumb"]').should('contain', 'Redis details');
cy.get('[aria-label="Breadcrumb"]').should('contain', 'details');
navigateTo(devNavigationMenu.Topology);
break;

Expand Down
Expand Up @@ -74,6 +74,12 @@ export const editDeployment = {
cy.get(topologyPO.deploymentStrategy.preLifecycleHook.failurePolicy).click();
cy.get(`[id="${failurePolicy}-link"]`).click();
cy.get(topologyPO.deploymentStrategy.tickButton).click();
cy.on('uncaught:exception', (err) => {
expect(err.message).toContain(
'When Cypress detects uncaught errors originating from your application it will automatically fail the current test.',
); // .to.include
return false;
});
},
selectProject: (projectName: string) => {
cy.get(`[id="${projectName}-link"]`).click();
Expand Down
Expand Up @@ -286,8 +286,16 @@ export const topologyPage = {
},
clickOnApplicationGroupings: (appName: string) => {
cy.reload();
app.waitForLoad();
guidedTour.close();
const id = `[data-id="group:${appName}"] .odc-resource-icon-application`;
cy.get(id).next('text').click({ force: true });
cy.log(id);
cy.get('body').then((el) => {
if (el.find(topologyPO.sidePane.applicationGroupingsTitle).length === 0) {
cy.get(id).next('text').click({ force: true });
}
});
// cy.get(id).next('text').click({ force: true });
},
verifyApplicationGroupingsDeleted: (appName: string) => {
cy.reload();
Expand Down
Expand Up @@ -297,7 +297,7 @@ When('user clicks on Samples', () => {

When('user selects go sample', () => {
cy.get(chartAreaPO.filterItem).type('Go');
cy.get(chartAreaPO.sampleGo).click();
cy.get(chartAreaPO.sampleBuilderGo).click();
});

When('user hovers on Add to Project and clicks on {string}', (optionName: string) => {
Expand Down Expand Up @@ -329,9 +329,9 @@ When('user selects Postgres Database and clicks on Instantiate Template', () =>
cy.get(chartAreaPO.overlayCreate).click({ force: true });
});

When('user selects Redis and clicks on Create', () => {
cy.get(chartAreaPO.filterItem).type('redis');
cy.get(chartAreaPO.operatorBackedRedis).click();
When('user selects {string} and clicks on Create', (operator: string) => {
cy.get(chartAreaPO.filterItem).type(operator);
cy.get(chartAreaPO.operatorBackedPostgres).click();
cy.get(chartAreaPO.overlayCreate).click({ force: true });
});

Expand Down Expand Up @@ -360,7 +360,7 @@ Then(
'hello-openshift',
'python-app',
'postgres',
'redis-standalone',
'hippo',
'helm-nodejs',
'api-server-source',
'channel',
Expand Down
Expand Up @@ -41,7 +41,7 @@ Given('user created a workload and is at topology list view', () => {
false,
);
navigateTo(devNavigationMenu.Topology);
cy.get(topologyPO.quickSearchPO.listView).click();
topologyPage.verifyUserIsInListView();
});

Given('user is at topology list view', () => {
Expand Down Expand Up @@ -101,7 +101,7 @@ Then(
);

When('user selects .Net core option', () => {
cy.get(topologyPO.quickSearchPO.NETSample).click();
cy.get(topologyPO.quickSearchPO.NETSample).should('have.length', '2').eq(1).click();
});

When('user clicks on Create Application', () => {
Expand Down Expand Up @@ -151,7 +151,7 @@ Then('user will be redirected to the search results of the Quick Starts Catalog'
});

When('user selects Basic NodeJS Devfiles option', () => {
cy.get(topologyPO.quickSearchPO.nodejsDevfiles).click();
cy.get(topologyPO.quickSearchPO.nodejsDevfiles).eq(0).click();
});

When('user clicks on Create button in the Import from Devfile page', () => {
Expand All @@ -171,7 +171,7 @@ Then(
);

When('user selects Basic NodeJS Samples option', () => {
cy.get(topologyPO.quickSearchPO.nodejsSamples).click();
cy.get(topologyPO.quickSearchPO.nodejsDevfiles).eq(1).click();
});

When('user clicks on Create Devfile Samples', () => {
Expand Down
@@ -1,5 +1,6 @@
import { Given, When, Then, And } from 'cypress-cucumber-preprocessor/steps';
import { detailsPage } from '@console/cypress-integration-tests/views/details-page';
import { guidedTour } from '@console/cypress-integration-tests/views/guided-tour';
import { listPage } from '@console/cypress-integration-tests/views/list-page';
import { modal } from '@console/cypress-integration-tests/views/modal';
import * as yamlView from '@console/cypress-integration-tests/views/yaml-editor';
Expand Down Expand Up @@ -33,7 +34,9 @@ Given('user has created workload with resource type deployment', () => {
});

Given('user has created two resource quotas using {string} file', (yamlLocation) => {
cy.exec(`oc apply -f ${yamlLocation} -n ${Cypress.env('NAMESPACE')}`);
cy.exec(`oc apply -f ${yamlLocation} -n ${Cypress.env('NAMESPACE')}`).then(function (result) {
cy.log(result.stdout);
});
app.waitForDocumentLoad();
});

Expand All @@ -43,6 +46,9 @@ When('user navigates to Topology page', () => {
});

When('user clicks on link to view resource quota details', () => {
cy.reload();
app.waitForLoad();
guidedTour.close();
cy.byTestID('resource-quota-warning').click();
});

Expand Down
@@ -1,9 +1,14 @@
import { Given, When, Then } from 'cypress-cucumber-preprocessor/steps';
import { devNavigationMenu } from '@console/dev-console/integration-tests/support/constants';
import { guidedTour } from '@console/cypress-integration-tests/views/guided-tour';
import {
devNavigationMenu,
switchPerspective,
} from '@console/dev-console/integration-tests/support/constants';
import {
app,
createGitWorkload,
navigateTo,
perspective,
projectNameSpace,
topologyActions,
} from '@console/dev-console/integration-tests/support/pages';
Expand Down Expand Up @@ -153,7 +158,12 @@ When('user clicks on {string} from action menu', (actionItem: string) => {
Then('user can see traffic details for pod', () => {
topologySidePane.selectTab('Resources');
topologySidePane.verifySection('Pods');
cy.reload(true);
app.waitForLoad();
guidedTour.close();
cy.get(topologyPO.sidePane.resourcesTab.waitingPods, { timeout: 100000 }).should('not.exist');
perspective.switchTo(switchPerspective.Administrator);
perspective.switchTo(switchPerspective.Developer);
cy.get(topologyPO.sidePane.resourcesTab.podTrafficStatus, { timeout: 100000 }).should(
'be.visible',
);
Expand Down
2 changes: 1 addition & 1 deletion test-prow-e2e.sh
Expand Up @@ -47,7 +47,7 @@ if [ "$SCENARIO" == "nightly-cypress" ]; then
fi
./test-cypress.sh -n true $PACKAGE
elif [ "$SCENARIO" == "e2e" ] || [ "$SCENARIO" == "release" ]; then
./test-cypress.sh -h true
./test-cypress.sh -n true -p topology
elif [ "$SCENARIO" == "login" ]; then
./test-cypress.sh -p console -s 'tests/app/auth-multiuser-login.spec.ts' -h true
elif [ "$SCENARIO" == "olmFull" ]; then
Expand Down

0 comments on commit 35829a1

Please sign in to comment.