Skip to content

Commit 2cab7ad

Browse files
e2e - regression tests fix
1 parent 7bcefca commit 2cab7ad

File tree

3 files changed

+16
-4
lines changed

3 files changed

+16
-4
lines changed

tests/e2e/pageObjects/my-redis-databases-page.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@ export class MyRedisDatabasePage {
5959
this.aliasInput = Selector('[data-testid=alias-input]');
6060
}
6161

62+
/**
63+
* Click on the database by name
64+
* @param dbName The name of the database to be opened
65+
*/
6266
async clickOnDBByName(dbName: string): Promise<void>{
6367
if (await this.toastCloseButton.exists) {
6468
await t.click(this.toastCloseButton);
@@ -101,6 +105,10 @@ export class MyRedisDatabasePage {
101105
}
102106
}
103107

108+
/**
109+
* Click on the edit database button by name
110+
* @param databaseName The name of the database to be edited
111+
*/
104112
async clickOnEditDBByName(databaseName: string): Promise<void>{
105113
const dbNames = this.tableRowContent;
106114
const count = await dbNames.count;

tests/e2e/tests/regression/browser/database-overview.e2e.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,9 @@ test
4646
//Delete database
4747
await deleteDatabase(ossStandaloneConfig.databaseName);
4848
})
49-
('Verify that user can connect to DB and see breadcrumbs at the top of the application in Browser page', async t => {
50-
//Verify that user can see breadcrumbs
49+
('Verify that user can connect to DB and see breadcrumbs at the top of the application', async t => {
50+
//Verify that user can see breadcrumbs in Browser and Workbench views
5151
await t.expect(browserPage.breadcrumbsContainer.visible).ok('User can see breadcrumbs in Browser page', { timeout: 20000 });
52+
await t.click(myRedisDatabasePage.workbenchButton);
53+
await t.expect(browserPage.breadcrumbsContainer.visible).ok('User can see breadcrumbs in Workbench page', { timeout: 20000 });
5254
});

tests/e2e/tests/regression/cli/cli.e2e.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ test
8787
await deleteDatabase(ossStandaloneConfig.databaseName);
8888
})
8989
('Verify that user can repeat commands by entering a number of repeats before the Redis command in CLI', async t => {
90-
chance.word({ length: 20 });
90+
keyName = chance.word({ length: 20 });
9191
const command = `SET ${keyName} a`;
9292
const repeats = 10;
9393
//Open CLI and run command with repeats
@@ -105,6 +105,7 @@ test
105105
await deleteDatabase(ossStandaloneConfig.databaseName);
106106
})
107107
('Verify that user can run command json.get and see JSON object with escaped quotes (\" instead of ")', async t => {
108+
keyName = chance.word({ length: 20 });
108109
//Add Json key with json object
109110
await browserPage.addJsonKey(keyName, keyTTL, jsonValue);
110111
const command = `JSON.GET ${keyName}`;
@@ -113,7 +114,8 @@ test
113114
await t.typeText(cliPage.cliCommandInput, command);
114115
await t.pressKey('enter');
115116
//Verify result
116-
await t.expect(cliPage.cliOutputResponseSuccess.innerText).eql(`"${jsonValue.replace(/"/g, '\\"')}"`, 'The user can see JSON object with escaped quotes');
117+
const commandResult = jsonValue.replace(/"/g, '\\"');
118+
await t.expect(cliPage.cliOutputResponseSuccess.innerText).eql(`"${commandResult}"`, 'The user can see JSON object with escaped quotes');
117119
});
118120
test
119121
.meta({ rte: rte.standalone })

0 commit comments

Comments
 (0)