Skip to content

Commit 05b41f2

Browse files
committed
1 parent 22228ac commit 05b41f2

File tree

3 files changed

+32
-5
lines changed

3 files changed

+32
-5
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/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/tests/regression/browser/onboarding.e2e.ts

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,29 @@ import {
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

23-
fixture `Onboarding new user tests`
33+
fixture.only `Onboarding new user tests`
2434
.meta({type: 'regression', rte: rte.standalone })
2535
.page(commonUrl)
2636
.beforeEach(async() => {
@@ -29,9 +39,16 @@ fixture `Onboarding new user tests`
2939
await common.reloadPage();
3040
})
3141
.afterEach(async() => {
42+
await cliPage.sendCommandInCli(`DEL ${indexName}`);
3243
await deleteDatabase(ossStandaloneConfig.databaseName);
3344
});
34-
test
45+
// https://redislabs.atlassian.net/browse/RI-4070, https://redislabs.atlassian.net/browse/RI-4067
46+
test.before(async() => {
47+
await acceptTermsAddDatabaseOrConnectToRedisStack(ossStandaloneConfig, ossStandaloneConfig.databaseName);
48+
await cliPage.sendCommandInCli('flushdb'); // to delete all indexes in order not to fail FT.INFO ${indexName}
49+
await setLocalStorageItem('onboardingStep', '0');
50+
await common.reloadPage();
51+
})
3552
.meta({ env: env.desktop })('Verify onbarding new user steps', async t => {
3653
await onBoardActions.startOnboarding();
3754
// verify browser step is visible
@@ -55,16 +72,23 @@ test
5572
await t.expect(monitorPage.monitorArea.visible).ok('profiler is not expanded');
5673
await onBoardActions.verifyStepVisible('Profiler');
5774
await onBoardActions.clickNextStep();
75+
// Verify that client list command visible when there is not any index created
76+
await t.expect(onboardingPage.wbOnbardingCommand.withText('CLIENT LIST').visible).ok('CLIENT LIST command is not visible');
77+
await t.expect(onboardingPage.copyCodeButton.visible).ok('copy code button is not visible');
5878
// verify workbench page is opened
5979
await t.expect(workBenchPage.mainEditorArea.visible).ok('workbench is not opened');
6080
await onBoardActions.verifyStepVisible('Try Workbench!');
6181
// click back step button
6282
await onBoardActions.clickBackStep();
83+
// create index in order to see in FT.INFO {index} in onboarding step
84+
await cliPage.sendCommandInCli(`FT.CREATE ${indexName} ON HASH PREFIX 1 test SCHEMA "name" TEXT`);
6385
// verify one step before is opened
6486
await t.expect(monitorPage.monitorArea.visible).ok('profiler is not expanded');
6587
await onBoardActions.verifyStepVisible('Profiler');
6688
await onBoardActions.clickNextStep();
6789
// verify workbench page is opened
90+
await t.expect(onboardingPage.wbOnbardingCommand.withText(`FT.INFO ${indexName}`).visible).ok(`FT.INFO ${indexName} command is not visible`);
91+
await t.expect(onboardingPage.copyCodeButton.visible).ok('copy code button is not visible');
6892
await t.expect(workBenchPage.mainEditorArea.visible).ok('workbench is not opened');
6993
await onBoardActions.verifyStepVisible('Try Workbench!');
7094
await onBoardActions.clickNextStep();
@@ -75,7 +99,7 @@ test
7599
await onBoardActions.verifyStepVisible('Database Analysis');
76100
await onBoardActions.clickNextStep();
77101
// verify slow log is opened
78-
await t.expect(slowLogPage.slowLogTable.visible).ok('slow log is not opened');
102+
await t.expect(slowLogPage.slowLogConfigureButton.visible).ok('slow log is not opened');
79103
await onBoardActions.verifyStepVisible('Slow Log');
80104
await onBoardActions.clickNextStep();
81105
// verify pub/sub page is opened
@@ -88,6 +112,7 @@ test
88112
// verify onboarding step completed successfully
89113
await onBoardActions.verifyOnboardingCompleted();
90114
});
115+
// https://redislabs.atlassian.net/browse/RI-4070
91116
test
92117
.meta({ env: env.desktop })('verify onboard new user skip tour', async() => {
93118
// start onboarding process

0 commit comments

Comments
 (0)