forked from talamer/console
-
Notifications
You must be signed in to change notification settings - Fork 0
/
helm-release.ts
166 lines (140 loc) · 5.03 KB
/
helm-release.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
import { Given, When, Then } from 'cypress-cucumber-preprocessor/steps';
import {
devNavigationMenu,
pageTitle,
helmActions,
} from '@console/dev-console/integration-tests/support/constants';
import { helmPO } from '@console/dev-console/integration-tests/support/pageObjects';
import {
topologyPage,
topologySidePane,
app,
navigateTo,
createHelmChartFromAddPage,
} from '@console/dev-console/integration-tests/support/pages';
import { detailsPage } from '../../../../../integration-tests-cypress/views/details-page';
import { upgradeHelmRelease, helmDetailsPage, rollBackHelmRelease, helmPage } from '../../pages';
Given('helm release {string} is present in topology page', (workloadName: string) => {
createHelmChartFromAddPage(workloadName);
});
Given('user has installed helm release {string}', (helmReleaseName: string) => {
createHelmChartFromAddPage(helmReleaseName);
});
When(
'user right clicks on the helm release {string} to open the context menu',
(helmReleaseName: string) => {
topologyPage.verifyWorkloadInTopologyPage(helmReleaseName);
topologyPage.rightClickOnHelmWorkload(helmReleaseName);
},
);
Then(
'user is able to see the context menu with actions Upgrade, Rollback and Uninstall Helm Release',
() => {
cy.get('ul[role="menu"]').should('be.visible');
cy.get(helmPO.helmActions.upgrade).should('be.visible');
cy.get(helmPO.helmActions.rollBack).should('be.visible');
cy.get(helmPO.helmActions.deleteHelmRelease).should('be.visible');
},
);
Then('user is able to see the context menu with actions Upgrade and Delete Helm Release', () => {
cy.get('div.odc-topology-context-menu').should('be.visible');
cy.byTestActionID('Upgrade').should('be.visible');
cy.byTestActionID('Delete Helm Release').should('be.visible');
});
Given('user is on the topology sidebar of the helm release {string}', (helmReleaseName: string) => {
topologyPage.clickOnGroup(helmReleaseName);
topologySidePane.verify();
});
When('user clicks on the Actions drop down menu', () => {
topologySidePane.clickActionsDropDown();
});
Then(
'user is able to see the actions dropdown menu with actions Upgrade, Rollback and Uninstall Helm Release',
() => {
topologySidePane.verifyActions(
helmActions.upgrade,
helmActions.rollback,
helmActions.deleteHelmRelease,
);
},
);
Then(
'user is able to see the actions dropdown menu with actions Upgrade and Uninstall Helm Release',
() => {
const actions = ['Upgrade', 'Uninstall Helm Release'];
cy.byLegacyTestID('action-items')
.children()
.each(($ele) => {
expect(actions).toContain($ele.text());
});
},
);
Given('user is on the Helm page with helm release {string}', (helmRelease: string) => {
navigateTo(devNavigationMenu.Helm);
helmPage.search(helmRelease);
});
Then('user will be redirected to Helm Releases page', () => {
detailsPage.titleShouldContain(pageTitle.Helm);
});
When('user clicks on the Kebab menu', () => {
helmPage.selectKebabMenu();
});
Then(
'user is able to see kebab menu with actions Upgrade, Rollback and Delete Helm Release',
() => {
topologySidePane.verifyActions(
helmActions.upgrade,
helmActions.rollback,
helmActions.deleteHelmRelease,
);
},
);
When('user clicks on the {string} action', (actionName: string) => {
helmPage.selectHelmActionFromMenu(actionName);
});
When('user upgrades the chart Version', () => {
upgradeHelmRelease.upgradeChartVersion();
});
When('user clicks on the upgrade button', () => {
upgradeHelmRelease.clickOnUpgrade();
});
When('user selects the version to Rollback', () => {
rollBackHelmRelease.selectRevision();
});
When('user clicks on the rollback button', () => {
rollBackHelmRelease.clickOnRollBack();
cy.get('.co-m-loader', { timeout: 40000 }).should('not.exist');
});
When('user enters the release name {string}', (releaseName: string) => {
helmDetailsPage.enterReleaseNameInUninstallPopup(releaseName);
});
When('user clicks on the Delete button', () => {
helmDetailsPage.uninstallHelmRelease();
});
Then('user will be redirected to Topology page', () => {
cy.reload();
app.waitForDocumentLoad();
topologyPage.verifyTopologyPage();
});
When('user clicks on the helm release {string}', (helmReleaseName: string) => {
topologyPage.clickOnGroup(helmReleaseName);
});
Then('user will see the sidebar for the helm release', () => {
topologySidePane.verify();
});
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.clickOnGroup(helmReleaseName);
topologySidePane.verify();
});
Then('user will see the {string} action item', (actionItem: string) => {
cy.byTestActionID(actionItem).should('be.visible');
});
Then('user is redirected to the {string} Details page for the helm release', (resource: string) => {
cy.get(`[data-test-section-heading="${resource} details"] span`).should(
'contain.text',
`${resource} details`,
);
});