@@ -14,6 +14,12 @@ const databaseHelper = new DatabaseHelper();
14
14
15
15
let { host, port, databaseName, databaseUsername = '' , databasePassword = '' } = ossStandaloneRedisGears ;
16
16
17
+ function generateLink ( params : Record < string , any > ) : string {
18
+ const params1 = Common . generateUrlTParams ( params ) ;
19
+ const from = encodeURIComponent ( `${ redisConnect } ?${ params1 } ` ) ;
20
+ return ( new URL ( `?from=${ from } ` , commonUrl ) ) . toString ( ) ;
21
+ }
22
+
17
23
const redisConnect = 'redisinsight://databases/connect' ;
18
24
19
25
fixture `Add DB from SM`
34
40
} ;
35
41
36
42
await t . navigateTo ( generateLink ( connectUrlParams ) ) ;
37
- await t . expect ( await myRedisDatabasePage . AddRedisDatabase . disabledDatabaseInfo . nth ( 0 ) . getAttribute ( 'title' ) ) . contains ( host , 'Wrong host value' ) ;
38
- await t . expect ( await myRedisDatabasePage . AddRedisDatabase . disabledDatabaseInfo . nth ( 1 ) . getAttribute ( 'title' ) ) . contains ( port , 'Wrong port value' ) ;
39
- await t . click ( await myRedisDatabasePage . AddRedisDatabase . addRedisDatabaseButton ) ;
43
+ await t . expect ( myRedisDatabasePage . AddRedisDatabase . disabledDatabaseInfo . nth ( 0 ) . getAttribute ( 'title' ) ) . contains ( host , 'Wrong host value' ) ;
44
+ await t . expect ( myRedisDatabasePage . AddRedisDatabase . disabledDatabaseInfo . nth ( 1 ) . getAttribute ( 'title' ) ) . contains ( port , 'Wrong port value' ) ;
45
+ await t . click ( myRedisDatabasePage . AddRedisDatabase . addRedisDatabaseButton ) ;
40
46
// wait for db is added
41
- await t . wait ( 3_000 ) ;
42
- await t . expect ( await workbenchPage . closeEnablementPage . exists ) . ok ( 'Redirection to Workbench tutorial is not correct' ) ;
47
+ await t . wait ( 7_000 ) ;
48
+ await t . expect ( workbenchPage . closeEnablementPage . exists ) . ok ( 'Redirection to Workbench tutorial is not correct' ) ;
43
49
} ) ;
44
50
45
51
test
71
77
72
78
await t . navigateTo ( generateLink ( connectUrlParams ) ) ;
73
79
await t . wait ( 7_000 ) ;
74
- await t . expect ( await workbenchPage . closeEnablementPage . exists ) . ok ( 'Redirection to Workbench tutorial is not correct' ) ;
80
+ await t . expect ( workbenchPage . closeEnablementPage . exists ) . ok ( 'Redirection to Workbench tutorial is not correct' ) ;
75
81
76
82
//Verify that the same db is not added
77
83
await t . navigateTo ( generateLink ( connectUrlParams ) ) ;
78
- await t . click ( await workbenchPage . NavigationPanel . myRedisDBButton ) ;
84
+ await t . wait ( 5_000 ) ;
85
+ await t . click ( workbenchPage . NavigationPanel . myRedisDBButton ) ;
79
86
await t . expect ( browserPage . notification . exists ) . notOk ( { timeout : 10000 } ) ;
80
- await t . expect ( await myRedisDatabasePage . dbNameList . child ( 'span' ) . withExactText ( databaseName ) . count ) . eql ( 2 , 'the same db is added twice' ) ;
87
+ await t . expect ( myRedisDatabasePage . dbNameList . child ( 'span' ) . withExactText ( databaseName ) . count ) . eql ( 2 , 'the same db is added twice' ) ;
81
88
} ) ;
82
-
83
- function generateLink ( params : Record < string , any > ) : string {
84
- const params1 = Common . generateUrlTParams ( params ) ;
85
- const from = encodeURIComponent ( `${ redisConnect } ?${ params1 } ` ) ;
86
- return ( new URL ( `?from=${ from } ` , commonUrl ) ) . toString ( ) ;
87
- }
88
-
0 commit comments