@@ -90,47 +90,41 @@ fixture `Import databases`
90
90
// Delete all existing connections
91
91
await databaseAPIRequests . deleteAllDatabasesApi ( ) ;
92
92
} ) ;
93
- test
94
- . before ( async ( ) => {
95
- await databaseAPIRequests . deleteAllDatabasesApi ( ) ;
96
- await databaseHelper . acceptLicenseTerms ( ) ;
97
- await databaseAPIRequests . addNewStandaloneDatabaseApi ( ossStandaloneConfig ) ;
98
- await myRedisDatabasePage . reloadPage ( ) ;
99
- } ) ( 'Connection import modal window' , async t => {
100
- const tooltipText = 'Import Database Connections' ;
101
- const defaultText = 'Select or drag and drop a file' ;
102
- const parseFailedMsg = 'Failed to add database connections' ;
103
- const parseFailedMsg2 = `Unable to parse ${ fileNames . racompassInvalidJson } ` ;
93
+ test ( 'Connection import modal window' , async t => {
94
+ const tooltipText = 'Import Database Connections' ;
95
+ const defaultText = 'Select or drag and drop a file' ;
96
+ const parseFailedMsg = 'Failed to add database connections' ;
97
+ const parseFailedMsg2 = `Unable to parse ${ fileNames . racompassInvalidJson } ` ;
104
98
105
- // Verify that user can see the “Import Database Connections” tooltip
106
- await t . expect ( myRedisDatabasePage . importDatabasesBtn . visible ) . ok ( 'The import databases button not displayed' ) ;
107
- await t . hover ( myRedisDatabasePage . importDatabasesBtn ) ;
108
- await t . expect ( browserPage . tooltip . innerText ) . contains ( tooltipText , 'The tooltip message not displayed/correct' ) ;
99
+ // Verify that user can see the “Import Database Connections” tooltip
100
+ await t . expect ( myRedisDatabasePage . importDatabasesBtn . visible ) . ok ( 'The import databases button not displayed' ) ;
101
+ await t . hover ( myRedisDatabasePage . importDatabasesBtn ) ;
102
+ await t . expect ( browserPage . tooltip . innerText ) . contains ( tooltipText , 'The tooltip message not displayed/correct' ) ;
109
103
110
- // Verify that Import dialogue is not closed when clicking any area outside the box
111
- await t . click ( myRedisDatabasePage . importDatabasesBtn ) ;
112
- await t . expect ( myRedisDatabasePage . importDbDialog . exists ) . ok ( 'Import Database Connections dialog not opened' ) ;
113
- await t . click ( myRedisDatabasePage . NavigationPanel . myRedisDBButton ) ;
114
- await t . expect ( myRedisDatabasePage . importDbDialog . exists ) . ok ( 'Import Database Connections dialog not displayed' ) ;
104
+ // Verify that Import dialogue is not closed when clicking any area outside the box
105
+ await t . click ( myRedisDatabasePage . importDatabasesBtn ) ;
106
+ await t . expect ( myRedisDatabasePage . importDbDialog . exists ) . ok ( 'Import Database Connections dialog not opened' ) ;
107
+ await t . click ( myRedisDatabasePage . NavigationPanel . myRedisDBButton ) ;
108
+ await t . expect ( myRedisDatabasePage . importDbDialog . exists ) . ok ( 'Import Database Connections dialog not displayed' ) ;
115
109
116
- // Verify that user see the message when parse error appears
117
- await t
118
- . setFilesToUpload ( myRedisDatabasePage . importDatabaseInput , [ filePathes . racompassInvalidJsonPath ] )
119
- . click ( myRedisDatabasePage . submitImportBtn )
120
- . expect ( myRedisDatabasePage . failedImportMessage . exists ) . ok ( 'Failed to add database message not displayed' )
121
- . expect ( myRedisDatabasePage . failedImportMessage . textContent ) . contains ( parseFailedMsg )
122
- . expect ( myRedisDatabasePage . failedImportMessage . textContent ) . contains ( parseFailedMsg2 ) ;
110
+ // Verify that user see the message when parse error appears
111
+ await t
112
+ . setFilesToUpload ( myRedisDatabasePage . importDatabaseInput , [ filePathes . racompassInvalidJsonPath ] )
113
+ . click ( myRedisDatabasePage . submitImportBtn )
114
+ . expect ( myRedisDatabasePage . failedImportMessage . exists ) . ok ( 'Failed to add database message not displayed' )
115
+ . expect ( myRedisDatabasePage . failedImportMessage . textContent ) . contains ( parseFailedMsg )
116
+ . expect ( myRedisDatabasePage . failedImportMessage . textContent ) . contains ( parseFailedMsg2 ) ;
123
117
124
- // Verify that user can remove file from import input
125
- await t . click ( myRedisDatabasePage . closeDialogBtn ) ;
126
- await t . click ( myRedisDatabasePage . importDatabasesBtn ) ;
127
- await t . setFilesToUpload ( myRedisDatabasePage . importDatabaseInput , [ rdmData . path ] ) ;
128
- // update after resolving testcafe Native Automation mode limitations
129
- // await t.expect(myRedisDatabasePage.importDbDialog.textContent).contains(fileNames.rdmFullJson, 'Filename not displayed in import input');
130
- // Click on remove button
131
- await t . click ( myRedisDatabasePage . removeImportedFileBtn ) ;
132
- await t . expect ( myRedisDatabasePage . importDbDialog . textContent ) . contains ( defaultText , 'File not removed from import input' ) ;
133
- } ) ;
118
+ // Verify that user can remove file from import input
119
+ await t . click ( myRedisDatabasePage . closeDialogBtn ) ;
120
+ await t . click ( myRedisDatabasePage . importDatabasesBtn ) ;
121
+ await t . setFilesToUpload ( myRedisDatabasePage . importDatabaseInput , [ rdmData . path ] ) ;
122
+ // update after resolving testcafe Native Automation mode limitations
123
+ // await t.expect(myRedisDatabasePage.importDbDialog.textContent).contains(fileNames.rdmFullJson, 'Filename not displayed in import input');
124
+ // Click on remove button
125
+ await t . click ( myRedisDatabasePage . removeImportedFileBtn ) ;
126
+ await t . expect ( myRedisDatabasePage . importDbDialog . textContent ) . contains ( defaultText , 'File not removed from import input' ) ;
127
+ } ) ;
134
128
test ( 'Connection import from JSON' , async t => {
135
129
// Verify that user can import database with mandatory/optional fields
136
130
await databasesActions . importDatabase ( rdmData ) ;
0 commit comments