@@ -8,19 +8,29 @@ import {
8
8
import { env , rte } from '../../../helpers/constants' ;
9
9
import { Common } from '../../../helpers/common' ;
10
10
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' ;
12
20
13
21
const common = new Common ( ) ;
14
22
const onBoardActions = new OnboardActions ( ) ;
23
+ const onboardingPage = new OnboardingPage ( ) ;
15
24
const cliPage = new CliPage ( ) ;
16
25
const memoryEfficiencyPage = new MemoryEfficiencyPage ( ) ;
17
26
const workBenchPage = new WorkbenchPage ( ) ;
18
27
const slowLogPage = new SlowLogPage ( ) ;
19
28
const pubSubPage = new PubSubPage ( ) ;
20
29
const monitorPage = new MonitorPage ( ) ;
21
30
const setLocalStorageItem = ClientFunction ( ( key : string , value : string ) => window . localStorage . setItem ( key , value ) ) ;
31
+ const indexName = common . generateWord ( 10 ) ;
22
32
23
- fixture `Onboarding new user tests`
33
+ fixture . only `Onboarding new user tests`
24
34
. meta ( { type : 'regression' , rte : rte . standalone } )
25
35
. page ( commonUrl )
26
36
. beforeEach ( async ( ) => {
@@ -29,9 +39,16 @@ fixture `Onboarding new user tests`
29
39
await common . reloadPage ( ) ;
30
40
} )
31
41
. afterEach ( async ( ) => {
42
+ await cliPage . sendCommandInCli ( `DEL ${ indexName } ` ) ;
32
43
await deleteDatabase ( ossStandaloneConfig . databaseName ) ;
33
44
} ) ;
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
+ } )
35
52
. meta ( { env : env . desktop } ) ( 'Verify onbarding new user steps' , async t => {
36
53
await onBoardActions . startOnboarding ( ) ;
37
54
// verify browser step is visible
55
72
await t . expect ( monitorPage . monitorArea . visible ) . ok ( 'profiler is not expanded' ) ;
56
73
await onBoardActions . verifyStepVisible ( 'Profiler' ) ;
57
74
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' ) ;
58
78
// verify workbench page is opened
59
79
await t . expect ( workBenchPage . mainEditorArea . visible ) . ok ( 'workbench is not opened' ) ;
60
80
await onBoardActions . verifyStepVisible ( 'Try Workbench!' ) ;
61
81
// click back step button
62
82
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` ) ;
63
85
// verify one step before is opened
64
86
await t . expect ( monitorPage . monitorArea . visible ) . ok ( 'profiler is not expanded' ) ;
65
87
await onBoardActions . verifyStepVisible ( 'Profiler' ) ;
66
88
await onBoardActions . clickNextStep ( ) ;
67
89
// 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' ) ;
68
92
await t . expect ( workBenchPage . mainEditorArea . visible ) . ok ( 'workbench is not opened' ) ;
69
93
await onBoardActions . verifyStepVisible ( 'Try Workbench!' ) ;
70
94
await onBoardActions . clickNextStep ( ) ;
75
99
await onBoardActions . verifyStepVisible ( 'Database Analysis' ) ;
76
100
await onBoardActions . clickNextStep ( ) ;
77
101
// 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' ) ;
79
103
await onBoardActions . verifyStepVisible ( 'Slow Log' ) ;
80
104
await onBoardActions . clickNextStep ( ) ;
81
105
// verify pub/sub page is opened
88
112
// verify onboarding step completed successfully
89
113
await onBoardActions . verifyOnboardingCompleted ( ) ;
90
114
} ) ;
115
+ // https://redislabs.atlassian.net/browse/RI-4070
91
116
test
92
117
. meta ( { env : env . desktop } ) ( 'verify onboard new user skip tour' , async ( ) => {
93
118
// start onboarding process
0 commit comments