Skip to content

Commit 558ac52

Browse files
Merge pull request #2942 from RedisInsight/e2e/feature/RI-5246-insights-opening
add verification for deeplinking
2 parents 686950f + 80be6b5 commit 558ac52

File tree

4 files changed

+24
-3
lines changed

4 files changed

+24
-3
lines changed

tests/e2e/pageObjects/components/insights-panel.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,19 @@ export class InsightsPanel {
3838
async setActiveTab(type: ExploreTabs.Explore): Promise<ExploreTab>
3939
async setActiveTab(type: ExploreTabs.Recommendations): Promise<RecommendationsTab>
4040
async setActiveTab(type: ExploreTabs): Promise<ExploreTab | RecommendationsTab> {
41+
const activeTabName = await this.getActiveTabName();
4142
if(type === ExploreTabs.Explore) {
42-
await t.click(this.exploreTab);
43+
if(type !== activeTabName) {
44+
await t.click(this.exploreTab);
45+
}
4346
return new ExploreTab();
4447
}
4548

46-
await t.click(this.recommendationsTab);
49+
if(type !== activeTabName) {
50+
await t.click(this.recommendationsTab);
51+
}
4752
return new RecommendationsTab();
53+
4854
}
4955

5056
/**

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,4 +69,12 @@ export class RecommendationsTab {
6969
const recommendationSnoozeBtn = Selector(`[data-testid=${recommendationName}-delete-btn]`);
7070
await t.click(recommendationSnoozeBtn);
7171
}
72+
/**
73+
* click tutorial button in the recommendation
74+
* @param recommendationName Name of recommendation
75+
*/
76+
async clickOnTutorialLink(recommendationName: RecommendationIds): Promise<void> {
77+
const tutorialBtn = Selector(`[data-testid=${recommendationName}-to-tutorial-btn]`);
78+
await t.click(tutorialBtn);
79+
}
7280
}

tests/e2e/tests/web/critical-path/url-handling/url-handling.e2e.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { commonUrl, ossStandaloneRedisGears } from '../../../../helpers/conf';
2-
import { rte } from '../../../../helpers/constants';
2+
import { ExploreTabs, rte } from '../../../../helpers/constants';
33
import { DatabaseAPIRequests } from '../../../../helpers/api/api-database';
44
import { Common } from '../../../../helpers/common';
55
import { BrowserPage, MyRedisDatabasePage, WorkbenchPage } from '../../../../pageObjects';
@@ -79,6 +79,9 @@ test
7979
await t.navigateTo(generateLink(connectUrlParams));
8080
await t.wait(10_000);
8181
await t.expect(workbenchPage.submitCommandButton.exists).ok('Redirection to Workbench is not correct');
82+
const tab = await workbenchPage.InsightsPanel.setActiveTab(ExploreTabs.Explore);
83+
await t.expect(tab.preselectArea.textContent).contains('INTRODUCTION', 'the tutorial page is incorrect');
84+
await t.expect(tab.preselectArea.textContent).contains('Document', 'the tutorial is incorrect');
8285

8386
//Verify that the same db is not added
8487
await t.navigateTo(generateLink(connectUrlParams));

tests/e2e/tests/web/regression/insights/live-recommendations.e2e.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,10 @@ test
109109
tab = await browserPage.InsightsPanel.setActiveTab(ExploreTabs.Recommendations);
110110
// Verify that user can see the live recommendation "Optimize the use of time series"
111111
await t.expect(await tab.getRecommendationByName(redisTimeSeriesRecom).visible).ok('Optimize Time Series recommendation not displayed');
112+
await tab.clickOnTutorialLink(redisTimeSeriesRecom);
113+
const tabTutorial = await workbenchPage.InsightsPanel.setActiveTab(ExploreTabs.Explore);
114+
await t.expect(tabTutorial.preselectArea.textContent).contains('INTRODUCTION', 'the tutorial page is incorrect');
115+
await t.expect(tabTutorial.preselectArea.textContent).contains('Time Series', 'the tutorial is incorrect');
112116
});
113117
test
114118
.requestHooks(logger)

0 commit comments

Comments
 (0)