@@ -17,7 +17,8 @@ const rdmData = {
17
17
dbNames : [ 'rdmWithUsernameAndPass1:1561' , 'rdmOnlyHostPortDB2:6379' ] ,
18
18
userName : 'rdmUsername' ,
19
19
password : 'rdmAuth' ,
20
- connectionType : 'Cluster'
20
+ connectionType : 'Cluster' ,
21
+ fileName : 'rdm-valid.json'
21
22
} ;
22
23
const dbData = [
23
24
{
54
55
} ) ( 'Connection import from JSON' , async t => {
55
56
const tooltipText = 'Import Database Connections' ;
56
57
const partialImportedMsg = 'Successfully added 2 of 6 database connections' ;
58
+ const defaultText = 'Select or drag and drop a file' ;
57
59
58
60
// Verify that user can see the “Import Database Connections” tooltip
59
61
await t . hover ( myRedisDatabasePage . importDatabasesBtn ) ;
72
74
. click ( myRedisDatabasePage . submitImportBtn )
73
75
. expect ( myRedisDatabasePage . failedImportMessage . exists ) . ok ( 'Failed to add database message not displayed' ) ;
74
76
77
+ // Verify that user can remove file from import input
78
+ await t . click ( myRedisDatabasePage . closeDialogBtn ) ;
79
+ await t . click ( myRedisDatabasePage . importDatabasesBtn ) ;
80
+ await t . setFilesToUpload ( myRedisDatabasePage . importDatabaseInput , [ rdmData . path ] ) ;
81
+ await t . expect ( myRedisDatabasePage . importDbDialog . textContent ) . contains ( rdmData . fileName , 'Filename not displayed in import input' ) ;
82
+ // Click on remove button
83
+ await t . click ( myRedisDatabasePage . removeImportedFileBtn ) ;
84
+ await t . expect ( myRedisDatabasePage . importDbDialog . textContent ) . contains ( defaultText , 'File not removed from import input' ) ;
85
+
75
86
// Verify that user can import database with mandatory fields
76
87
await t . click ( myRedisDatabasePage . closeDialogBtn ) ;
77
88
await databasesActions . importDatabase ( rdmData . path ) ;
0 commit comments