Skip to content

Commit 90f7c0e

Browse files
authored
Merge pull request #1758 from RedisInsight/e2e/feature/RI-4070_onboarding-wb-ft-index
E2e/feature/ri 4070 onboarding wb ft index
2 parents 22228ac + b6c9cc5 commit 90f7c0e

File tree

5 files changed

+49
-7
lines changed

5 files changed

+49
-7
lines changed

tests/e2e/common-actions/onboard-actions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export class OnboardActions {
2727
complete onboarding process
2828
*/
2929
async verifyOnboardingCompleted(): Promise<void> {
30-
await t.expect(onboardingPage.showMeAroundButton.visible).notOk('show me around button still visible');
30+
await t.expect(onboardingPage.showMeAroundButton.exists).notOk('show me around button still visible');
3131
await t.expect(browserPage.patternModeBtn.visible).ok('browser page is not opened');
3232
}
3333
/**

tests/e2e/helpers/conf.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import { Chance } from 'chance';
21
import * as os from 'os';
32
import * as fs from 'fs';
43
import { join as joinPath } from 'path';
4+
import { Chance } from 'chance';
55
const chance = new Chance();
66

77
// Urls for using in the tests
@@ -19,6 +19,14 @@ export const ossStandaloneConfig = {
1919
databasePassword: process.env.OSS_STANDALONE_PASSWORD
2020
};
2121

22+
export const ossStandaloneConfigEmpty = {
23+
host: process.env.OSS_STANDALONE_HOST || 'oss-standalone-empty',
24+
port: process.env.OSS_STANDALONE_PORT || '6379',
25+
databaseName: `${process.env.OSS_STANDALONE_DATABASE_NAME || 'test_standalone_empty'}-${uniqueId}`,
26+
databaseUsername: process.env.OSS_STANDALONE_USERNAME,
27+
databasePassword: process.env.OSS_STANDALONE_PASSWORD
28+
};
29+
2230
export const ossStandaloneV5Config = {
2331
host: process.env.OSS_STANDALONE_V5_HOST || 'oss-standalone-v5',
2432
port: process.env.OSS_STANDALONE_V5_PORT || '6379',

tests/e2e/pageObjects/onboarding-page.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,6 @@ export class OnboardingPage {
66
showMeAroundButton = Selector('span').withText('Show me around');
77
skipTourButton = Selector('[data-testid=skip-tour-btn]');
88
stepTitle = Selector('[data-testid=step-title]');
9+
wbOnbardingCommand = Selector('[data-testid=wb-onboarding-command]');
10+
copyCodeButton = Selector('[data-testid=copy-code-btn]');
911
}

tests/e2e/rte.docker-compose.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,18 @@ services:
3333
ports:
3434
- 8100:6379
3535

36+
oss-standalone-empty:
37+
image: redislabs/redismod
38+
command: [
39+
"--loadmodule", "/usr/lib/redis/modules/redisearch.so",
40+
"--loadmodule", "/usr/lib/redis/modules/redisgraph.so",
41+
"--loadmodule", "/usr/lib/redis/modules/redistimeseries.so",
42+
"--loadmodule", "/usr/lib/redis/modules/rejson.so",
43+
"--loadmodule", "/usr/lib/redis/modules/redisbloom.so"
44+
]
45+
ports:
46+
- 8105:6379
47+
3648
# oss standalone v5
3749
oss-standalone-v5:
3850
image: redis:5

tests/e2e/tests/regression/browser/onboarding.e2e.ts

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,34 +3,46 @@ import {
33
acceptTermsAddDatabaseOrConnectToRedisStack, deleteDatabase
44
} from '../../../helpers/database';
55
import {
6-
commonUrl, ossStandaloneConfig
6+
commonUrl, ossStandaloneConfigEmpty
77
} from '../../../helpers/conf';
88
import { env, rte } from '../../../helpers/constants';
99
import {Common} from '../../../helpers/common';
1010
import {OnboardActions} from '../../../common-actions/onboard-actions';
11-
import {CliPage, MemoryEfficiencyPage, SlowLogPage, WorkbenchPage, PubSubPage, MonitorPage} from '../../../pageObjects';
11+
import {
12+
CliPage,
13+
MemoryEfficiencyPage,
14+
SlowLogPage,
15+
WorkbenchPage,
16+
PubSubPage,
17+
MonitorPage,
18+
OnboardingPage
19+
} from '../../../pageObjects';
1220

1321
const common = new Common();
1422
const onBoardActions = new OnboardActions();
23+
const onboardingPage = new OnboardingPage();
1524
const cliPage = new CliPage();
1625
const memoryEfficiencyPage = new MemoryEfficiencyPage();
1726
const workBenchPage = new WorkbenchPage();
1827
const slowLogPage = new SlowLogPage();
1928
const pubSubPage = new PubSubPage();
2029
const monitorPage = new MonitorPage();
2130
const setLocalStorageItem = ClientFunction((key: string, value: string) => window.localStorage.setItem(key, value));
31+
const indexName = common.generateWord(10);
2232

2333
fixture `Onboarding new user tests`
2434
.meta({type: 'regression', rte: rte.standalone })
2535
.page(commonUrl)
2636
.beforeEach(async() => {
27-
await acceptTermsAddDatabaseOrConnectToRedisStack(ossStandaloneConfig, ossStandaloneConfig.databaseName);
37+
await acceptTermsAddDatabaseOrConnectToRedisStack(ossStandaloneConfigEmpty, ossStandaloneConfigEmpty.databaseName);
2838
await setLocalStorageItem('onboardingStep', '0');
2939
await common.reloadPage();
3040
})
3141
.afterEach(async() => {
32-
await deleteDatabase(ossStandaloneConfig.databaseName);
42+
await cliPage.sendCommandInCli(`DEL ${indexName}`);
43+
await deleteDatabase(ossStandaloneConfigEmpty.databaseName);
3344
});
45+
// https://redislabs.atlassian.net/browse/RI-4070, https://redislabs.atlassian.net/browse/RI-4067
3446
test
3547
.meta({ env: env.desktop })('Verify onbarding new user steps', async t => {
3648
await onBoardActions.startOnboarding();
@@ -55,16 +67,23 @@ test
5567
await t.expect(monitorPage.monitorArea.visible).ok('profiler is not expanded');
5668
await onBoardActions.verifyStepVisible('Profiler');
5769
await onBoardActions.clickNextStep();
70+
// Verify that client list command visible when there is not any index created
71+
await t.expect(onboardingPage.wbOnbardingCommand.withText('CLIENT LIST').visible).ok('CLIENT LIST command is not visible');
72+
await t.expect(onboardingPage.copyCodeButton.visible).ok('copy code button is not visible');
5873
// verify workbench page is opened
5974
await t.expect(workBenchPage.mainEditorArea.visible).ok('workbench is not opened');
6075
await onBoardActions.verifyStepVisible('Try Workbench!');
6176
// click back step button
6277
await onBoardActions.clickBackStep();
78+
// create index in order to see in FT.INFO {index} in onboarding step
79+
await cliPage.sendCommandInCli(`FT.CREATE ${indexName} ON HASH PREFIX 1 test SCHEMA "name" TEXT`);
6380
// verify one step before is opened
6481
await t.expect(monitorPage.monitorArea.visible).ok('profiler is not expanded');
6582
await onBoardActions.verifyStepVisible('Profiler');
6683
await onBoardActions.clickNextStep();
6784
// verify workbench page is opened
85+
await t.expect(onboardingPage.wbOnbardingCommand.withText(`FT.INFO ${indexName}`).visible).ok(`FT.INFO ${indexName} command is not visible`);
86+
await t.expect(onboardingPage.copyCodeButton.visible).ok('copy code button is not visible');
6887
await t.expect(workBenchPage.mainEditorArea.visible).ok('workbench is not opened');
6988
await onBoardActions.verifyStepVisible('Try Workbench!');
7089
await onBoardActions.clickNextStep();
@@ -75,7 +94,7 @@ test
7594
await onBoardActions.verifyStepVisible('Database Analysis');
7695
await onBoardActions.clickNextStep();
7796
// verify slow log is opened
78-
await t.expect(slowLogPage.slowLogTable.visible).ok('slow log is not opened');
97+
await t.expect(slowLogPage.slowLogConfigureButton.visible).ok('slow log is not opened');
7998
await onBoardActions.verifyStepVisible('Slow Log');
8099
await onBoardActions.clickNextStep();
81100
// verify pub/sub page is opened
@@ -88,6 +107,7 @@ test
88107
// verify onboarding step completed successfully
89108
await onBoardActions.verifyOnboardingCompleted();
90109
});
110+
// https://redislabs.atlassian.net/browse/RI-4067
91111
test
92112
.meta({ env: env.desktop })('verify onboard new user skip tour', async() => {
93113
// start onboarding process

0 commit comments

Comments
 (0)