Skip to content

Commit 7e65095

Browse files
authored
Merge pull request #1518 from RedisInsight/e2e/feature/RI-3541_prepopulate-fields
E2E/feature/RI-3541_prepopulate-fields
2 parents fdc4acc + 5df358b commit 7e65095

File tree

2 files changed

+27
-3
lines changed

2 files changed

+27
-3
lines changed

tests/e2e/tests/critical-path/a-first-start-form/autodiscovery.e2e.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ test
2020
.after(async() => {
2121
// Delete all auto-discovered databases
2222
for(let i = 0; i < standalonePorts.length; i++) {
23-
await myRedisDatabasePage.deleteDatabaseByName(`localhost:${standalonePorts[i]}`);
23+
await myRedisDatabasePage.deleteDatabaseByName(`127.0.0.1:${standalonePorts[i]}`);
2424
}
2525
})('Verify that when users open application for the first time, they can see all auto-discovered Standalone DBs', async t => {
2626
// Check that standalone DBs have been added into the application
@@ -29,11 +29,12 @@ test
2929
const name = await myRedisDatabasePage.dbNameList.nth(k).textContent;
3030
console.log(`AUTODISCOVERY ${k}: ${name}`);
3131
}
32+
// Verify that user can see all the databases automatically discovered with 127.0.0.1 host instead of localhost
3233
for(let i = 0; i < standalonePorts.length; i++) {
33-
await t.expect(myRedisDatabasePage.dbNameList.withExactText(`localhost:${standalonePorts[i]}`).exists).ok('Standalone DBs');
34+
await t.expect(myRedisDatabasePage.dbNameList.withExactText(`127.0.0.1:${standalonePorts[i]}`).exists).ok('Standalone DBs');
3435
}
3536
// Check that Sentinel and OSS cluster have not been added into the application
3637
for(let j = 0; j < otherPorts.length; j++) {
37-
await t.expect(myRedisDatabasePage.dbNameList.withExactText(`localhost:${otherPorts[j]}`).exists).notOk('Sentinel and OSS DBs');
38+
await t.expect(myRedisDatabasePage.dbNameList.withExactText(`127.0.0.1:${otherPorts[j]}`).exists).notOk('Sentinel and OSS DBs');
3839
}
3940
});

tests/e2e/tests/critical-path/database/connecting-to-the-db.e2e.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,26 @@ test
2323
await t.expect(addRedisDatabasePage.errorMessage.textContent).contains('Error', 'Error message not displayed', { timeout: 10000 });
2424
await t.expect(addRedisDatabasePage.errorMessage.textContent).contains(errorMessage, 'Error message not displayed', { timeout: 10000 });
2525
});
26+
test
27+
.meta({ rte: rte.none })('Fields to add database prepopulation', async t => {
28+
const defaultHost = '127.0.0.1';
29+
const defaultPort = '6379';
30+
const defaultSentinelPort = '26379';
31+
32+
await t
33+
.click(addRedisDatabasePage.addDatabaseButton)
34+
.click(addRedisDatabasePage.addDatabaseManually);
35+
// Verify that the Host, Port, Database Alias values pre-populated by default for the manual flow
36+
await t
37+
.expect(addRedisDatabasePage.hostInput.value).eql(defaultHost, 'Default host not prepopulated')
38+
.expect(addRedisDatabasePage.portInput.value).eql(defaultPort, 'Default port not prepopulated')
39+
.expect(addRedisDatabasePage.databaseAliasInput.value).eql(`${defaultHost}:${defaultPort}`, 'Default db alias not prepopulated');
40+
// Verify that the Host, Port, Database Alias values pre-populated by default for Sentinel
41+
await t
42+
.click(addRedisDatabasePage.addAutoDiscoverDatabase)
43+
.click(addRedisDatabasePage.redisSentinelType);
44+
await t
45+
.expect(addRedisDatabasePage.hostInput.value).eql(defaultHost, 'Default sentinel host not prepopulated')
46+
.expect(addRedisDatabasePage.portInput.value).eql(defaultSentinelPort, 'Default sentinel port not prepopulated');
47+
48+
});

0 commit comments

Comments
 (0)