Skip to content

Commit cb59ef2

Browse files
Merge pull request #422 from RedisInsight/e2e/fix-tests
fix e2e test
2 parents 91a6e42 + c8df2b4 commit cb59ef2

File tree

4 files changed

+13
-11
lines changed

4 files changed

+13
-11
lines changed

tests/e2e/tests/critical-path/browser/filtering.e2e.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,16 +53,15 @@ test
5353
await t.click(cliPage.cliExpandButton);
5454
for (const { textType, keyName } of keyTypes) {
5555
if (textType in COMMANDS_TO_CREATE_KEY) {
56-
await t.typeText(cliPage.cliCommandInput, COMMANDS_TO_CREATE_KEY[textType](keyName));
56+
await t.typeText(cliPage.cliCommandInput, COMMANDS_TO_CREATE_KEY[textType](keyName), { paste: true });
5757
await t.pressKey('enter');
5858
}
5959
}
6060
await t.click(cliPage.cliCollapseButton);
61-
61+
await t.click(browserPage.refreshKeysButton);
6262
for (const { textType, keyName } of keyTypes) {
6363
await browserPage.selectFilterGroupType(textType);
64-
const isKeyIsDisplayedInTheList = await browserPage.isKeyIsDisplayedInTheList(keyName);
65-
await t.expect(isKeyIsDisplayedInTheList).ok(`The key of type ${textType} was found`);
64+
await t.expect(await browserPage.isKeyIsDisplayedInTheList(keyName)).ok(`The key of type ${textType} was found`);
6665
await browserPage.deleteKey();
6766
}
6867
});

tests/e2e/tests/critical-path/tree-view/tree-view.e2e.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ test
2626
.meta({ rte: rte.standalone })
2727
('Verify that when user opens the application he can see that Tree View is disabled by default(Browser is selected by default)', async t => {
2828
//Verify that Browser view is selected by default and Tree view is disabled
29-
await t.expect(browserPage.browserViewButton.getStyleProperty('background-color')).eql('rgb(33, 37, 54)', 'The Browser is selected by default');
29+
await t.expect(browserPage.browserViewButton.getStyleProperty('background-color')).eql('rgb(41, 47, 71)', 'The Browser is selected by default');
3030
await t.expect(browserPage.treeViewArea.visible).notOk('The tree view is not displayed', { timeout: 20000 });
3131
});
3232
test

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,8 @@ test
132132
await workbenchPage.sendCommandInWorkbench(command);
133133
}
134134
//Verify the quick access to command history by up button
135+
await t.click(workbenchPage.queryInput);
135136
for(const command of commands.reverse()) {
136-
await t.click(workbenchPage.queryInput);
137137
await t.pressKey('up');
138138
let script = await workbenchPage.scriptsLines.textContent;
139139
await t.expect(script.replace(/\s/g, ' ')).contains(command, 'Result of Manual command is displayed');

tests/e2e/tests/regression/browser/ttl-format.e2e.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
11
import { Selector } from 'testcafe';
22
import { acceptLicenseTermsAndAddDatabase, deleteDatabase } from '../../../helpers/database';
3-
import { keyTypes, getRandomKeyName } from '../../../helpers/keys';
3+
import { keyTypes } from '../../../helpers/keys';
44
import { rte } from '../../../helpers/constants';
55
import { COMMANDS_TO_CREATE_KEY, keyLength } from '../../../helpers/constants';
66
import { BrowserPage, CliPage } from '../../../pageObjects';
77
import { commonUrl, ossStandaloneConfig } from '../../../helpers/conf';
8+
import { Chance } from 'chance';
89

910
const browserPage = new BrowserPage();
1011
const cliPage = new CliPage();
12+
const chance = new Chance();
13+
1114
const keysData = keyTypes.slice(0, 6);
1215
for (const key of keysData) {
13-
key.keyName = `${key.keyName}` + '-' + `${getRandomKeyName(keyLength)}`
16+
key.keyName = `${key.keyName}` + '-' + `${chance.word({ length: keyLength })}`
1417
}
1518
//Arrays with TTL in seconds, min, hours, days, months, years and their values in Browser Page
1619
const ttlForSet = [59, 800, 20000, 2000000, 31000000, 2147483647];
@@ -35,9 +38,9 @@ test
3538
//Create new keys with TTL
3639
await t.click(cliPage.cliExpandButton);
3740
for (let i = 0; i < keysData.length; i++) {
38-
await t.typeText(cliPage.cliCommandInput, COMMANDS_TO_CREATE_KEY[keysData[i].textType](keysData[i].keyName));
41+
await t.typeText(cliPage.cliCommandInput, COMMANDS_TO_CREATE_KEY[keysData[i].textType](keysData[i].keyName), { paste: true });
3942
await t.pressKey('enter');
40-
await t.typeText(cliPage.cliCommandInput, `EXPIRE ${keysData[i].keyName} ${ttlForSet[i]}`);
43+
await t.typeText(cliPage.cliCommandInput, `EXPIRE ${keysData[i].keyName} ${ttlForSet[i]}`, { paste: true });
4144
await t.pressKey('enter');
4245
}
4346
await t.click(cliPage.cliCollapseButton);
@@ -46,6 +49,6 @@ test
4649
//Check that Keys has correct TTL value in keys table
4750
for (let i = 0; i < keysData.length; i++) {
4851
const ttlValueElement = Selector(`[data-testid="ttl-${keysData[i].keyName}"]`);
49-
await t.expect(ttlValueElement.textContent).contains(ttlValues[i], 'TTL value in keys table');
52+
await t.expect(ttlValueElement.textContent).contains(ttlValues[i], `TTL value in keys table is ${ttlValues[i]}`);
5053
}
5154
});

0 commit comments

Comments
 (0)