@@ -17,15 +17,34 @@ export class DatabasesActions {
17
17
18
18
/**
19
19
* Import database using file
20
- * @param pathToFile The path to file for import
21
- * @param databaseType The database type
20
+ * @param fileParameters The arguments of imported file
22
21
*/
23
- async importDatabase ( pathToFile : string , databaseType = '' ) : Promise < void > {
22
+ async importDatabase ( fileParameters : ImportDatabaseParameters ) : Promise < void > {
24
23
await t
25
24
. click ( myRedisDatabasePage . importDatabasesBtn )
26
- . setFilesToUpload ( myRedisDatabasePage . importDatabaseInput , [ pathToFile ] )
25
+ . setFilesToUpload ( myRedisDatabasePage . importDatabaseInput , [ fileParameters . path ] )
27
26
. click ( myRedisDatabasePage . submitImportBtn )
28
- . expect ( myRedisDatabasePage . successImportMessage . exists ) . ok ( `Successfully added ${ databaseType } databases message not displayed` ) ;
27
+ . expect ( myRedisDatabasePage . successImportMessage . exists ) . ok ( `Successfully added ${ fileParameters . type } databases message not displayed` ) ;
29
28
}
30
29
31
30
}
31
+
32
+ /**
33
+ * Import database parameters
34
+ * @param path The path to file
35
+ * @param type The type of application
36
+ * @param dbNames The names of databases
37
+ * @param userName The username of db
38
+ * @param password The password of db
39
+ * @param connectionType The connection type of db
40
+ * @param fileName The file name
41
+ */
42
+ export type ImportDatabaseParameters = {
43
+ path : string ,
44
+ type ?: string ,
45
+ dbNames ?: string [ ] ,
46
+ userName ?: string ,
47
+ password ?: string ,
48
+ connectionType ?: string ,
49
+ fileName ?: string
50
+ } ;
0 commit comments