Skip to content

Commit 4be338b

Browse files
committed
fixes by comments
1 parent aa9bd15 commit 4be338b

File tree

2 files changed

+28
-9
lines changed

2 files changed

+28
-9
lines changed

tests/e2e/common-actions/databases-actions.ts

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,34 @@ export class DatabasesActions {
1717

1818
/**
1919
* 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
2221
*/
23-
async importDatabase(pathToFile: string, databaseType = ''): Promise<void> {
22+
async importDatabase(fileParameters: ImportDatabaseParameters): Promise<void> {
2423
await t
2524
.click(myRedisDatabasePage.importDatabasesBtn)
26-
.setFilesToUpload(myRedisDatabasePage.importDatabaseInput, [pathToFile])
25+
.setFilesToUpload(myRedisDatabasePage.importDatabaseInput, [fileParameters.path])
2726
.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`);
2928
}
3029

3130
}
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+
};

tests/e2e/tests/critical-path/database/import-databases.e2e.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ test
5858
const defaultText = 'Select or drag and drop a file';
5959

6060
// Verify that user can see the “Import Database Connections” tooltip
61-
await t.hover(myRedisDatabasePage.importDatabasesBtn);
61+
await t.expect(myRedisDatabasePage.importDatabasesBtn.visible).ok('The import databases button not displayed');
6262
await t.hover(myRedisDatabasePage.importDatabasesBtn);
6363
await t.expect(browserPage.tooltip.innerText).contains(tooltipText, 'The tooltip message not displayed/correct');
6464

@@ -85,9 +85,9 @@ test
8585

8686
// Verify that user can import database with mandatory fields
8787
await t.click(myRedisDatabasePage.closeDialogBtn);
88-
await databasesActions.importDatabase(rdmData.path);
88+
await databasesActions.importDatabase(rdmData);
8989
// Verify that success message is displayed
90-
await t.expect(myRedisDatabasePage.successImportMessage.textContent).contains(partialImportedMsg, 'Successfully added databases number not correct');
90+
await t.expect(myRedisDatabasePage.successImportMessage.textContent).contains(partialImportedMsg, 'Databases not imported successfully');
9191

9292
// Verify that list of databases is reloaded when database added
9393
await t.click(myRedisDatabasePage.okDialogBtn);
@@ -105,7 +105,7 @@ test
105105

106106
// Verify that user can import files from Racompass, ARDM, RDM
107107
for (const db of dbData) {
108-
await databasesActions.importDatabase(db.path, db.type);
108+
await databasesActions.importDatabase(db);
109109
await t.click(myRedisDatabasePage.okDialogBtn);
110110
await databasesActions.verifyDatabasesDisplayed(db.dbNames);
111111
}

0 commit comments

Comments
 (0)