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