Skip to content

Commit 721ecd4

Browse files
committed
e2e/feature/RI-6321_collapse-my-tutorials
1 parent c150983 commit 721ecd4

File tree

2 files changed

+21
-2
lines changed

2 files changed

+21
-2
lines changed

tests/e2e/pageObjects/components/explore-tab.ts

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,11 @@ export class ExploreTab {
5757
* Run code
5858
* @param block Name of the block
5959
*/
60-
async runBlockCode(block: string): Promise<void> {
60+
async runBlockCode(block: string): Promise<void> {
6161
const runButton = Selector(this.runMask.replace(/\$name/g, block));
6262
await t.scrollIntoView(runButton);
6363
await t.click(runButton);
64-
if(await this.tutorialPopoverConfirmRunButton.exists){
64+
if (await this.tutorialPopoverConfirmRunButton.exists) {
6565
await t.click(this.tutorialPopoverConfirmRunButton);
6666
}
6767
}
@@ -149,4 +149,15 @@ export class ExploreTab {
149149
getTutorialByName(name: string): Selector {
150150
return Selector('div').withText(name);
151151
}
152+
153+
/**
154+
* Expand/Collapse My tutorial Panel
155+
* @param state State of panel
156+
*/
157+
async toggleMyTutorialPanel(state: boolean = true): Promise<void> {
158+
const currentState = await this.customTutorials.getAttribute('aria-expanded') === 'true';
159+
if (currentState !== state) {
160+
await t.click(this.customTutorials);
161+
}
162+
}
152163
}

tests/e2e/tests/web/regression/insights/import-tutorials.e2e.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,11 @@ test
7373
const tutorials = await browserPage.InsightsPanel.setActiveTab(ExploreTabs.Tutorials);
7474

7575
await t.expect(tutorials.customTutorials.visible).ok('custom tutorials sections is not visible');
76+
// Verify that user can see "My Tutorials" tab is collapsed by default in tutorials
77+
await t.expect(tutorials.customTutorials.getAttribute('aria-expanded')).eql('false', 'My tutorials not closed by default');
78+
79+
// Expand My tutorials
80+
await tutorials.toggleMyTutorialPanel();
7681
await t.click(tutorials.tutorialOpenUploadButton);
7782
await t.expect(tutorials.tutorialSubmitButton.hasAttribute('disabled')).ok('submit button is not disabled');
7883

@@ -138,6 +143,7 @@ test
138143

139144
await workbenchPage.NavigationHeader.togglePanel(true);
140145
const tutorials = await workbenchPage.InsightsPanel.setActiveTab(ExploreTabs.Tutorials);
146+
await tutorials.toggleMyTutorialPanel();
141147
await t.click(tutorials.tutorialOpenUploadButton);
142148
// Verify that user can upload tutorials using a URL
143149
await t.typeText(tutorials.tutorialLinkField, link);
@@ -199,6 +205,7 @@ test
199205
// Upload custom tutorial
200206
await workbenchPage.NavigationHeader.togglePanel(true);
201207
const tutorials = await workbenchPage.InsightsPanel.setActiveTab(ExploreTabs.Tutorials);
208+
await tutorials.toggleMyTutorialPanel();
202209
await t
203210
.click(tutorials.tutorialOpenUploadButton)
204211
.setFilesToUpload(tutorials.tutorialImport, [zipFilePath])
@@ -269,6 +276,7 @@ test
269276
// Upload custom tutorial
270277
await workbenchPage.NavigationHeader.togglePanel(true);
271278
const tutorials = await workbenchPage.InsightsPanel.setActiveTab(ExploreTabs.Tutorials);
279+
await tutorials.toggleMyTutorialPanel();
272280
await t
273281
.click(tutorials.tutorialOpenUploadButton)
274282
.setFilesToUpload(tutorials.tutorialImport, [zipFilePath])

0 commit comments

Comments
 (0)