Skip to content

Commit 05b4fc2

Browse files
Merge pull request #13511 from The-Anton/developer-hub-install-with-helm-chart-automation
ODC-7478: Gherkin and automation of "Install Red Hat Developer Hub with a Helm Chart" guided tour
2 parents ea77e7b + f63b012 commit 05b4fc2

3 files changed

Lines changed: 357 additions & 0 deletions

File tree

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
@guided-tour @dev-console
2+
Feature: Install Red Hat Developer Hub (RHDH) with a Helm Chart tour
3+
As a user, I want to take a guided tour to deploy an application with a pipeline feature
4+
5+
Background:
6+
Given user is at developer perspective
7+
And user is at Add page
8+
And user has created or selected namespace "developerhub-install"
9+
10+
@regression
11+
Scenario: Starting tour from the Add page: GT-01-TC01
12+
Given Build with guided documentation card is present in Add page
13+
When user click on Add to project icon
14+
And user types "Install Red Hat Developer Hub (RHDH) with a Helm Chart" in input box
15+
And user clicks on Start button from the quick search result
16+
And user see the tour will start with link to four steps present as a sidepane with close button
17+
And user clicks on the "Start" tour option to see "Install Red Hat Developer Hub with a Helm Chart" step to install Red Hat Developer Hub
18+
And user clicks on next button
19+
And user selects Yes option for alert titled "Check your work" asking to "verify the application was successfully created"
20+
And user clicks on next to see "Know how to upgrade your Red Hat Developer Hub installation" step started for upgrading developer installation
21+
And user selects Yes option for alert titled "Check your work" asking to "verify the application was successfully upgraded"
22+
And user clicks on next to see "Optional: Change the URL of your Red Hat Developer Hub instance" optional step to modify developer hub instance URL
23+
And user selects Yes option for alert titled "Check your work" asking to "verify the application was successfully updated"
24+
And user clicks on next to see "Optional: Add Red Hat Developer Hub to the OpenShift Console Application menu" optional step to add developer hub to Openshift Console menu
25+
And user selects Yes option for alert titled "Check your work" asking to "verify that the application menu link"
26+
And user clicks on next button
27+
Then user sees the message saying "Your Red Hat Developer Hub installation is deployed and ready."
28+
And user sees "Close", "Back" and "Restart"
29+
30+
@regression
31+
Scenario: Starting tour from the Quick Starts page: GT-01-TC02
32+
Given Build with guided documentation card is present in Add page
33+
When user clicks on the link "View all quick starts" on the card
34+
And user clicks on the "Install Red Hat Developer Hub (RHDH) with a Helm Chart" link on the card to see the tour will start with link to four steps present as a sidepane with close button
35+
And user clicks on the "Start" tour option to see "Install Red Hat Developer Hub with a Helm Chart" step to install Red Hat Developer Hub
36+
And user clicks on next button
37+
And user selects Yes option for alert titled "Check your work" asking to "verify the application was successfully created"
38+
And user clicks on next to see "Know how to upgrade your Red Hat Developer Hub installation" step started for upgrading developer installation
39+
And user selects Yes option for alert titled "Check your work" asking to "verify the application was successfully upgraded"
40+
And user clicks on next to see "Optional: Change the URL of your Red Hat Developer Hub instance" optional step to modify developer hub instance URL
41+
And user selects Yes option for alert titled "Check your work" asking to "verify the application was successfully updated"
42+
And user clicks on next to see "Optional: Add Red Hat Developer Hub to the OpenShift Console Application menu" optional step to add developer hub to Openshift Console menu
43+
And user selects Yes option for alert titled "Check your work" asking to "verify that the application menu link"
44+
And user clicks on next button
45+
Then user sees the message saying "Your Red Hat Developer Hub installation is deployed and ready."
46+
And user sees "Close", "Back" and "Restart"
47+
Then user sees Complete label marked on "Install Red Hat Developer Hub (RHDH) with a Helm Chart" card
48+
49+
@regression
50+
Scenario: Trying No option during the tour: GT-01-TC03
51+
Given user is at Quick Starts catalog page
52+
When user clicks on the "Install Red Hat Developer Hub (RHDH) with a Helm Chart" card
53+
And user clicks on the "Start" tour option to see "Install Red Hat Developer Hub with a Helm Chart" step to install Red Hat Developer Hub
54+
And user clicks on next button
55+
And user selects No option on alert appears "Check your work" asking to verify that your application was successfully created
56+
Then user sees that the alert is saying "Try the steps again"
57+
58+
@regression
59+
Scenario: Avoiding option during the tour: GT-01-TC04
60+
Given user is at Quick Starts catalog page
61+
When user clicks on the "Install Red Hat Developer Hub (RHDH) with a Helm Chart" card
62+
And user clicks on the "Start" tour option to see "Install Red Hat Developer Hub with a Helm Chart" step to install Red Hat Developer Hub
63+
And user sees alert titled "Check your work" asking to "verify the application was successfully created"
64+
And user clicks on next button
65+
And user clicks on next to see next step "Know how to upgrade your Red Hat Developer Hub installation" started
66+
And user clicks on next button
67+
And user sees alert titled "Check your work" asking to "verify the application was successfully upgraded"
68+
And user clicks on next to see "Optional: Change the URL of your Red Hat Developer Hub instance" optional step to modify developer hub instance URL
69+
And user clicks on next button
70+
And user clicks on next to see next step "Optional: Add Red Hat Developer Hub to the OpenShift Console Application menu" started
71+
And user clicks on next button twice
72+
Then user sees Complete label marked on "Install Red Hat Developer Hub (RHDH) with a Helm Chart" card
73+
74+
@regression
75+
Scenario: Review the tour: GT-01-TC05
76+
Given Build with guided documentation card is present in Add page
77+
When user clicks on the link "View all quick starts" on the card
78+
And user clicks on the "Install Red Hat Developer Hub (RHDH) with a Helm Chart" card
79+
And user clicks on the "Start" tour option to see "Install Red Hat Developer Hub with a Helm Chart" step to install Red Hat Developer Hub
80+
And user sees alert titled "Check your work" asking to "verify the application was successfully created"
81+
And user clicks on next button
82+
And user clicks on next to see next step "Know how to upgrade your Red Hat Developer Hub installation" started
83+
And user sees alert titled "Check your work" asking to "verify the application was successfully upgraded"
84+
And user clicks on next button
85+
And user clicks on next to see next step "Optional: Change the URL of your Red Hat Developer Hub instance" started
86+
And user sees alert titled "Check your work" asking to "verify the application was successfully updated"
87+
And user clicks on next button
88+
And user clicks on next to see next step "Optional: Add Red Hat Developer Hub to the OpenShift Console Application menu" started
89+
And user clicks on next button twice
90+
Then user sees Complete label marked on "Install Red Hat Developer Hub (RHDH) with a Helm Chart" card
91+
92+
@regression
93+
Scenario: Stopping and again resuming the tour: GT-01-TC06
94+
Given Build with guided documentation card is present in Add page
95+
When user clicks on the link "View all quick starts" on the card
96+
And user clicks on the "Install Red Hat Developer Hub (RHDH) with a Helm Chart" card
97+
And user clicks on the "Start" tour option to see "Install Red Hat Developer Hub with a Helm Chart" step to install Red Hat Developer Hub
98+
And user selects Yes option on alert titled "Check your work"
99+
And user closes the close button
100+
And user clicks on Leave button on modal "Leave quick start?"
101+
And user clicks on the "Install Red Hat Developer Hub (RHDH) with a Helm Chart" card
102+
103+
@regression
104+
Scenario: Navigating between steps in the tour: GT-01-TC07
105+
Given user is at Quick Starts catalog page
106+
When user clicks on the "Install Red Hat Developer Hub (RHDH) with a Helm Chart" card
107+
And user clicks on third step "Optional: Change the URL of your Red Hat Developer Hub instance" from the link to four steps present in the card
108+
And user selects Yes option in alert titled "Check your work"
109+
And user clicks on second step "Know how to upgrade your Red Hat Developer Hub installation"
110+
And user selects Yes option in alert titled "Check your work"
111+
And user clicks on first step "Install Red Hat Developer Hub with a Helm Chart" step
112+
And user selects Yes option in alert titled "Check your work"
113+
And user clicks on next to see step "Know how to upgrade your Red Hat Developer Hub installation" with "Check your work" alert
114+
And user clicks on next to see step "Optional: Change the URL of your Red Hat Developer Hub instance" with "Check your work" alert
115+
And user clicks on next to see step "Optional: Add Red Hat Developer Hub to the OpenShift Console Application menu" with "Check your work" alert
116+
And user clicks on next button twice
117+
Then user sees the message saying "Your Red Hat Developer Hub installation is deployed and ready."

frontend/packages/dev-console/integration-tests/support/pageObjects/quickStarts-po.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ export const quickStartDisplayNameToName = (displayName: string) => {
4545
case 'Install the OpenShift Serverless Operator': {
4646
return 'install-serverless';
4747
}
48+
case 'Install Red Hat Developer Hub (RHDH) with a Helm Chart': {
49+
return 'rhdh-installation-via-helm';
50+
}
4851
case 'Create ruby app': {
4952
return 'copy-execute-demo';
5053
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,237 @@
1+
import { Given, Then, When } from 'cypress-cucumber-preprocessor/steps';
2+
import {
3+
devNavigationMenuPO,
4+
quickSearchAddPO,
5+
quickStartCard,
6+
quickStartLeaveModalPO,
7+
quickStartSidebarPO,
8+
} from '../../pageObjects';
9+
import { app } from '../../pages';
10+
11+
Given('Build with guided documentation card is present in Add page', () => {
12+
cy.byTestID('card quick-start').should('be.visible');
13+
});
14+
15+
When('user click on Add to project icon', () => {
16+
cy.get(quickSearchAddPO.quickSearchButton).click();
17+
});
18+
19+
When('user clicks on Start button from the quick search result', () => {
20+
cy.get(quickSearchAddPO.quickSearchCreateButton).click();
21+
});
22+
23+
When('user types {string} in input box', (tourName: string) => {
24+
cy.get(quickSearchAddPO.quickSearchInput).type(tourName);
25+
});
26+
27+
When(
28+
'user see the tour will start with link to four steps present as a sidepane with close button',
29+
() => {
30+
cy.get(quickStartSidebarPO.quickStartSidebar).should('be.visible');
31+
cy.get('[class*="quick-start-task-header__title"]').then(($elements) => {
32+
return $elements.length === 3;
33+
});
34+
},
35+
);
36+
37+
When(
38+
'user clicks on the {string} link on the card to see the tour will start with link to four steps present as a sidepane with close button',
39+
(tourName: string) => {
40+
cy.get(quickStartCard(tourName)).click();
41+
cy.get(quickStartSidebarPO.quickStartSidebar).contains(tourName);
42+
cy.get('[class*="quick-start-task-header__title"]').then(($elements) => {
43+
return $elements.length === 4;
44+
});
45+
cy.get(quickStartSidebarPO.closePanel).should('be.visible');
46+
},
47+
);
48+
49+
When(
50+
'user clicks on the "Start" tour option to see {string} step to install Red Hat Developer Hub',
51+
(stepName: string) => {
52+
cy.get(quickStartSidebarPO.startButton).click();
53+
cy.get(quickStartSidebarPO.quickStartSidebar).get('h3').contains(stepName);
54+
cy.byLegacyTestID('quick-start-task-subtitle').contains('1 of 4');
55+
},
56+
);
57+
58+
When('user clicks on next button twice', () => {
59+
cy.get(quickStartSidebarPO.nextButton).click();
60+
app.waitForLoad();
61+
cy.get(quickStartSidebarPO.nextButton).click();
62+
});
63+
64+
When('user clicks on next button', () => {
65+
cy.get(quickStartSidebarPO.nextButton).click();
66+
});
67+
68+
When(
69+
'user selects Yes option for alert titled {string} asking to {string}',
70+
(alert: string, message: string) => {
71+
cy.byTestID('quickstart drawer').contains(alert);
72+
cy.byTestID('quickstart drawer').contains(message);
73+
cy.get(quickStartSidebarPO.yesOptionCheckInput).click();
74+
},
75+
);
76+
77+
When('user selects Yes option on alert titled {string}', (alert: string) => {
78+
cy.get(quickStartSidebarPO.quickStartSidebar).contains(alert);
79+
cy.get(quickStartSidebarPO.yesOptionCheckInput).click();
80+
});
81+
82+
When(
83+
'user clicks on next to see {string} step started for upgrading developer installation',
84+
(stepName: string) => {
85+
cy.get(quickStartSidebarPO.nextButton).click();
86+
cy.get(quickStartSidebarPO.quickStartSidebar).get('h3').contains(stepName);
87+
},
88+
);
89+
90+
When(
91+
'user clicks on next to see {string} optional step to modify developer hub instance URL',
92+
(stepName: string) => {
93+
cy.get(quickStartSidebarPO.nextButton).click();
94+
cy.get(quickStartSidebarPO.quickStartSidebar).get('h3').contains(stepName);
95+
},
96+
);
97+
98+
When(
99+
'user clicks on next to see {string} optional step to add developer hub to Openshift Console menu',
100+
(stepName: string) => {
101+
cy.get(quickStartSidebarPO.nextButton).click();
102+
cy.get(quickStartSidebarPO.quickStartSidebar).get('h3').contains(stepName);
103+
},
104+
);
105+
106+
When('user clicks on next to see next step {string} started', (stepName: string) => {
107+
cy.get(quickStartSidebarPO.nextButton).click();
108+
cy.get(quickStartSidebarPO.quickStartSidebar).get('h3').contains(stepName);
109+
});
110+
111+
When('user sees the message saying {string}', (message: string) => {
112+
cy.get(quickStartSidebarPO.quickStartSidebar).contains(message);
113+
});
114+
115+
When('user sees "Close", "Back" and "Restart"', () => {
116+
cy.get(quickStartSidebarPO.closePanel).should('be.visible');
117+
cy.get(quickStartSidebarPO.backButton).should('be.visible');
118+
cy.get(quickStartSidebarPO.restartSideNoteAction).should('be.visible');
119+
});
120+
121+
When('user clicks on the link {string} on the card', (link: string) => {
122+
cy.byTestID('item all-quick-starts').contains(link).click();
123+
});
124+
125+
When(
126+
'user sees Complete label marked on {string} card after clicking on "close" button to close the sidepane',
127+
(tourName: string) => {
128+
cy.get(quickStartSidebarPO.closePanel).click();
129+
cy.get(quickStartCard(tourName)).byTestID('status').contains('Complete');
130+
},
131+
);
132+
133+
When('user clicks on the link {string} on the card', (linkString: string) => {
134+
cy.byTestID('item all-quick-starts').contains(linkString).click();
135+
});
136+
137+
Given('user is at Quick Starts catalog page', () => {
138+
cy.get(devNavigationMenuPO.add).click();
139+
cy.byTestID('item all-quick-starts').click();
140+
});
141+
142+
When('user clicks on the Start tour option to see {string} step is started', (stepName: string) => {
143+
cy.get(quickStartSidebarPO.quickStartSidebar).contains(stepName);
144+
cy.get(quickStartSidebarPO.quickStartSidebar).byTestID('Start button').click();
145+
});
146+
147+
When('user clicks on the {string} card', (tourName: string) => {
148+
cy.reload();
149+
cy.get(quickStartCard(tourName)).click('topRight');
150+
});
151+
152+
When(
153+
'user selects No option on alert appears "Check your work" asking to verify that your application was successfully created',
154+
() => {
155+
cy.get(quickStartSidebarPO.noOptionCheckInput).click();
156+
},
157+
);
158+
159+
Then('user sees that the alert is saying {string}', (alert: string) => {
160+
cy.get(quickStartSidebarPO.quickStartSidebar).contains(alert);
161+
});
162+
163+
When('user clicks "close" button to close the sidepane back to tour page', () => {
164+
cy.byTestID('Close button').click();
165+
});
166+
167+
When('user sees alert titled {string} asking to {string}', (alert: string, message: string) => {
168+
cy.get(quickStartSidebarPO.quickStartSidebar).contains(alert);
169+
cy.get(quickStartSidebarPO.quickStartSidebar).contains(message);
170+
});
171+
172+
When('user clicks back button to go back to previous step', () => {
173+
cy.get(quickStartSidebarPO.backButton).click();
174+
});
175+
176+
When('user clicks on Close button', () => {
177+
cy.byTestID('Close button').click();
178+
});
179+
180+
Then('user sees Complete label marked on {string} card', (tourName: string) => {
181+
cy.get(quickStartCard(tourName)).byTestID('status').contains('Complete');
182+
});
183+
184+
When('user closes the close button', () => {
185+
cy.get(quickStartSidebarPO.closePanel).click();
186+
});
187+
188+
When('user clicks on Leave button on modal {string}', (modelString: string) => {
189+
cy.get('[role="dialog"]').contains(modelString);
190+
cy.get(quickStartLeaveModalPO.leaveButton).click();
191+
});
192+
193+
Then(
194+
'user sees that the tour has started again with Yes option selected for the alert titled {string} in step 1',
195+
(alert: string) => {
196+
cy.byLegacyTestID('quick-start-task-subtitle').contains('1 of 4');
197+
cy.get(quickStartSidebarPO.quickStartSidebar).contains(alert);
198+
cy.get(quickStartSidebarPO.yesOptionCheckInput).should('be.checked');
199+
},
200+
);
201+
202+
When(
203+
'user clicks on third step {string} from the link to four steps present in the card',
204+
(stepName: string) => {
205+
cy.get(quickStartSidebarPO.quickStartSidebar).contains('h3', stepName).click();
206+
},
207+
);
208+
209+
When('user clicks on second step {string}', (stepName: string) => {
210+
cy.get(quickStartSidebarPO.quickStartSidebar).contains('h3', stepName).click();
211+
});
212+
213+
When('user clicks on first step {string} step', (stepName: string) => {
214+
cy.get(quickStartSidebarPO.quickStartSidebar).contains('h3', stepName).click();
215+
});
216+
217+
When(
218+
'user clicks on next to see step {string} with {string} alert',
219+
(stepName: string, alert: string) => {
220+
cy.get(quickStartSidebarPO.nextButton).click();
221+
cy.get(quickStartSidebarPO.quickStartSidebar).contains('h3', stepName);
222+
cy.get(quickStartSidebarPO.quickStartSidebar).contains(alert);
223+
},
224+
);
225+
226+
When(
227+
'user clicks on next to see step {string} with {string} alert',
228+
(stepName: string, alert: string) => {
229+
cy.get(quickStartSidebarPO.nextButton).click();
230+
cy.get(quickStartSidebarPO.quickStartSidebar).contains('h3', stepName);
231+
cy.get(quickStartSidebarPO.quickStartSidebar).contains(alert);
232+
},
233+
);
234+
235+
When('user selects Yes option in alert titled {string}', (title: string) => {
236+
cy.get(quickStartSidebarPO.quickStartSidebar).contains(title);
237+
});

0 commit comments

Comments
 (0)