Skip to content

Commit 6feebe4

Browse files
committed
fix for live rec
1 parent 6ef9fd2 commit 6feebe4

File tree

1 file changed

+20
-12
lines changed

1 file changed

+20
-12
lines changed

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

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { RecommendationIds, rte } from '../../../helpers/constants';
44
import { acceptLicenseTerms, acceptLicenseTermsAndAddDatabaseApi } from '../../../helpers/database';
55
import { commonUrl, ossStandaloneConfig, ossStandaloneV5Config } from '../../../helpers/conf';
66
import {
7+
addNewStandaloneDatabaseApi,
78
addNewStandaloneDatabasesApi,
89
deleteStandaloneDatabaseApi,
910
deleteStandaloneDatabasesApi
@@ -45,35 +46,38 @@ fixture `Live Recommendations`
4546
.meta({ type: 'regression', rte: rte.standalone })
4647
.page(commonUrl)
4748
.beforeEach(async() => {
48-
await acceptLicenseTermsAndAddDatabaseApi(ossStandaloneConfig, ossStandaloneConfig.databaseName);
49+
await acceptLicenseTerms();
4950
await refreshFeaturesTestData();
5051
await modifyFeaturesConfigJson(featuresConfig);
5152
await updateControlNumber(47.2);
53+
await addNewStandaloneDatabaseApi(ossStandaloneConfig);
54+
await myRedisDatabasePage.reloadPage();
55+
await myRedisDatabasePage.clickOnDBByName(ossStandaloneConfig.databaseName);
5256
})
5357
.afterEach(async() => {
58+
await refreshFeaturesTestData();
5459
// Delete database
5560
await deleteStandaloneDatabaseApi(ossStandaloneConfig);
56-
await refreshFeaturesTestData();
5761
});
5862
test
5963
.before(async() => {
6064
// Add new databases using API
6165
await acceptLicenseTerms();
66+
await refreshFeaturesTestData();
67+
await modifyFeaturesConfigJson(featuresConfig);
68+
await updateControlNumber(47.2);
6269
await addNewStandaloneDatabasesApi(databasesForAdding);
6370
// Reload Page
6471
await myRedisDatabasePage.reloadPage();
6572
await myRedisDatabasePage.clickOnDBByName(databasesForAdding[1].databaseName);
66-
await refreshFeaturesTestData();
67-
await modifyFeaturesConfigJson(featuresConfig);
68-
await updateControlNumber(47.2);
6973
})
7074
.after(async() => {
7175
// Clear and delete database
7276
await browserPage.InsightsPanel.toggleInsightsPanel(false);
77+
await refreshFeaturesTestData();
7378
await browserPage.OverviewPanel.changeDbIndex(0);
7479
await browserPage.deleteKeyByName(keyName);
7580
await deleteStandaloneDatabasesApi(databasesForAdding);
76-
await refreshFeaturesTestData();
7781
})('Verify Insights panel Recommendations displaying', async t => {
7882
await browserPage.InsightsPanel.toggleInsightsPanel(true);
7983
// Verify that "Welcome to recommendations" panel displayed when there are no recommendations
@@ -104,13 +108,16 @@ test
104108
test
105109
.requestHooks(logger)
106110
.before(async() => {
107-
await acceptLicenseTermsAndAddDatabaseApi(ossStandaloneV5Config, ossStandaloneV5Config.databaseName);
111+
await acceptLicenseTerms();
108112
await refreshFeaturesTestData();
109113
await modifyFeaturesConfigJson(featuresConfig);
110114
await updateControlNumber(47.2);
115+
await addNewStandaloneDatabaseApi(ossStandaloneV5Config);
116+
await myRedisDatabasePage.reloadPage();
117+
await myRedisDatabasePage.clickOnDBByName(ossStandaloneV5Config.databaseName);
111118
}).after(async() => {
112-
await deleteStandaloneDatabaseApi(ossStandaloneV5Config);
113119
await refreshFeaturesTestData();
120+
await deleteStandaloneDatabaseApi(ossStandaloneV5Config);
114121
})('Verify that user can upvote recommendations', async() => {
115122
const notUsefulVoteOption = 'not useful';
116123
const usefulVoteOption = 'useful';
@@ -181,10 +188,13 @@ test('Verify that user can snooze recommendation', async t => {
181188
});
182189
test
183190
.before(async() => {
184-
await acceptLicenseTermsAndAddDatabaseApi(ossStandaloneV5Config, ossStandaloneV5Config.databaseName);
191+
await acceptLicenseTerms();
185192
await refreshFeaturesTestData();
186193
await modifyFeaturesConfigJson(featuresConfig);
187194
await updateControlNumber(47.2);
195+
await addNewStandaloneDatabaseApi(ossStandaloneV5Config);
196+
await myRedisDatabasePage.reloadPage();
197+
await myRedisDatabasePage.clickOnDBByName(ossStandaloneV5Config.databaseName);
188198
}).after(async() => {
189199
await deleteStandaloneDatabaseApi(ossStandaloneV5Config);
190200
await refreshFeaturesTestData();
@@ -225,11 +235,9 @@ test('Verify that if user clicks on the Analyze button and link, the pop up with
225235
//https://redislabs.atlassian.net/browse/RI-4493
226236
test
227237
.after(async() => {
238+
await refreshFeaturesTestData();
228239
await browserPage.deleteKeyByName(keyName);
229240
await deleteStandaloneDatabasesApi(databasesForAdding);
230-
await refreshFeaturesTestData();
231-
await modifyFeaturesConfigJson(featuresConfig);
232-
await updateControlNumber(47.2);
233241
})('Verify that key name is displayed for Insights and DA recommendations', async t => {
234242
const cliCommand = `JSON.SET ${keyName} $ '{ "model": "Hyperion", "brand": "Velorim"}'`;
235243
await browserPage.Cli.sendCommandInCli(cliCommand);

0 commit comments

Comments
 (0)