File tree Expand file tree Collapse file tree 4 files changed +24
-3
lines changed
critical-path/url-handling Expand file tree Collapse file tree 4 files changed +24
-3
lines changed Original file line number Diff line number Diff line change @@ -38,13 +38,19 @@ export class InsightsPanel {
38
38
async setActiveTab ( type : ExploreTabs . Explore ) : Promise < ExploreTab >
39
39
async setActiveTab ( type : ExploreTabs . Recommendations ) : Promise < RecommendationsTab >
40
40
async setActiveTab ( type : ExploreTabs ) : Promise < ExploreTab | RecommendationsTab > {
41
+ const activeTabName = await this . getActiveTabName ( ) ;
41
42
if ( type === ExploreTabs . Explore ) {
42
- await t . click ( this . exploreTab ) ;
43
+ if ( type !== activeTabName ) {
44
+ await t . click ( this . exploreTab ) ;
45
+ }
43
46
return new ExploreTab ( ) ;
44
47
}
45
48
46
- await t . click ( this . recommendationsTab ) ;
49
+ if ( type !== activeTabName ) {
50
+ await t . click ( this . recommendationsTab ) ;
51
+ }
47
52
return new RecommendationsTab ( ) ;
53
+
48
54
}
49
55
50
56
/**
Original file line number Diff line number Diff line change @@ -69,4 +69,12 @@ export class RecommendationsTab {
69
69
const recommendationSnoozeBtn = Selector ( `[data-testid=${ recommendationName } -delete-btn]` ) ;
70
70
await t . click ( recommendationSnoozeBtn ) ;
71
71
}
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
+ }
72
80
}
Original file line number Diff line number Diff line change 1
1
import { commonUrl , ossStandaloneRedisGears } from '../../../../helpers/conf' ;
2
- import { rte } from '../../../../helpers/constants' ;
2
+ import { ExploreTabs , rte } from '../../../../helpers/constants' ;
3
3
import { DatabaseAPIRequests } from '../../../../helpers/api/api-database' ;
4
4
import { Common } from '../../../../helpers/common' ;
5
5
import { BrowserPage , MyRedisDatabasePage , WorkbenchPage } from '../../../../pageObjects' ;
79
79
await t . navigateTo ( generateLink ( connectUrlParams ) ) ;
80
80
await t . wait ( 10_000 ) ;
81
81
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' ) ;
82
85
83
86
//Verify that the same db is not added
84
87
await t . navigateTo ( generateLink ( connectUrlParams ) ) ;
Original file line number Diff line number Diff line change @@ -109,6 +109,10 @@ test
109
109
tab = await browserPage . InsightsPanel . setActiveTab ( ExploreTabs . Recommendations ) ;
110
110
// Verify that user can see the live recommendation "Optimize the use of time series"
111
111
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' ) ;
112
116
} ) ;
113
117
test
114
118
. requestHooks ( logger )
You can’t perform that action at this time.
0 commit comments