@@ -4,6 +4,7 @@ import { acceptLicenseTermsAndAddDatabaseApi, deleteCustomDatabase } from '../..
4
4
import { commonUrl , ossStandaloneBigConfig , ossStandaloneConfig } from '../../../helpers/conf' ;
5
5
import { deleteStandaloneDatabaseApi } from '../../../helpers/api/api-database' ;
6
6
import { CliActions } from '../../../common-actions/cli-actions' ;
7
+ import { MemoryEfficiencyActions } from '../../../common-actions/memory-efficiency-actions' ;
7
8
import { Common } from '../../../helpers/common' ;
8
9
9
10
const memoryEfficiencyPage = new MemoryEfficiencyPage ( ) ;
@@ -13,6 +14,7 @@ const common = new Common();
13
14
const browserPage = new BrowserPage ( ) ;
14
15
const cliPage = new CliPage ( ) ;
15
16
const addRedisDatabasePage = new AddRedisDatabasePage ( ) ;
17
+ const memoryEfficiencyActions = new MemoryEfficiencyActions ( ) ;
16
18
17
19
const externalPageLink = 'https://docs.redis.com/latest/ri/memory-optimizations/' ;
18
20
let keyName = `recomKey-${ common . generateWord ( 10 ) } ` ;
@@ -119,3 +121,27 @@ test
119
121
await t . expect ( memoryEfficiencyPage . avoidLogicalDbAccordion . exists ) . ok ( 'Avoid using logical databases recommendation not displayed' ) ;
120
122
await t . expect ( memoryEfficiencyPage . codeChangesLabel . exists ) . ok ( 'Avoid using logical databases recommendation not have Code Changes label' ) ;
121
123
} ) ;
124
+ test
125
+ . before ( async t => {
126
+ await acceptLicenseTermsAndAddDatabaseApi ( ossStandaloneConfig , ossStandaloneConfig . databaseName ) ;
127
+ // Go to Analysis Tools page and create new report and open recommendations
128
+ await t . click ( myRedisDatabasePage . analysisPageButton ) ;
129
+ await t . click ( memoryEfficiencyPage . newReportBtn ) ;
130
+ await t . click ( memoryEfficiencyPage . recommendationsTab ) ;
131
+ } ) . after ( async ( ) => {
132
+ await deleteStandaloneDatabaseApi ( ossStandaloneConfig ) ;
133
+ } ) ( 'Verify that user can upvote recommendations' , async t => {
134
+ await memoryEfficiencyActions . voteForVeryUsefulAndVerifyDisabled ( ) ;
135
+ // Verify that user can see previous votes when reload the page
136
+ await common . reloadPage ( ) ;
137
+ await t . click ( memoryEfficiencyPage . recommendationsTab ) ;
138
+ await memoryEfficiencyActions . verifyVoteDisabled ( ) ;
139
+
140
+ await t . click ( memoryEfficiencyPage . newReportBtn ) ;
141
+ await memoryEfficiencyActions . voteForUsefulAndVerifyDisabled ( ) ;
142
+
143
+ await t . click ( memoryEfficiencyPage . newReportBtn ) ;
144
+ await memoryEfficiencyActions . voteForNotUsefulAndVerifyDisabled ( ) ;
145
+ // Verify that user can see the popup with link when he votes for “Not useful”
146
+ await t . expect ( memoryEfficiencyPage . recommendationsFeedbackBtn . visible ) . ok ( 'popup did not appear after voting for not useful' ) ;
147
+ } ) ;
0 commit comments