Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion frontend/integration-tests/test-cypress.sh
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,12 @@ if [ -n "${nightly-}" ] && [ -z "${pkg-}" ]; then
fi

if [ -n "${headless-}" ] && [ -z "${pkg-}" ]; then
# DO NOT MERGE. UPDATED FOR TESTING IN CI.
yarn run test-cypress-helm-headless
yarn run test-cypress-console-headless
yarn run test-cypress-dev-console-headless
yarn run test-cypress-olm-headless
yarn run test-cypress-webterminal-headless
yarn run test-cypress-helm-headless
yarn run test-cypress-knative-headless
yarn run test-cypress-topology-headless
# yarn run test-cypress-shipwright-headless
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ declare global {
namespace Cypress {
interface Chainable {
alertTitleShouldContain(title: string): Chainable<Element>;
clickNavLink(path: string[]): Chainable<Element>;
selectByDropDownText(selector: string, dropdownText: string): Chainable<Element>;
selectByAutoCompleteDropDownText(selector: string, dropdownText: string): Chainable<Element>;
verifyDropdownselected(selector: string): Chainable<Element>;
Expand All @@ -31,15 +30,6 @@ Cypress.Commands.add('alertTitleShouldContain', (alertTitle: string) => {
cy.byLegacyTestID('modal-title').should('contain.text', alertTitle);
});

Cypress.Commands.add('clickNavLink', (path: string[]) => {
cy.get(`[data-test="nav"]`) // this assumes all top level menu items are expandable
.contains(path[0])
.click(); // open top, expandable menu
// eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(500); // wait for animation
cy.get('#page-sidebar').contains(path[1]).click();
});

Cypress.Commands.add('selectByDropDownText', (selector: string, dropdownText: string) => {
cy.get(selector).click();
cy.get('li').contains(dropdownText).click({ force: true });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ export const catalogPage = {
throw new Error('Card is not available in Catalog');
}
}
catalogPage.verifyPageTitle(type);
},
selectTemplateCategory: (templateCategoryTitle: string) => {
const selector =
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Disabled due to createRoot concurrent rendering failures (OCPBUGS-82511)
@helm @smoke @manual
@helm @smoke
Feature: Helm Release
As a user, I want to perform actions on the helm release


@pre-condition
Scenario: Create or Select the project namespace
Given user has created or selected namespace "aut-ci-helm"
Given user is at the Helm Release tab in admin perspective
And user has created or selected namespace "aut-ci-helm"


Scenario: Open the Helm tab on the navigation bar when helm charts are absent: HR-05-TC01
Expand All @@ -17,8 +17,7 @@ Feature: Helm Release


Scenario: Create Helm Release page details: HR-05-TC02
Given user has created or selected namespace "aut-ci-helm"
And user is at Software Catalog page
Given user is at Software Catalog page
When user selects Helm Charts type from Software Catalog page
And user searches and selects "Nodejs" card from catalog page
And user clicks on the Create button on side bar
Expand Down Expand Up @@ -51,7 +50,7 @@ Feature: Helm Release
And user is able to see the status and status icon of Revision history page

Scenario: Context menu options of helm release: HR-01-TC01
Given user is at the Topology page in admin view
Given user is at the Topology page
When user right clicks on the helm release "nodejs-release" to open the context menu
Then user is able to see the context menu with actions Upgrade and Delete Helm Release

Expand Down Expand Up @@ -85,7 +84,7 @@ Feature: Helm Release


Scenario: Perform Upgrade action on Helm Release through Context Menu: HR-08-TC04
Given user is at the Topology page in admin view
Given user is at the Topology page
When user right clicks on the helm release "nodejs-release" to open the context menu
And user clicks on the "Upgrade" action
And user upgrades the chart Version
Expand All @@ -103,7 +102,7 @@ Feature: Helm Release


Scenario: Perform Rollback action on Helm Release through Context Menu: HR-08-TC03
Given user is at the Topology page in admin view
Given user is at the Topology page
And user is on the topology sidebar of the helm release "nodejs-release"
When user clicks on the Actions drop down menu
And user clicks on the "Rollback" action
Expand All @@ -113,7 +112,7 @@ Feature: Helm Release


Scenario: Delete Helm Release through Context Menu: HR-01-TC03
Given user is at the Topology page in admin view
Given user is at the Topology page
When user right clicks on the helm release "nodejs-release" to open the context menu
And user clicks on the "Delete Helm Release" action
And user enters the release name "nodejs-release"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import { app } from '@console/dev-console/integration-tests/support/pages';

before(() => {
const bridgePasswordIDP: string = Cypress.expose('BRIDGE_HTPASSWD_IDP') || 'test';
const bridgePasswordUsername: string = Cypress.expose('BRIDGE_HTPASSWD_USERNAME') || 'test';
cy.env(['BRIDGE_HTPASSWD_PASSWORD']).then(({ BRIDGE_HTPASSWD_PASSWORD }) => {
cy.login(bridgePasswordIDP, bridgePasswordUsername, BRIDGE_HTPASSWD_PASSWORD || 'test');
});
cy.login();
cy.document().its('readyState').should('eq', 'complete');
cy.window().then((win: any) => {
win.SERVER_FLAGS.userSettingsLocation = 'localstorage';
Expand All @@ -13,8 +11,7 @@ before(() => {
});

beforeEach(() => {
cy.initAdmin();
cy.byLegacyTestID('topology-header').should('exist').click({ force: true });
app.waitForLoad();
});

after(() => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export * from './navigation';
export * from './static-text/helm-text';
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/**
* Navigation paths for cy.clickNavLink()
* Format: [parent menu, submenu]
*/
export const navPaths = {
helm: ['Ecosystem', 'Helm'],
topology: ['Workloads', 'Topology'],
softwareCatalog: ['Ecosystem', 'Software Catalog'],
};
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@ import {
gitPage,
catalogPage,
addPage,
app,
} from '@console/dev-console/integration-tests/support/pages';
import { checkDeveloperPerspective } from '@console/dev-console/integration-tests/support/pages/functions/checkDeveloperPerspective';
import { navPaths } from '../../constants';

Given('user is at developer perspective', () => {
checkDeveloperPerspective();
Expand All @@ -33,12 +35,8 @@ Given('user has created or selected namespace {string}', (projectName: string) =
});

Given('user is at the Topology page', () => {
navigateTo(devNavigationMenu.Topology);
topologyPage.verifyTopologyPage();
});

Given('user is at the Topology page in admin view', () => {
cy.byLegacyTestID('topology-header').should('exist').click({ force: true });
cy.clickNavLink(navPaths.topology);
app.waitForLoad();
topologyPage.verifyTopologyPage();
});

Expand Down Expand Up @@ -78,7 +76,9 @@ When('user clicks node {string} to open the side bar', (name: string) => {
});

When('user navigates to Topology page', () => {
navigateTo(devNavigationMenu.Topology);
cy.clickNavLink(navPaths.topology);
app.waitForLoad();
topologyPage.verifyTopologyPage();
});

Then('modal with {string} appears', (header: string) => {
Expand All @@ -94,11 +94,16 @@ When('user selects {string} card from add page', (cardName: string) => {
});

Given('user is at Software Catalog page', () => {
cy.byLegacyTestID('developer-catalog-header').should('exist').click({ force: true });
cy.clickNavLink(navPaths.softwareCatalog);
// Wait for catalog page to fully load
app.waitForLoad();
catalogPage.verifyTitle();
});

When('user selects Helm Charts type from Software Catalog page', () => {
catalogPage.selectCatalogType(catalogTypes.HelmCharts);
// Wait for catalog cards to be filtered and displayed
catalogPage.isCardsDisplayed();
});

When('user switches to the {string} tab', (tab: string) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import {
} from '@console/dev-console/integration-tests/support/pages';
import { checkDeveloperPerspective } from '@console/dev-console/integration-tests/support/pages/functions/checkDeveloperPerspective';
import { topologyPage } from '@console/topology/integration-tests/support/pages/topology/topology-page';
import { navPaths } from '../../constants';
import { helmPage, helmDetailsPage } from '../../pages';

const deleteChartRepositoryFromDetailsPage = (name: string, type: string) => {
Expand All @@ -35,7 +36,7 @@ Given('user is at developer perspective', () => {

When('user clicks on the Helm tab in dev perspective', () => {
cy.get('[data-quickstart-id="qs-admin-nav-helm"]').should('be.visible').click({ force: true });
navigateTo(devNavigationMenu.Helm);
cy.clickNavLink(navPaths.helm);
});

Then('user will be redirected to Helm releases page', () => {
Expand Down Expand Up @@ -89,16 +90,17 @@ Then('Topology page have the helm chart workload {string}', (nodeName: string) =
});

Given('user has installed helm chart', () => {
navigateTo(devNavigationMenu.Topology);
cy.clickNavLink(navPaths.topology);
topologyPage.verifyTopologyPage();
topologyPage.verifyWorkloadInTopologyPage('nodejs-release');
});

Given('user is at the Helm page', () => {
navigateTo(devNavigationMenu.Helm);
cy.clickNavLink(navPaths.helm);
});

Given('user is at the Helm Release tab in admin perspective', () => {
cy.clickNavLink(['Ecosystem', 'Helm']);
cy.clickNavLink(navPaths.helm);
cy.byLegacyTestID('horizontal-link-Helm Releases').should('exist').click({ force: true });
});

Expand Down Expand Up @@ -315,7 +317,7 @@ When('user selects cluster-scoped scope type', () => {
});

When('user navigates to Helm page', () => {
navigateTo(devNavigationMenu.Helm);
cy.clickNavLink(navPaths.helm);
});

When('user can see {string} {string} details page', (type: string, name: string) => {
Expand All @@ -331,7 +333,7 @@ Given(
);

Given('user is able to see {string} in helm page', (helmRelease: string) => {
navigateTo(devNavigationMenu.Helm);
cy.clickNavLink(navPaths.helm);
helmPage.search(helmRelease);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
app,
createHelmChartFromAddPage,
} from '@console/dev-console/integration-tests/support/pages';
import { navPaths } from '../../constants';
import { upgradeHelmRelease, helmDetailsPage, rollBackHelmRelease, helmPage } from '../../pages';

Given('helm release {string} is present in topology page', (workloadName: string) => {
Expand Down Expand Up @@ -43,7 +44,6 @@ Then('user is able to see the context menu with actions Upgrade and Delete Helm

Given('user is on the topology sidebar of the helm release {string}', (helmReleaseName: string) => {
topologyPage.clickOnHelmGroup(helmReleaseName);
topologySidePane.verify();
});

When('user clicks on the Actions drop down menu', () => {
Expand Down Expand Up @@ -74,8 +74,7 @@ Then(
);

Given('user is on the Helm page with helm release {string}', (helmRelease: string) => {
cy.get('[data-quickstart-id="qs-nav-ecosystem"]').should('be.visible').click({ force: true });
cy.get('[data-test-id="helm-nav"]').should('be.visible').click({ force: true });
cy.clickNavLink(navPaths.helm);
helmPage.search(helmRelease);
});

Expand All @@ -84,7 +83,7 @@ Given('user is able to see {string} in helm page in admin view', (helmRelease: s
});

When('user clicks on the Helm Release tab in admin perspective', () => {
cy.clickNavLink(['Ecosystem', 'Helm']);
cy.clickNavLink(navPaths.helm);
cy.byLegacyTestID('horizontal-link-Helm Releases').should('exist').click({ force: true });
});

Expand Down Expand Up @@ -153,11 +152,6 @@ Then('user will see the Details, Resources, Release notes tabs', () => {
topologyPage.verifyHelmReleaseSidePaneTabs();
});

Given('user is on the topology sidebar of the helm release {string}', (helmReleaseName: string) => {
topologyPage.clickOnHelmGroup(helmReleaseName);
topologySidePane.verify();
});

Then('user will see the {string} action item', (actionItem: string) => {
cy.byTestActionID(actionItem).should('be.visible');
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import { Given, When, Then } from 'cypress-cucumber-preprocessor/steps';
import { devNavigationMenu } from '@console/dev-console/integration-tests/support/constants';
import { navigateTo } from '@console/dev-console/integration-tests/support/pages';
import { topologyPage } from '@console/topology/integration-tests/support/pages/topology/topology-page';
import { navPaths } from '../../constants';
import { urlChartInstallPage } from '../../pages';

Given('user is at the URL chart install page', () => {
navigateTo(devNavigationMenu.Helm);
cy.clickNavLink(navPaths.helm);
cy.byLegacyTestID('item-create').click();
cy.get('[data-test-dropdown-menu]').contains('Helm Chart URL').click();
});
Expand Down
13 changes: 0 additions & 13 deletions frontend/packages/integration-tests/support/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,19 +50,6 @@ Cypress.Commands.add('visitAndWait', (url, options, selector = '#content') => {
waitForElementToExist(selector);
});

Cypress.Commands.add('clickNavLink', (path: string[]) => {
cy.get('#page-sidebar')
.contains(path[0])
.then(($navItem) => {
if ($navItem.attr('aria-expanded') !== 'true') {
cy.wrap($navItem).click();
}
});
if (path.length === 2) {
cy.get('#page-sidebar').contains(path[1]).click();
}
});

before(() => {
cy.task('readFileIfExists', 'cypress-a11y-report.json').then((a11yReportOrNull: string) => {
if (a11yReportOrNull !== null) {
Expand Down
2 changes: 1 addition & 1 deletion frontend/packages/integration-tests/views/details-page.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export const detailsPage = {
titleShouldContain: (title: string) => {
cy.get('[data-test="page-heading"]', { timeout: 30000 }).should('be.visible');
cy.get('[data-test="page-heading"]', { timeout: 30000 }).should('exist');
return cy.get('[data-test="page-heading"]').contains(title, { timeout: 30000 });
},
sectionHeaderShouldExist: (sectionHeading: string) =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export const topologyPO = {
knativeServiceIcon: '[title="Service"]',
tabs: '[data-test="topology-sidepane"] button[role="tab"]',
sectionTitle: 'h2',
close: '[data-test="sidebar-close-button]',
close: '[data-test="sidebar-close-button"]',
labelsList: '[data-test="label-list"]',
editAnnotations: '[data-test="edit-annotations"]',
tabName: '[data-test="topology-sidepane"] button[role="tab"]',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -336,10 +336,14 @@ export const topologyPage = {
.click({ force: true });
},
clickOnHelmGroup: (groupName: string) => {
return cy
.get(topologyPO.graph.helmGroupLabelText)
.should('be.visible')
// Search for the helm group to ensure it's loaded and highlighted
topologyHelper.search(groupName);
// Wait for the search to highlight the group
cy.get('[data-type="helm-release"] .is-filtered', { timeout: 10000 }).should('exist');
// Now click on the helm group label
cy.get(topologyPO.graph.helmGroupLabelText)
.contains(groupName)
.should('be.visible')
.click({ force: true });
},
clickOnDeploymentNode: (nodeName: string) => {
Expand Down