Skip to content

Commit 335c2e2

Browse files
Merge pull request #362 from RedisInsight/feature/e2e-workbench-history
e2e - workbench history tests
2 parents 13e988e + b339338 commit 335c2e2

File tree

3 files changed

+58
-0
lines changed

3 files changed

+58
-0
lines changed

tests/e2e/tests/critical-path/workbench/command-results.e2e.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,3 +115,27 @@ test.skip
115115
await workbenchPage.selectViewTypeText();
116116
await t.expect(await workbenchPage.queryCardContainer.nth(0).find(workbenchPage.cssQueryTextResult).visible).ok('The result is displayed in Text view');
117117
});
118+
test
119+
.after(async() => {
120+
//Drop database
121+
await deleteDatabase(ossStandaloneConfig.databaseName);
122+
})
123+
.meta({ rte: rte.standalone })
124+
('Verify that user can populate commands in Editor from history by clicking keyboard “up” button', async t => {
125+
const commands = [
126+
'FT.INFO',
127+
'RANDOMKEY',
128+
'set'
129+
];
130+
//Send commands
131+
for(const command of commands) {
132+
await workbenchPage.sendCommandInWorkbench(command);
133+
}
134+
//Verify the quick access to command history by up button
135+
for(const command of commands.reverse()) {
136+
await t.click(workbenchPage.queryInput);
137+
await t.pressKey('up');
138+
let script = await workbenchPage.scriptsLines.textContent;
139+
await t.expect(script.replace(/\s/g, ' ')).contains(command, 'Result of Manual command is displayed');
140+
}
141+
});

tests/e2e/tests/regression/shortcuts/shortcuts.e2e.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,18 @@ test
5050
await t.click(shortcutsPage.shortcutsCloseButton);
5151
await t.expect(shortcutsPage.shortcutsPanel.exists).notOk('Shortcuts panel is not displayed');
5252
})
53+
test
54+
.meta({ rte: rte.none })
55+
('Verify that user can see description of the “up” shortcut in the Help Center > Keyboard Shortcuts > Workbench table', async t => {
56+
const description = [
57+
'Quick-access to command history',
58+
'Up Arrow'
59+
];
60+
//Open Shortcuts
61+
await t.click(myRedisDatabasePage.helpCenterButton);
62+
await t.click(helpCenterPage.helpCenterShortcutButton);
63+
// Verify that user can see description of the “up” shortcut
64+
for(const element of description) {
65+
await t.expect(shortcutsPage.shortcutsPanel.textContent).contains(element, 'The user can see description of the “up” shortcut');
66+
}
67+
})

tests/e2e/tests/regression/workbench/history-of-results.e2e.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,3 +76,22 @@ test
7676
}
7777
await t.expect(workbenchPage.noCommandHistoryTitle.visible).ok('The first command is deleted when user executes 31 command');
7878
});
79+
test
80+
.meta({ rte: rte.none })
81+
('Verify that user can see cursor is at the first character when Editor is empty', async t => {
82+
const commands = [
83+
'FT.INFO',
84+
'RANDOMKEY'
85+
];
86+
const commandForCheck = 'SET';
87+
//Send commands
88+
for(const command of commands) {
89+
await workbenchPage.sendCommandInWorkbench(command);
90+
}
91+
//Verify the quick access to history works when cursor is at the first character
92+
await t.typeText(workbenchPage.queryInput, commandForCheck);
93+
await t.pressKey('enter');
94+
await t.pressKey('up');
95+
let script = await workbenchPage.scriptsLines.textContent;
96+
await t.expect(script.replace(/\s/g, ' ')).contains(commandForCheck, 'The command is not changed');
97+
})

0 commit comments

Comments
 (0)