1
1
import { Chance } from 'chance' ;
2
- import { addNewStandaloneDatabase , acceptLicenseTermsAndAddDatabase , deleteDatabase } from '../../../helpers/database' ;
2
+ import { acceptLicenseTermsAndAddDatabaseApi } from '../../../helpers/database' ;
3
3
import { rte } from '../../../helpers/constants' ;
4
4
import { Common } from '../../../helpers/common' ;
5
5
import {
@@ -15,6 +15,7 @@ import {
15
15
ossStandaloneRedisearch ,
16
16
ossStandaloneBigConfig
17
17
} from '../../../helpers/conf' ;
18
+ import { addNewStandaloneDatabaseApi , deleteStandaloneDatabaseApi } from '../../../helpers/api/api-database' ;
18
19
19
20
const myRedisDatabasePage = new MyRedisDatabasePage ( ) ;
20
21
const browserPage = new BrowserPage ( ) ;
@@ -33,19 +34,19 @@ let keys2: string[];
33
34
fixture `Database overview`
34
35
. meta ( { type : 'critical_path' } )
35
36
. page ( commonUrl )
36
- . beforeEach ( async ( ) => {
37
- await acceptLicenseTermsAndAddDatabase ( ossStandaloneConfig , ossStandaloneConfig . databaseName ) ;
37
+ . beforeEach ( async t => {
38
+ await acceptLicenseTermsAndAddDatabaseApi ( ossStandaloneConfig , ossStandaloneConfig . databaseName ) ;
38
39
} )
39
40
. afterEach ( async ( ) => {
40
41
//Delete database
41
- await deleteDatabase ( ossStandaloneConfig . databaseName ) ;
42
+ await deleteStandaloneDatabaseApi ( ossStandaloneConfig ) ;
42
43
} ) ;
43
44
test
44
45
. meta ( { rte : rte . standalone } )
45
46
. after ( async ( ) => {
46
47
//Delete databases
47
- await deleteDatabase ( ossStandaloneConfig . databaseName ) ;
48
- await deleteDatabase ( ossStandaloneRedisearch . databaseName ) ;
48
+ await deleteStandaloneDatabaseApi ( ossStandaloneConfig ) ;
49
+ await deleteStandaloneDatabaseApi ( ossStandaloneRedisearch ) ;
49
50
} ) ( 'Verify that user can see the list of Modules updated each time when he connects to the database' , async t => {
50
51
const firstDatabaseModules = [ ] ;
51
52
const secondDatabaseModules = [ ] ;
65
66
}
66
67
//Add database with different modules
67
68
await t . click ( myRedisDatabasePage . myRedisDBButton ) ;
68
- await addNewStandaloneDatabase ( ossStandaloneRedisearch ) ;
69
+ await addNewStandaloneDatabaseApi ( ossStandaloneRedisearch ) ;
70
+ await t . eval ( ( ) => location . reload ( ) ) ;
69
71
await myRedisDatabasePage . clickOnDBByName ( ossStandaloneRedisearch . databaseName ) ;
70
72
countOfModules = await browserPage . modulesButton . count ;
71
73
for ( let i = 0 ; i < countOfModules ; i ++ ) {
105
107
await myRedisDatabasePage . clickOnDBByName ( ossStandaloneConfig . databaseName ) ;
106
108
await cliPage . sendCommandInCli ( `DEL ${ keys1 . join ( ' ' ) } ` ) ;
107
109
await cliPage . sendCommandInCli ( `DEL ${ keys2 . join ( ' ' ) } ` ) ;
108
- await deleteDatabase ( ossStandaloneConfig . databaseName ) ;
109
- await deleteDatabase ( ossStandaloneBigConfig . databaseName ) ;
110
+ await deleteStandaloneDatabaseApi ( ossStandaloneConfig ) ;
111
+ await deleteStandaloneDatabaseApi ( ossStandaloneBigConfig ) ;
110
112
} ) ( 'Verify that user can see total number of keys rounded in format 100, 1K, 1M, 1B in DB header in Browser page' , async t => {
111
113
//Add 100 keys
112
114
keys1 = await common . createArrayWithKeyValue ( 100 ) ;
120
122
await t . expect ( totalKeys ) . eql ( '1 K' , 'Info in DB header after ADD 1000 keys' ) ;
121
123
//Add database with more than 1M keys
122
124
await t . click ( myRedisDatabasePage . myRedisDBButton ) ;
123
- await addNewStandaloneDatabase ( ossStandaloneBigConfig ) ;
125
+ await addNewStandaloneDatabaseApi ( ossStandaloneBigConfig ) ;
126
+ await t . eval ( ( ) => location . reload ( ) ) ;
124
127
await myRedisDatabasePage . clickOnDBByName ( ossStandaloneBigConfig . databaseName ) ;
125
128
//Wait 5 seconds
126
129
await t . wait ( fiveSecondsTimeout ) ;
133
136
. after ( async ( ) => {
134
137
//Clear and delete database
135
138
await cliPage . sendCommandInCli ( `DEL ${ keys . join ( ' ' ) } ` ) ;
136
- await deleteDatabase ( ossStandaloneConfig . databaseName ) ;
139
+ await deleteStandaloneDatabaseApi ( ossStandaloneConfig ) ;
137
140
} ) ( 'Verify that user can see total memory rounded in format B, KB, MB, GB, TB in DB header in Browser page' , async t => {
138
141
//Add new keys
139
142
keys = await common . createArrayWithKeyValue ( 100 ) ;
@@ -145,14 +148,14 @@ test
145
148
test
146
149
. meta ( { rte : rte . standalone } )
147
150
. before ( async t => {
148
- await acceptLicenseTermsAndAddDatabase ( ossStandaloneBigConfig , ossStandaloneBigConfig . databaseName ) ;
151
+ await acceptLicenseTermsAndAddDatabaseApi ( ossStandaloneBigConfig , ossStandaloneBigConfig . databaseName ) ;
149
152
//Go to Workbench page
150
153
await t . click ( myRedisDatabasePage . workbenchButton ) ;
151
154
} )
152
155
. after ( async ( ) => {
153
156
//Delete database and index
154
157
await workbenchPage . sendCommandInWorkbench ( 'FT.DROPINDEX idx:schools DD' ) ;
155
- await deleteDatabase ( ossStandaloneBigConfig . databaseName ) ;
158
+ await deleteStandaloneDatabaseApi ( ossStandaloneBigConfig ) ;
156
159
} ) ( 'Verify that user can see additional information in Overview: Connected Clients, Commands/Sec, CPU (%) using Standalone DB connection type' , async t => {
157
160
const commandsSecBeforeEdit = await browserPage . overviewCommandsSec . textContent ;
158
161
//Wait 5 second
0 commit comments