Skip to content

Commit 2078d24

Browse files
add test for RI-4813 Do not duplicate Cloud databases
1 parent 37e6c74 commit 2078d24

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

tests/e2e/pageObjects/components/myRedisDatabase/add-redis-database.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ export class AddRedisDatabase {
3333
showPasswordBtn = Selector('[aria-label^="Show password"]');
3434
testConnectionBtn = Selector('[data-testid=btn-test-connection]');
3535
// TEXT INPUTS (also referred to as 'Text fields')
36+
disabledDatabaseInfo = Selector('[class=euiListGroupItem__text]');
3637
hostInput = Selector('[data-testid=host]');
3738
portInput = Selector('[data-testid=port]');
3839
databaseAliasInput = Selector('[data-testid=name]');

tests/e2e/tests/critical-path/url-handling/url-handling.e2e.ts

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ let { host, port, databaseName, databaseUsername = '', databasePassword = '' } =
1717
const redisConnect = 'redisinsight://databases/connect';
1818

1919
fixture `Add DB from SM`
20+
.only
2021
.meta({ type: 'critical_path', rte: rte.none })
2122
.afterEach(async() => {
2223
// Delete all existing connections
@@ -34,8 +35,8 @@ test
3435
};
3536

3637
await t.navigateTo(generateLink(connectUrlParams));
37-
await t.expect(await myRedisDatabasePage.AddRedisDatabase.hostInput.getAttribute('value')).eql(host, 'Wrong host value');
38-
await t.expect(await myRedisDatabasePage.AddRedisDatabase.portInput.getAttribute('value')).eql(port, 'Wrong port value');
38+
await t.expect(await myRedisDatabasePage.AddRedisDatabase.disabledDatabaseInfo.nth(0).find('span').getAttribute('title')).contains(host, 'Wrong host value');
39+
await t.expect(await myRedisDatabasePage.AddRedisDatabase.disabledDatabaseInfo.nth(1).find('span').getAttribute('title')).contains(port, 'Wrong port value');
3940
await t.click(await myRedisDatabasePage.AddRedisDatabase.addRedisDatabaseButton);
4041
// wait for db is added
4142
await t.wait(3_000);
@@ -61,12 +62,23 @@ test
6162
const connectUrlParams = {
6263
redisUrl: `redis://${databaseUsername}:${databasePassword}@${host}:${port}`,
6364
databaseAlias: databaseName,
64-
redirect: 'workbench?guidePath=/quick-guides/document/introduction.md'
65+
redirect: 'workbench?guidePath=/quick-guides/document/introduction.md',
66+
cloudId: '1232',
67+
subscriptionType: 'fixed',
68+
planMemoryLimit: '30',
69+
memoryLimitMeasurementUnit: 'mb',
70+
free: 'true'
6571
};
6672

6773
await t.navigateTo(generateLink(connectUrlParams));
6874
await t.wait(3_000);
6975
await t.expect(await workbenchPage.closeEnablementPage.exists).ok('Redirection to Workbench tutorial is not correct');
76+
77+
//Verify that the same db is not added
78+
await t.navigateTo(generateLink(connectUrlParams));
79+
await t.wait(3_000);
80+
await t.click(await workbenchPage.NavigationPanel.myRedisDBButton);
81+
await t.expect(await myRedisDatabasePage.dbNameList.child('span').withExactText(databaseName).count).eql(2, 'the same db is added twice');
7082
});
7183

7284
function generateLink(params: Record<string, any>): string {

0 commit comments

Comments
 (0)