Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions tests/e2e/common-actions/onboard-actions.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import {t} from 'testcafe';
import {OnboardingPage, BrowserPage} from '../pageObjects';

const onboardingPage = new OnboardingPage();
const browserPage = new BrowserPage();
export class OnboardActions {
/**
@param stepName title of the step
verify onboarding step visible based on title
*/
async verifyStepVisible(stepName: string): Promise<void> {
await t.expect(onboardingPage.stepTitle.withText(stepName).exists).ok(`${stepName} step is not visible`);
}
/**
click next step
*/
async clickNextStep(): Promise<void> {
await t.click(onboardingPage.nextButton);
}
/**
start onboarding process
*/
async startOnboarding(): Promise<void> {
await t.click(onboardingPage.showMeAroundButton);
}
/**
complete onboarding process
*/
async verifyOnboardingCompleted(): Promise<void> {
await t.expect(onboardingPage.showMeAroundButton.visible).notOk('show me around button still visible');
await t.expect(browserPage.patternModeBtn.visible).ok('browser page is not opened');
}
/**
click back step
*/
async clickBackStep(): Promise<void> {
await t.click(onboardingPage.backButton);
}
/**
click skip tour step
*/
async clickSkipTour(): Promise<void> {
await t.click(onboardingPage.skipTourButton);
}
}
4 changes: 3 additions & 1 deletion tests/e2e/pageObjects/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { OverviewPage } from './overview-page';
import { PubSubPage } from './pub-sub-page';
import { SlowLogPage } from './slow-log-page';
import { NotificationPage } from './notification-page';
import { OnboardingPage} from './onboarding-page';

export {
AddRedisDatabasePage,
Expand All @@ -35,5 +36,6 @@ export {
OverviewPage,
PubSubPage,
SlowLogPage,
NotificationPage
NotificationPage,
OnboardingPage
};
9 changes: 9 additions & 0 deletions tests/e2e/pageObjects/onboarding-page.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { Selector } from 'testcafe';

export class OnboardingPage {
backButton = Selector('[data-testid=back-btn]');
nextButton = Selector('[data-testid=next-btn]');
showMeAroundButton = Selector('span').withText('Show me around');
skipTourButton = Selector('[data-testid=skip-tour-btn]');
stepTitle = Selector('[data-testid=step-title]');
}
107 changes: 107 additions & 0 deletions tests/e2e/tests/regression/browser/onboarding.e2e.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
import {ClientFunction} from 'testcafe';
import {
acceptTermsAddDatabaseOrConnectToRedisStack, deleteDatabase
} from '../../../helpers/database';
import {
commonUrl, ossStandaloneConfig
} from '../../../helpers/conf';
import { env, rte } from '../../../helpers/constants';
import {Common} from '../../../helpers/common';
import {OnboardActions} from '../../../common-actions/onboard-actions';
import {CliPage, MemoryEfficiencyPage, SlowLogPage, WorkbenchPage, PubSubPage, MonitorPage} from '../../../pageObjects';

const common = new Common();
const onBoardActions = new OnboardActions();
const cliPage = new CliPage();
const memoryEfficiencyPage = new MemoryEfficiencyPage();
const workBenchPage = new WorkbenchPage();
const slowLogPage = new SlowLogPage();
const pubSubPage = new PubSubPage();
const monitorPage = new MonitorPage();
const setLocalStorageItem = ClientFunction((key: string, value: string) => window.localStorage.setItem(key, value));

fixture `Onboarding new user tests`
.meta({type: 'regression', rte: rte.standalone, env: env.desktop })
.page(commonUrl)
.beforeEach(async() => {
await acceptTermsAddDatabaseOrConnectToRedisStack(ossStandaloneConfig, ossStandaloneConfig.databaseName);
await setLocalStorageItem('onboardingStep', '0');
await common.reloadPage();
})
.afterEach(async() => {
await deleteDatabase(ossStandaloneConfig.databaseName);
});
test('Verify onbarding new user steps', async t => {
await onBoardActions.startOnboarding();
// verify browser step is visible
await onBoardActions.verifyStepVisible('Browser');
// move to next step
await onBoardActions.clickNextStep();
// verify tree view step is visible
await onBoardActions.verifyStepVisible('Tree view');
await onBoardActions.clickNextStep();
await onBoardActions.verifyStepVisible('Filter and search');
await onBoardActions.clickNextStep();
// verify cli is opened
await t.expect(cliPage.cliPanel.visible).ok('cli is not expanded');
await onBoardActions.verifyStepVisible('CLI');
await onBoardActions.clickNextStep();
// verify command helper area is opened
await t.expect(cliPage.commandHelperArea.visible).ok('command helper is not expanded');
await onBoardActions.verifyStepVisible('Command Helper');
await onBoardActions.clickNextStep();
// verify profiler is opened
await t.expect(monitorPage.monitorArea.visible).ok('profiler is not expanded');
await onBoardActions.verifyStepVisible('Profiler');
await onBoardActions.clickNextStep();
// verify workbench page is opened
await t.expect(workBenchPage.mainEditorArea.visible).ok('workbench is not opened');
await onBoardActions.verifyStepVisible('Try Workbench!');
// click back step button
await onBoardActions.clickBackStep();
// verify one step before is opened
await t.expect(monitorPage.monitorArea.visible).ok('profiler is not expanded');
await onBoardActions.verifyStepVisible('Profiler');
await onBoardActions.clickNextStep();
// verify workbench page is opened
await t.expect(workBenchPage.mainEditorArea.visible).ok('workbench is not opened');
await onBoardActions.verifyStepVisible('Try Workbench!');
await onBoardActions.clickNextStep();
await onBoardActions.verifyStepVisible('Explore and learn more');
await onBoardActions.clickNextStep();
// verify analysis tools page is opened
await t.expect(memoryEfficiencyPage.noReportsText.visible).ok('analysis tools is not opened');
await onBoardActions.verifyStepVisible('Database Analysis');
await onBoardActions.clickNextStep();
// verify slow log is opened
await t.expect(slowLogPage.slowLogTable.visible).ok('slow log is not opened');
await onBoardActions.verifyStepVisible('Slow Log');
await onBoardActions.clickNextStep();
// verify pub/sub page is opened
await t.expect(pubSubPage.subscribeButton.visible).ok('pub/sub page is not opened');
await onBoardActions.verifyStepVisible('Pub/Sub');
await onBoardActions.clickNextStep();
// verify last step of onboarding process is visible
await onBoardActions.verifyStepVisible('Great job!');
await onBoardActions.clickNextStep();
// verify onboarding step completed successfully
await onBoardActions.verifyOnboardingCompleted();
});
test('verify onboard new user skip tour', async() => {
// start onboarding process
await onBoardActions.startOnboarding();
// verify browser step is visible
await onBoardActions.verifyStepVisible('Browser');
// move to next step
await onBoardActions.clickNextStep();
// verify tree view step is visible
await onBoardActions.verifyStepVisible('Tree view');
// click skip tour
await onBoardActions.clickSkipTour();
// verify onboarding step completed successfully
await onBoardActions.verifyOnboardingCompleted();
await common.reloadPage();
// verify onboarding step still not visible after refresh page
await onBoardActions.verifyOnboardingCompleted();
});