@@ -123,10 +123,10 @@ test.before(async() => {
123
123
await t . click ( myRedisDatabasePage . retryImportBtn ) ;
124
124
await t . setFilesToUpload ( myRedisDatabasePage . importDatabaseInput , [ rdmData . path ] ) ;
125
125
126
- await t . expect ( myRedisDatabasePage . importDatabaseInput . textContent ) . contains ( fileNames . rdmFullJson , 'Filename not displayed in import input' ) ;
126
+ await t . expect ( myRedisDatabasePage . addDatabaseImport . textContent ) . contains ( fileNames . rdmFullJson , 'Filename not displayed in import input' ) ;
127
127
// Click on remove button
128
128
await t . click ( myRedisDatabasePage . removeImportedFileBtn ) ;
129
- await t . expect ( myRedisDatabasePage . importDatabaseInput . textContent ) . contains ( defaultText , 'File not removed from import input' ) ;
129
+ await t . expect ( myRedisDatabasePage . addDatabaseImport . textContent ) . contains ( defaultText , 'File not removed from import input' ) ;
130
130
} ) ;
131
131
test ( 'Connection import from JSON' , async t => {
132
132
// Verify that user can import database with mandatory/optional fields
@@ -153,9 +153,11 @@ test('Connection import from JSON', async t => {
153
153
// Verify that user can see 12 hidden characters regardless of the actual database password when it is set
154
154
await t . expect ( myRedisDatabasePage . AddRedisDatabase . passwordInput . value ) . eql ( hiddenPassword , 'Password import incorrect' ) ;
155
155
156
+ await t . click ( myRedisDatabasePage . AddRedisDatabase . cancelButton ) ;
156
157
// Verify cluster connection type imported
157
158
await databaseHelper . clickOnEditDatabaseByName ( rdmData . dbImportedNames [ 2 ] ) ;
158
159
await t . expect ( myRedisDatabasePage . AddRedisDatabase . connectionType . textContent ) . eql ( rdmData . connectionType , 'Connection type import incorrect' ) ;
160
+ await t . click ( myRedisDatabasePage . AddRedisDatabase . cancelButton ) ;
159
161
160
162
/*
161
163
Verify that user can import database with CA certificate
@@ -165,24 +167,29 @@ test('Connection import from JSON', async t => {
165
167
await databaseHelper . clickOnEditDatabaseByName ( await findImportedRdmDbNameInList ( 'rdmHost+Port+Name+CaCert' ) ) ;
166
168
await t . expect ( myRedisDatabasePage . AddRedisDatabase . caCertField . textContent ) . eql ( 'ca' , 'CA certificate import incorrect' ) ;
167
169
await t . expect ( myRedisDatabasePage . AddRedisDatabase . clientCertField . exists ) . notOk ( 'Client certificate was imported' ) ;
170
+ await t . click ( myRedisDatabasePage . AddRedisDatabase . cancelButton ) ;
168
171
169
172
// Verify that user can import database with Client certificate, Client private key
170
173
await databaseHelper . clickOnEditDatabaseByName ( await findImportedRdmDbNameInList ( 'rdmHost+Port+Name+clientCert+privateKey' ) ) ;
171
174
await t . expect ( myRedisDatabasePage . AddRedisDatabase . caCertField . textContent ) . eql ( 'No CA Certificate' , 'CA certificate was imported' ) ;
172
175
await t . expect ( myRedisDatabasePage . AddRedisDatabase . clientCertField . textContent ) . eql ( 'client' , 'Client certificate import incorrect' ) ;
176
+ await t . click ( myRedisDatabasePage . AddRedisDatabase . cancelButton ) ;
173
177
174
178
// Verify that user can import database with all certificates
175
179
await databaseHelper . clickOnEditDatabaseByName ( await findImportedRdmDbNameInList ( 'rdmHost+Port+Name+CaCert+clientCert+privateKey' ) ) ;
176
180
await t . expect ( myRedisDatabasePage . AddRedisDatabase . caCertField . textContent ) . eql ( 'ca' , 'CA certificate import incorrect' ) ;
177
181
await t . expect ( myRedisDatabasePage . AddRedisDatabase . clientCertField . textContent ) . eql ( 'client' , 'Client certificate import incorrect' ) ;
182
+ await t . click ( myRedisDatabasePage . AddRedisDatabase . cancelButton ) ;
178
183
179
184
// Verify that certificate not imported when any certificate field has not been parsed
180
185
await databaseHelper . clickOnEditDatabaseByName ( await findImportedRdmDbNameInList ( 'rdmCaCertInvalidBody' ) ) ;
181
186
await t . expect ( myRedisDatabasePage . AddRedisDatabase . caCertField . textContent ) . eql ( 'No CA Certificate' , 'CA certificate was imported' ) ;
182
187
await t . expect ( myRedisDatabasePage . AddRedisDatabase . clientCertField . exists ) . notOk ( 'Client certificate was imported' ) ;
188
+ await t . click ( myRedisDatabasePage . AddRedisDatabase . cancelButton ) ;
183
189
await databaseHelper . clickOnEditDatabaseByName ( await findImportedRdmDbNameInList ( 'rdmInvalidClientCert' ) ) ;
184
190
await t . expect ( myRedisDatabasePage . AddRedisDatabase . caCertField . textContent ) . eql ( 'No CA Certificate' , 'CA certificate was imported' ) ;
185
191
await t . expect ( myRedisDatabasePage . AddRedisDatabase . clientCertField . exists ) . notOk ( 'Client certificate was imported' ) ;
192
+ await t . click ( myRedisDatabasePage . AddRedisDatabase . cancelButton ) ;
186
193
187
194
// Verify that user can import files from Racompass, ARDM, RDM
188
195
for ( const db of dbData ) {
@@ -194,6 +201,7 @@ test('Connection import from JSON', async t => {
194
201
// Verify that user can import Sentinel database connections by corresponding fields in JSON
195
202
await databaseHelper . clickOnEditDatabaseByName ( dbData [ 1 ] . dbNames [ 2 ] ) ;
196
203
await t . expect ( myRedisDatabasePage . AddRedisDatabase . sentinelForm . textContent ) . contains ( 'Sentinel' , 'Sentinel connection type import incorrect' ) ;
204
+ await t . click ( myRedisDatabasePage . AddRedisDatabase . cancelButton ) ;
197
205
await myRedisDatabasePage . clickOnDBByName ( dbData [ 1 ] . dbNames [ 2 ] ) ;
198
206
await Common . checkURLContainsText ( 'browser' ) ;
199
207
} ) ;
@@ -205,29 +213,35 @@ test('Certificates import with/without path', async t => {
205
213
await databaseHelper . clickOnEditDatabaseByName ( rdmListOfCertsDB [ 0 ] . name ) ;
206
214
await t . expect ( myRedisDatabasePage . AddRedisDatabase . caCertField . textContent ) . eql ( rdmListOfCertsDB [ 0 ] . caCert . name , 'CA certificate import incorrect' ) ;
207
215
await t . expect ( myRedisDatabasePage . AddRedisDatabase . clientCertField . textContent ) . eql ( rdmListOfCertsDB [ 0 ] . clientCert . name , 'Client certificate import incorrect' ) ;
216
+ await t . click ( myRedisDatabasePage . AddRedisDatabase . cancelButton ) ;
208
217
209
218
await databaseHelper . clickOnEditDatabaseByName ( rdmListOfCertsDB [ 1 ] . name ) ;
210
219
await t . expect ( myRedisDatabasePage . AddRedisDatabase . caCertField . textContent ) . eql ( rdmListOfCertsDB [ 0 ] . caCert . name , 'CA certificate name with the same body is incorrect' ) ;
211
220
await t . expect ( myRedisDatabasePage . AddRedisDatabase . clientCertField . textContent ) . eql ( rdmListOfCertsDB [ 0 ] . clientCert . name , 'Client certificate name with the same body is incorrect' ) ;
221
+ await t . click ( myRedisDatabasePage . AddRedisDatabase . cancelButton ) ;
212
222
213
223
// Verify that when user imports a certificate and the same certificate name exists but with a different body, the certificate imported with "({incremental_number})_certificate_name" name
214
224
await databaseHelper . clickOnEditDatabaseByName ( rdmListOfCertsDB [ 2 ] . name ) ;
215
225
await t . expect ( myRedisDatabasePage . AddRedisDatabase . caCertField . textContent ) . eql ( `1_${ rdmListOfCertsDB [ 0 ] . caCert . name } ` , 'CA certificate name with the same body is incorrect' ) ;
216
226
await t . expect ( myRedisDatabasePage . AddRedisDatabase . clientCertField . textContent ) . eql ( `1_${ rdmListOfCertsDB [ 0 ] . clientCert . name } ` , 'Client certificate name with the same body is incorrect' ) ;
227
+ await t . click ( myRedisDatabasePage . AddRedisDatabase . cancelButton ) ;
217
228
218
229
// Verify that when user imports a certificate by path and the same certificate body already exists, the existing certificate (with its name) is applied
219
230
await databaseHelper . clickOnEditDatabaseByName ( rdmListOfCertsDB [ 3 ] . name ) ;
220
231
await t . expect ( myRedisDatabasePage . AddRedisDatabase . caCertField . textContent ) . eql ( 'caPath' , 'CA certificate import incorrect' ) ;
221
232
await t . expect ( myRedisDatabasePage . AddRedisDatabase . clientCertField . textContent ) . eql ( 'clientPath' , 'Client certificate import incorrect' ) ;
233
+ await t . click ( myRedisDatabasePage . AddRedisDatabase . cancelButton ) ;
222
234
223
235
await databaseHelper . clickOnEditDatabaseByName ( rdmListOfCertsDB [ 4 ] . name ) ;
224
236
await t . expect ( myRedisDatabasePage . AddRedisDatabase . caCertField . textContent ) . eql ( 'caPath' , 'CA certificate import incorrect' ) ;
225
237
await t . expect ( myRedisDatabasePage . AddRedisDatabase . clientCertField . textContent ) . eql ( 'clientPath' , 'Client certificate import incorrect' ) ;
238
+ await t . click ( myRedisDatabasePage . AddRedisDatabase . cancelButton ) ;
226
239
227
240
// Verify that when user imports a certificate by path and the same certificate name exists but with a different body, the certificate imported with "({incremental_number})certificate_name" name
228
241
await databaseHelper . clickOnEditDatabaseByName ( rdmListOfCertsDB [ 5 ] . name ) ;
229
242
await t . expect ( myRedisDatabasePage . AddRedisDatabase . caCertField . textContent ) . eql ( '1_caPath' , 'CA certificate import incorrect' ) ;
230
243
await t . expect ( myRedisDatabasePage . AddRedisDatabase . clientCertField . textContent ) . eql ( '1_clientPath' , 'Client certificate import incorrect' ) ;
244
+ await t . click ( myRedisDatabasePage . AddRedisDatabase . cancelButton ) ;
231
245
} ) ;
232
246
test ( 'Import SSH parameters' , async t => {
233
247
const sshAgentsResult = 'SSH Agents are not supported' ;
@@ -255,10 +269,12 @@ test('Import SSH parameters', async t => {
255
269
await t . expect ( myRedisDatabasePage . AddRedisDatabase . sshUsernameInput . value ) . eql ( racompListOfSSHDB [ 0 ] . sshUser , 'SSH username import incorrect' ) ;
256
270
// Verify that password, passphrase and private key are hidden for SSH option
257
271
await t . expect ( myRedisDatabasePage . AddRedisDatabase . sshPasswordInput . value ) . eql ( hiddenPassword , 'SSH password import incorrect' ) ;
272
+ await t . click ( myRedisDatabasePage . AddRedisDatabase . cancelButton ) ;
258
273
259
274
await databaseHelper . clickOnEditDatabaseByName ( racompListOfSSHDB [ 1 ] . name ) ;
260
275
// Verify that user can import the SSH Private Key both by its value specified in the file and by the file path
261
276
await t . expect ( myRedisDatabasePage . AddRedisDatabase . sshPrivateKeyInput . textContent ) . contains ( hiddenPassword , 'SSH Private key import incorrect' ) ;
262
277
// Verify that user can import the SSH parameters with Passcode
263
278
await t . expect ( myRedisDatabasePage . AddRedisDatabase . sshPassphraseInput . value ) . eql ( hiddenPassword , 'SSH Passphrase import incorrect' ) ;
279
+ await t . click ( myRedisDatabasePage . AddRedisDatabase . cancelButton ) ;
264
280
} ) ;
0 commit comments