1
- import { MyRedisDatabasePage , MemoryEfficiencyPage , BrowserPage , CliPage , AddRedisDatabasePage } from '../../../pageObjects' ;
1
+ import { Selector } from 'testcafe' ;
2
+ import { MyRedisDatabasePage , MemoryEfficiencyPage , BrowserPage , CliPage , AddRedisDatabasePage , WorkbenchPage } from '../../../pageObjects' ;
2
3
import { rte } from '../../../helpers/constants' ;
3
4
import { acceptLicenseTermsAndAddDatabaseApi , deleteCustomDatabase } from '../../../helpers/database' ;
4
5
import { commonUrl , ossStandaloneBigConfig , ossStandaloneConfig } from '../../../helpers/conf' ;
@@ -15,6 +16,7 @@ const browserPage = new BrowserPage();
15
16
const cliPage = new CliPage ( ) ;
16
17
const addRedisDatabasePage = new AddRedisDatabasePage ( ) ;
17
18
const memoryEfficiencyActions = new MemoryEfficiencyActions ( ) ;
19
+ const workbenchPage = new WorkbenchPage ( ) ;
18
20
19
21
const externalPageLink = 'https://docs.redis.com/latest/ri/memory-optimizations/' ;
20
22
let keyName = `recomKey-${ common . generateWord ( 10 ) } ` ;
80
82
// Close the window with external link to switch to the application window
81
83
await t . closeWindow ( ) ;
82
84
} ) ;
83
- // skipped due to inability to receive no recommendations for now
85
+ // skipped due to inability to receive no recommendations for now
84
86
test . skip ( 'No recommendations message' , async t => {
85
87
keyName = `recomKey-${ common . generateWord ( 10 ) } ` ;
86
88
const noRecommendationsMessage = 'No recommendations at the moment, run a new report later to keep up the good work!' ;
@@ -146,3 +148,31 @@ test
146
148
// Verify that user can see the popup with link when he votes for “Not useful”
147
149
await t . expect ( memoryEfficiencyPage . recommendationsFeedbackBtn . visible ) . ok ( 'popup did not appear after voting for not useful' ) ;
148
150
} ) ;
151
+ test
152
+ . before ( async t => {
153
+ await acceptLicenseTermsAndAddDatabaseApi ( ossStandaloneConfig , ossStandaloneConfig . databaseName ) ;
154
+ keyName = `recomKey-${ common . generateWord ( 10 ) } ` ;
155
+ await browserPage . addZSetKey ( keyName , '151153320500121' , '2147476121' , '1511533205001:21' ) ;
156
+ // Go to Analysis Tools page
157
+ await t . click ( myRedisDatabasePage . analysisPageButton ) ;
158
+ await t . click ( memoryEfficiencyPage . newReportBtn ) ;
159
+ // Go to Recommendations tab
160
+ await t . click ( memoryEfficiencyPage . recommendationsTab ) ;
161
+ } )
162
+ . after ( async t => {
163
+ // Clear and delete database
164
+ await t . click ( myRedisDatabasePage . browserButton ) ;
165
+ await browserPage . deleteKeyByName ( keyName ) ;
166
+ await deleteStandaloneDatabaseApi ( ossStandaloneConfig ) ;
167
+ } ) ( 'Verify that user can see the Tutorial opened when clicking on "To Tutorial" for recommendations' , async t => {
168
+ const optimizeTsRecommendation = await memoryEfficiencyPage . getRecommendationByName ( 'Optimize the use of time series' ) ;
169
+ const toTutorialBtn = optimizeTsRecommendation . find ( memoryEfficiencyPage . cssToTutorialsBtn ) ;
170
+
171
+ // Verify that Optimize the use of time series recommendation displayed
172
+ await t . expect ( optimizeTsRecommendation . exists ) . ok ( 'Optimize the use of time series recommendation not displayed' ) ;
173
+ // Verify that tutorial opened
174
+ await t . click ( toTutorialBtn ) ;
175
+ await t . expect ( workbenchPage . preselectArea . visible ) . ok ( 'Workbench Enablement area not opened' ) ;
176
+ // Verify that REDIS FOR TIME SERIES tutorial expanded
177
+ await t . expect ( ( await workbenchPage . getTutorialByName ( 'REDIS FOR TIME SERIES' ) ) . visible ) . ok ( 'REDIS FOR TIME SERIES tutorial is not expanded' ) ;
178
+ } ) ;
0 commit comments