Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 7 additions & 11 deletions tests/e2e/tests/critical-path/monitor/monitor.e2e.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { Chance } from 'chance';
import { acceptLicenseTermsAndAddDatabase, deleteDatabase } from '../../../helpers/database';
import {
MyRedisDatabasePage,
Expand All @@ -11,7 +12,6 @@ import {
ossStandaloneConfig
} from '../../../helpers/conf';
import { rte } from '../../../helpers/constants';
import { Chance } from 'chance';

const myRedisDatabasePage = new MyRedisDatabasePage();
const cliPage = new CliPage();
Expand All @@ -31,14 +31,13 @@ fixture `Monitor`
})
.afterEach(async() => {
await deleteDatabase(ossStandaloneConfig.databaseName);
})
});
test
.meta({ rte: rte.standalone })
.after(async () => {
.after(async() => {
await browserPage.deleteKeyByName(keyName);
await deleteDatabase(ossStandaloneConfig.databaseName);
})
('Verify that user can work with Monitor', async t => {
})('Verify that user can work with Monitor', async t => {
const command = 'set';
//Verify that user can open Monitor
await t.click(monitorPage.expandMonitor);
Expand All @@ -56,17 +55,14 @@ test
await monitorPage.checkCommandInMonitorResults(command, [keyName, keyValue]);
});
test
.meta({ rte: rte.standalone })
('Verify that user can see the list of all commands from all clients ran for this Redis database in the list of results in Monitor', async t => {
.meta({ rte: rte.standalone })('Verify that user can see the list of all commands from all clients ran for this Redis database in the list of results in Monitor', async t => {
//Define commands in different clients
const cli_command = 'command';
const workbench_command = 'hello';
const common_command = 'info';
const browser_command = 'dbsize';
//Expand Monitor panel
await t.click(monitorPage.expandMonitor);
//Start monitor (using run button in header)
await t.click(monitorPage.runMonitorToggle);
//Start Monitor
await monitorPage.startMonitor();
//Send command in CLI
await cliPage.getSuccessCommandResultFromCli(cli_command);
//Check that command from CLI is displayed in monitor
Expand Down
18 changes: 13 additions & 5 deletions tests/e2e/tests/regression/monitor/monitor.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,13 @@ test
//Click on Stop Monitor button
await t.click(monitorPage.runMonitorToggle);
//Check for "Monitor is stopped." text
await t.expect(monitorPage.monitorIsStoppedText.innerText).eql('Profiler is stopped.');
//Check that no commands are displayed after "Monitor is stopped" text
await t.expect(monitorPage.monitorIsStoppedText.nextSibling().exists).notOk('No commands in monitor');
await t.expect(monitorPage.monitorIsStoppedText.innerText).eql('Profiler is paused.', 'Paused profiler message');
//Get the last log line
const lastTimestamp = await monitorPage.monitorCommandLineTimestamp.nth(-1).textContent;
//Click on refresh keys to get new logs
await t.click(browserPage.refreshKeysButton);
//Check that no commands are displayed after monitor paused
await t.expect(monitorPage.monitorCommandLineTimestamp.nth(-1).textContent).eql(lastTimestamp, 'The last line of monitor logs');
});
test
.meta({ rte: rte.standalone })('Verify that when user refreshes the page the list of results in Monitor is not saved', async t => {
Expand All @@ -72,12 +76,16 @@ test
.meta({ rte: rte.standalone })('Verify that when user clicks on "Clear" button in Monitor, all commands history is removed', async t => {
//Run monitor
await monitorPage.startMonitor();
//Click on refresh keys to get new logs
await t.click(browserPage.refreshKeysButton);
//Get last timestamp
const lastTimestamp = await monitorPage.monitorCommandLineTimestamp.nth(-1);
//Stop Monitor
await monitorPage.stopMonitor();
//Click on Clear button
await t.click(monitorPage.clearMonitorButton);
//Check that monitor has start screen
await t.expect(monitorPage.startMonitorButton.exists).ok('Start monitor button');
//Check that monitor screen is cleared
await t.expect(lastTimestamp.exists).notOk('Cleared last line');
});
test
.meta({ rte: rte.standalone })
Expand Down