Skip to content

Commit 8cc704f

Browse files
committed
Simplify testing for admin perspective
1 parent 32c8801 commit 8cc704f

6 files changed

Lines changed: 12 additions & 42 deletions

File tree

frontend/integration-tests/test-cypress.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,12 @@ if [ -n "${nightly-}" ] && [ -z "${pkg-}" ]; then
8787
fi
8888

8989
if [ -n "${headless-}" ] && [ -z "${pkg-}" ]; then
90+
# DO NOT MERGE. UPDATED FOR TESTING IN CI.
91+
yarn run test-cypress-helm-headless
9092
yarn run test-cypress-console-headless
9193
yarn run test-cypress-dev-console-headless
9294
yarn run test-cypress-olm-headless
9395
yarn run test-cypress-webterminal-headless
94-
yarn run test-cypress-helm-headless
9596
yarn run test-cypress-knative-headless
9697
yarn run test-cypress-topology-headless
9798
# yarn run test-cypress-shipwright-headless

frontend/packages/dev-console/integration-tests/support/commands/app.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ declare global {
99
namespace Cypress {
1010
interface Chainable {
1111
alertTitleShouldContain(title: string): Chainable<Element>;
12-
clickNavLink(path: string[]): Chainable<Element>;
1312
selectByDropDownText(selector: string, dropdownText: string): Chainable<Element>;
1413
selectByAutoCompleteDropDownText(selector: string, dropdownText: string): Chainable<Element>;
1514
verifyDropdownselected(selector: string): Chainable<Element>;
@@ -31,15 +30,6 @@ Cypress.Commands.add('alertTitleShouldContain', (alertTitle: string) => {
3130
cy.byLegacyTestID('modal-title').should('contain.text', alertTitle);
3231
});
3332

34-
Cypress.Commands.add('clickNavLink', (path: string[]) => {
35-
cy.get(`[data-test="nav"]`) // this assumes all top level menu items are expandable
36-
.contains(path[0])
37-
.click(); // open top, expandable menu
38-
// eslint-disable-next-line cypress/no-unnecessary-waiting
39-
cy.wait(500); // wait for animation
40-
cy.get('#page-sidebar').contains(path[1]).click();
41-
});
42-
4333
Cypress.Commands.add('selectByDropDownText', (selector: string, dropdownText: string) => {
4434
cy.get(selector).click();
4535
cy.get('li').contains(dropdownText).click({ force: true });

frontend/packages/helm-plugin/integration-tests/features/helm-release.feature

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ Feature: Helm Release
55

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

1011

1112
Scenario: Open the Helm tab on the navigation bar when helm charts are absent: HR-05-TC01
@@ -49,7 +50,7 @@ Feature: Helm Release
4950
And user is able to see the status and status icon of Revision history page
5051

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

@@ -83,7 +84,7 @@ Feature: Helm Release
8384

8485

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

102103

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

112113

113114
Scenario: Delete Helm Release through Context Menu: HR-01-TC03
114-
Given user is at the Topology page in admin view
115+
Given user is at the Topology page
115116
When user right clicks on the helm release "nodejs-release" to open the context menu
116117
And user clicks on the "Delete Helm Release" action
117118
And user enters the release name "nodejs-release"

frontend/packages/helm-plugin/integration-tests/support/commands/hooks.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1+
import { app } from '@console/dev-console/integration-tests/support/pages';
2+
13
before(() => {
2-
const bridgePasswordIDP: string = Cypress.expose('BRIDGE_HTPASSWD_IDP') || 'test';
3-
const bridgePasswordUsername: string = Cypress.expose('BRIDGE_HTPASSWD_USERNAME') || 'test';
4-
cy.env(['BRIDGE_HTPASSWD_PASSWORD']).then(({ BRIDGE_HTPASSWD_PASSWORD }) => {
5-
cy.login(bridgePasswordIDP, bridgePasswordUsername, BRIDGE_HTPASSWD_PASSWORD || 'test');
6-
});
4+
cy.login();
75
cy.document().its('readyState').should('eq', 'complete');
86
cy.window().then((win: any) => {
97
win.SERVER_FLAGS.userSettingsLocation = 'localstorage';
@@ -13,8 +11,7 @@ before(() => {
1311
});
1412

1513
beforeEach(() => {
16-
cy.initAdmin();
17-
cy.byLegacyTestID('topology-header').should('exist').click({ force: true });
14+
app.waitForLoad();
1815
});
1916

2017
after(() => {

frontend/packages/helm-plugin/integration-tests/support/step-definitions/common/common.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,6 @@ Given('user is at the Topology page', () => {
4040
topologyPage.verifyTopologyPage();
4141
});
4242

43-
Given('user is at the Topology page in admin view', () => {
44-
cy.byLegacyTestID('topology-header').should('exist').click({ force: true });
45-
app.waitForLoad();
46-
topologyPage.verifyTopologyPage();
47-
});
48-
4943
When('user enters Git Repo url as {string}', (gitUrl: string) => {
5044
gitPage.enterGitUrl(gitUrl);
5145
gitPage.verifyValidatedMessage(gitUrl);

frontend/packages/integration-tests/support/index.ts

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -50,19 +50,6 @@ Cypress.Commands.add('visitAndWait', (url, options, selector = '#content') => {
5050
waitForElementToExist(selector);
5151
});
5252

53-
Cypress.Commands.add('clickNavLink', (path: string[]) => {
54-
cy.get('#page-sidebar')
55-
.contains(path[0])
56-
.then(($navItem) => {
57-
if ($navItem.attr('aria-expanded') !== 'true') {
58-
cy.wrap($navItem).click();
59-
}
60-
});
61-
if (path.length === 2) {
62-
cy.get('#page-sidebar').contains(path[1]).click();
63-
}
64-
});
65-
6653
before(() => {
6754
cy.task('readFileIfExists', 'cypress-a11y-report.json').then((a11yReportOrNull: string) => {
6855
if (a11yReportOrNull !== null) {

0 commit comments

Comments
 (0)