@@ -4,6 +4,7 @@ import { RecommendationIds, rte } from '../../../helpers/constants';
4
4
import { acceptLicenseTerms , acceptLicenseTermsAndAddDatabaseApi } from '../../../helpers/database' ;
5
5
import { commonUrl , ossStandaloneConfig , ossStandaloneV5Config } from '../../../helpers/conf' ;
6
6
import {
7
+ addNewStandaloneDatabaseApi ,
7
8
addNewStandaloneDatabasesApi ,
8
9
deleteStandaloneDatabaseApi ,
9
10
deleteStandaloneDatabasesApi
@@ -45,35 +46,38 @@ fixture `Live Recommendations`
45
46
. meta ( { type : 'regression' , rte : rte . standalone } )
46
47
. page ( commonUrl )
47
48
. beforeEach ( async ( ) => {
48
- await acceptLicenseTermsAndAddDatabaseApi ( ossStandaloneConfig , ossStandaloneConfig . databaseName ) ;
49
+ await acceptLicenseTerms ( ) ;
49
50
await refreshFeaturesTestData ( ) ;
50
51
await modifyFeaturesConfigJson ( featuresConfig ) ;
51
52
await updateControlNumber ( 47.2 ) ;
53
+ await addNewStandaloneDatabaseApi ( ossStandaloneConfig ) ;
54
+ await myRedisDatabasePage . reloadPage ( ) ;
55
+ await myRedisDatabasePage . clickOnDBByName ( ossStandaloneConfig . databaseName ) ;
52
56
} )
53
57
. afterEach ( async ( ) => {
58
+ await refreshFeaturesTestData ( ) ;
54
59
// Delete database
55
60
await deleteStandaloneDatabaseApi ( ossStandaloneConfig ) ;
56
- await refreshFeaturesTestData ( ) ;
57
61
} ) ;
58
62
test
59
63
. before ( async ( ) => {
60
64
// Add new databases using API
61
65
await acceptLicenseTerms ( ) ;
66
+ await refreshFeaturesTestData ( ) ;
67
+ await modifyFeaturesConfigJson ( featuresConfig ) ;
68
+ await updateControlNumber ( 47.2 ) ;
62
69
await addNewStandaloneDatabasesApi ( databasesForAdding ) ;
63
70
// Reload Page
64
71
await myRedisDatabasePage . reloadPage ( ) ;
65
72
await myRedisDatabasePage . clickOnDBByName ( databasesForAdding [ 1 ] . databaseName ) ;
66
- await refreshFeaturesTestData ( ) ;
67
- await modifyFeaturesConfigJson ( featuresConfig ) ;
68
- await updateControlNumber ( 47.2 ) ;
69
73
} )
70
74
. after ( async ( ) => {
71
75
// Clear and delete database
72
76
await browserPage . InsightsPanel . toggleInsightsPanel ( false ) ;
77
+ await refreshFeaturesTestData ( ) ;
73
78
await browserPage . OverviewPanel . changeDbIndex ( 0 ) ;
74
79
await browserPage . deleteKeyByName ( keyName ) ;
75
80
await deleteStandaloneDatabasesApi ( databasesForAdding ) ;
76
- await refreshFeaturesTestData ( ) ;
77
81
} ) ( 'Verify Insights panel Recommendations displaying' , async t => {
78
82
await browserPage . InsightsPanel . toggleInsightsPanel ( true ) ;
79
83
// Verify that "Welcome to recommendations" panel displayed when there are no recommendations
@@ -104,13 +108,16 @@ test
104
108
test
105
109
. requestHooks ( logger )
106
110
. before ( async ( ) => {
107
- await acceptLicenseTermsAndAddDatabaseApi ( ossStandaloneV5Config , ossStandaloneV5Config . databaseName ) ;
111
+ await acceptLicenseTerms ( ) ;
108
112
await refreshFeaturesTestData ( ) ;
109
113
await modifyFeaturesConfigJson ( featuresConfig ) ;
110
114
await updateControlNumber ( 47.2 ) ;
115
+ await addNewStandaloneDatabaseApi ( ossStandaloneV5Config ) ;
116
+ await myRedisDatabasePage . reloadPage ( ) ;
117
+ await myRedisDatabasePage . clickOnDBByName ( ossStandaloneV5Config . databaseName ) ;
111
118
} ) . after ( async ( ) => {
112
- await deleteStandaloneDatabaseApi ( ossStandaloneV5Config ) ;
113
119
await refreshFeaturesTestData ( ) ;
120
+ await deleteStandaloneDatabaseApi ( ossStandaloneV5Config ) ;
114
121
} ) ( 'Verify that user can upvote recommendations' , async ( ) => {
115
122
const notUsefulVoteOption = 'not useful' ;
116
123
const usefulVoteOption = 'useful' ;
@@ -181,10 +188,13 @@ test('Verify that user can snooze recommendation', async t => {
181
188
} ) ;
182
189
test
183
190
. before ( async ( ) => {
184
- await acceptLicenseTermsAndAddDatabaseApi ( ossStandaloneV5Config , ossStandaloneV5Config . databaseName ) ;
191
+ await acceptLicenseTerms ( ) ;
185
192
await refreshFeaturesTestData ( ) ;
186
193
await modifyFeaturesConfigJson ( featuresConfig ) ;
187
194
await updateControlNumber ( 47.2 ) ;
195
+ await addNewStandaloneDatabaseApi ( ossStandaloneV5Config ) ;
196
+ await myRedisDatabasePage . reloadPage ( ) ;
197
+ await myRedisDatabasePage . clickOnDBByName ( ossStandaloneV5Config . databaseName ) ;
188
198
} ) . after ( async ( ) => {
189
199
await deleteStandaloneDatabaseApi ( ossStandaloneV5Config ) ;
190
200
await refreshFeaturesTestData ( ) ;
@@ -225,11 +235,9 @@ test('Verify that if user clicks on the Analyze button and link, the pop up with
225
235
//https://redislabs.atlassian.net/browse/RI-4493
226
236
test
227
237
. after ( async ( ) => {
238
+ await refreshFeaturesTestData ( ) ;
228
239
await browserPage . deleteKeyByName ( keyName ) ;
229
240
await deleteStandaloneDatabasesApi ( databasesForAdding ) ;
230
- await refreshFeaturesTestData ( ) ;
231
- await modifyFeaturesConfigJson ( featuresConfig ) ;
232
- await updateControlNumber ( 47.2 ) ;
233
241
} ) ( 'Verify that key name is displayed for Insights and DA recommendations' , async t => {
234
242
const cliCommand = `JSON.SET ${ keyName } $ '{ "model": "Hyperion", "brand": "Velorim"}'` ;
235
243
await browserPage . Cli . sendCommandInCli ( cliCommand ) ;
0 commit comments