Skip to content

Commit bc1384a

Browse files
authored
Merge pull request #2598 from RedisInsight/e2e/bugfix/fixes-slow-log-tests
e2e updates for slowlog tests
2 parents a569132 + e75ede8 commit bc1384a

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

tests/e2e/tests/critical-path/slow-log/slow-log.e2e.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ test('Verify that user can open new Slow Log page using new icon on left app pan
3131
// Verify that user see "Slow Log" page by default for non OSS Cluster
3232
await t.expect(overviewPage.overviewTab.withAttribute('aria-selected', 'true').exists).notOk('The Overview tab is displayed for non OSS Cluster db');
3333
// Verify that user can configure slowlog-max-len for Slow Log and see whole set of commands according to the setting
34-
await slowLogPage.changeSlowerThanParameter(slowerThanParameter);
34+
await slowLogPage.changeSlowerThanParameter(slowerThanParameter, slowLogPage.slowLogConfigureMicroSecondsUnit);
3535
await slowLogPage.Cli.sendCommandInCli(command);
3636
await t.click(slowLogPage.slowLogRefreshButton);
3737
const duration = await slowLogPage.slowLogCommandValue.withExactText(command).parent(3).find(slowLogPage.cssSelectorDurationValue).textContent;
@@ -50,21 +50,21 @@ test('Verify that user can see "No Slow Logs found" message when slowlog-max-len
5050
await t.expect(slowLogPage.slowLogEmptyResult.exists).ok('Empty results not found');
5151
// Verify that user can see not more that number of commands that was specified in configuration
5252
maxCommandLength = 30;
53-
await slowLogPage.changeSlowerThanParameter(slowerThanParameter);
53+
await slowLogPage.changeSlowerThanParameter(slowerThanParameter, slowLogPage.slowLogConfigureMicroSecondsUnit);
5454
await slowLogPage.changeMaxLengthParameter(maxCommandLength);
5555
// Go to Browser page to scan keys and turn back
5656
await t.click(myRedisDatabasePage.NavigationPanel.browserButton);
5757
await t.click(browserPage.refreshKeysButton);
5858
await t.click(myRedisDatabasePage.NavigationPanel.analysisPageButton);
5959
await t.click(slowLogPage.slowLogTab);
6060
// Compare number of logged commands with maxLength
61-
await t.expect(slowLogPage.slowLogCommandStatistics.withText(`${maxCommandLength} entries`).exists).ok('Number of displayed commands is less than ');
61+
await t.expect(slowLogPage.slowLogCommandStatistics.withText(`${maxCommandLength} entries`).exists).ok(`Number of displayed commands is less than selected ${maxCommandLength}`);
6262
});
6363
test('Verify that users can specify number of commands that they want to display (10, 25, 50, 100, Max) in Slow Log', async t => {
6464
maxCommandLength = 128;
6565
const numberOfCommandsArray = [10, 25, 50, 100, -1];
6666
// Change slower-than parameter
67-
await slowLogPage.changeSlowerThanParameter(slowerThanParameter);
67+
await slowLogPage.changeSlowerThanParameter(slowerThanParameter, slowLogPage.slowLogConfigureMicroSecondsUnit);
6868
await slowLogPage.changeMaxLengthParameter(maxCommandLength);
6969
// Go to Browser page to scan keys and turn back
7070
await t.click(myRedisDatabasePage.NavigationPanel.browserButton);
@@ -83,7 +83,7 @@ test('Verify that users can specify number of commands that they want to display
8383
});
8484
test('Verify that user can set slowlog-log-slower-than value in milliseconds and command duration will be re-calculated to ms', async t => {
8585
// Set slower than parameter to log commands
86-
await slowLogPage.changeSlowerThanParameter(slowerThanParameter);
86+
await slowLogPage.changeSlowerThanParameter(slowerThanParameter, slowLogPage.slowLogConfigureMicroSecondsUnit);
8787
// Send command in microseconds
8888
command = 'scan 0 MATCH * COUNT 5000';
8989
await slowLogPage.Cli.sendCommandInCli(command);
@@ -111,7 +111,7 @@ test('Verify that user can set slowlog-log-slower-than value in milliseconds and
111111
test('Verify that user can reset settings to default on Slow Log page', async t => {
112112
// Set slowlog-max-len=0
113113
command = 'info';
114-
await slowLogPage.changeSlowerThanParameter(slowerThanParameter);
114+
await slowLogPage.changeSlowerThanParameter(slowerThanParameter, slowLogPage.slowLogConfigureMicroSecondsUnit);
115115
await slowLogPage.Cli.sendCommandInCli('info');
116116
await t.click(slowLogPage.slowLogRefreshButton);
117117
await t.expect(slowLogPage.slowLogCommandValue.withExactText(command).exists).ok('Logged command not found');
@@ -121,11 +121,11 @@ test('Verify that user can reset settings to default on Slow Log page', async t
121121
await t.expect(slowLogPage.slowLogEmptyResult.exists).ok('Slow log is not cleared');
122122

123123
// Set slower than parameter and max length
124-
await slowLogPage.changeSlowerThanParameter(slowerThanParameter);
124+
await slowLogPage.changeSlowerThanParameter(slowerThanParameter, slowLogPage.slowLogConfigureMicroSecondsUnit);
125125
await slowLogPage.changeMaxLengthParameter(maxCommandLength);
126126
// Reset settings to default
127127
await slowLogPage.resetToDefaultConfig();
128128
// Compare configuration after re-setting
129129
const configText = await slowLogPage.configInfo.textContent;
130-
await t.expect(configText.replace(/\u00a0/g, ' ')).contains('Execution time: 10 000 µs, Max length: 128', 'Not reset configuration');
130+
await t.expect(configText.replace(/\u00a0/g, ' ')).contains('Execution time: 10 msec, Max length: 128', 'Not reset configuration');
131131
});

0 commit comments

Comments
 (0)