Skip to content

Commit fdf9eda

Browse files
Merge pull request #2614 from RedisInsight/e2e/feature/RI-4813_not_duplicate_cloud_database
add test for RI-4813 Do not duplicate Cloud databases
2 parents 37e6c74 + 10decfb commit fdf9eda

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-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: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ test
3434
};
3535

3636
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');
37+
await t.expect(await myRedisDatabasePage.AddRedisDatabase.disabledDatabaseInfo.nth(0).find('span').getAttribute('title')).contains(host, 'Wrong host value');
38+
await t.expect(await myRedisDatabasePage.AddRedisDatabase.disabledDatabaseInfo.nth(1).find('span').getAttribute('title')).contains(port, 'Wrong port value');
3939
await t.click(await myRedisDatabasePage.AddRedisDatabase.addRedisDatabaseButton);
4040
// wait for db is added
4141
await t.wait(3_000);
@@ -61,12 +61,23 @@ test
6161
const connectUrlParams = {
6262
redisUrl: `redis://${databaseUsername}:${databasePassword}@${host}:${port}`,
6363
databaseAlias: databaseName,
64-
redirect: 'workbench?guidePath=/quick-guides/document/introduction.md'
64+
redirect: 'workbench?guidePath=/quick-guides/document/introduction.md',
65+
cloudBdbId: '1232',
66+
subscriptionType: 'fixed',
67+
planMemoryLimit: '30',
68+
memoryLimitMeasurementUnit: 'mb',
69+
free: 'true'
6570
};
6671

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

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

0 commit comments

Comments
 (0)