Skip to content

Commit 27f7a5e

Browse files
Merge pull request #91 from RedisInsight/feature/e2e
e2e - fix tests
2 parents c4c3ef9 + 11bd9ce commit 27f7a5e

File tree

3 files changed

+18
-9
lines changed

3 files changed

+18
-9
lines changed

tests/e2e/pageObjects/workbench-page.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ export class WorkbenchPage {
4141
monacoCloseCommandDetails: Selector
4242
monacoSuggestion: Selector
4343
iframe: Selector
44+
internalLinkWorkingWithHashes: Selector
45+
preselectExactSearch: Selector
46+
preselectGroupBy: Selector
4447

4548
constructor() {
4649
//CSS selectors
@@ -66,9 +69,12 @@ export class WorkbenchPage {
6669
this.preselectList = Selector('[data-testid*=preselect-List]');
6770
this.preselectIndexInfo = Selector('[data-testid*=preselect-Index]');
6871
this.preselectSearch = Selector('[data-testid=preselect-Search]');
72+
this.preselectExactSearch = Selector('[data-testid="preselect-Exact text search"]');
73+
this.preselectGroupBy = Selector('[data-testid*=preselect-Group]');
6974
this.preselectButtons = Selector('[data-testid^=preselect-]');
7075
this.reRunCommandButton = Selector('[data-testid=re-run-command]');
7176
this.preselectManual = Selector('[data-testid=preselect-Manual]');
77+
this.internalLinkWorkingWithHashes = Selector('[data-testid=internal-link-working-with-hashes]');
7278
// TEXT INPUTS (also referred to as 'Text fields')
7379
this.queryInput = Selector('[data-testid=query-input-container]');
7480
this.scriptsLines = Selector('[data-testid=query-input-container] .view-lines');

tests/e2e/tests/critical-path/workbench/default-scripts-area.e2e.ts

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ fixture `Default scripts area at Workbench`
3030
//Drop index and documents
3131
await workbenchPage.sendCommandInWorkbench('FT.DROPINDEX products DD');
3232
})
33-
//skipped due the disabled default scripts area
33+
//skipped due the inaccessibility of the iframe
3434
test.skip('Verify that user can edit and run automatically added "FT._LIST" and "FT.INFO {index}" scripts in Workbench and see the results', async t => {
3535
const commandsForSend = [
3636
`FT.CREATE ${indexName} ON HASH PREFIX 1 product: SCHEMA name TEXT`,
@@ -40,33 +40,35 @@ test.skip('Verify that user can edit and run automatically added "FT._LIST" and
4040
//Send commands
4141
await workbenchPage.sendCommandInWorkbench(commandsForSend.join('\n'));
4242
//Run automatically added "FT._LIST" script
43+
await t.click(workbenchPage.internalLinkWorkingWithHashes);
4344
await t.click(workbenchPage.preselectList);
4445
await t.click(workbenchPage.submitCommandButton);
4546
//Check the FT._LIST result
4647
await t.expect(workbenchPage.queryTextResult.textContent).contains(indexName, 'The result of the FT._LIST command');
4748
//Run automatically added "FT.INFO {index}" script with added index
4849
await t.click(workbenchPage.preselectIndexInfo);
49-
let addedScript = await workbenchPage.queryInputScriptArea.textContent;
50+
let addedScript = await workbenchPage.queryInputScriptArea.nth(3).textContent;
5051
//Replace the {index} with indexName value in script and send
51-
addedScript = addedScript.replace('{index}', indexName);
52+
addedScript = addedScript.replace('"permits"', indexName);
5253
addedScript = addedScript.replace(/\s/g, ' ');
5354
await t.pressKey('ctrl+a delete');
5455
await workbenchPage.sendCommandInWorkbench(addedScript);
5556
//Check the FT.INFO result
5657
await t.expect(workbenchPage.queryColumns.textContent).contains('name', 'The result of the FT.INFO command');
5758
});
58-
//skipped due the disabled default scripts area
59+
//skipped due the inaccessibility of the iframe
5960
test.skip('Verify that user can edit and run automatically added "Search" script in Workbench and see the results', async t => {
6061
const commandsForSend = [
6162
`FT.CREATE ${indexName} ON HASH PREFIX 1 product: SCHEMA name TEXT`,
6263
'HMSET product:1 name "Apple Juice"',
6364
'HMSET product:2 name "Apple Juice"'
6465
];
65-
const searchCommand = `FT.SEARCH ${indexName} * LIMIT 0 20`;
66+
const searchCommand = `FT.SEARCH "${indexName}" "Apple Juice"`;
6667
//Send commands
6768
await workbenchPage.sendCommandInWorkbench(commandsForSend.join('\n'));
6869
//Run automatically added FT.SEARCH script with edits
69-
await t.click(workbenchPage.preselectSearch);
70+
await t.click(workbenchPage.internalLinkWorkingWithHashes);
71+
await t.click(workbenchPage.preselectExactSearch);
7072
await t.pressKey('ctrl+a delete');
7173
await workbenchPage.sendCommandInWorkbench(searchCommand);
7274
//Check the FT.SEARCH result
@@ -75,7 +77,7 @@ test.skip('Verify that user can edit and run automatically added "Search" script
7577
await t.expect(key.exists).ok('The added key is in the Search result');
7678
await t.expect(name.exists).ok('The added key name field is in the Search result');
7779
});
78-
//skipped due the disabled default scripts area
80+
//skipped due the inaccessibility of the iframe
7981
test.skip('Verify that user can edit and run automatically added "Aggregate" script in Workbench and see the results', async t => {
8082
const aggregationResultField = 'max_price';
8183
const commandsForSend = [
@@ -87,7 +89,8 @@ test.skip('Verify that user can edit and run automatically added "Aggregate" scr
8789
//Send commands
8890
await workbenchPage.sendCommandInWorkbench(commandsForSend.join('\n'), 0.5);
8991
//Run automatically added FT.Aggregate script with edits
90-
await t.click(workbenchPage.preselectSearch);
92+
await t.click(workbenchPage.internalLinkWorkingWithHashes);
93+
await t.click(workbenchPage.preselectGroupBy);
9194
await t.pressKey('ctrl+a delete');
9295
await workbenchPage.sendCommandInWorkbench(searchCommand);
9396
//Check the FT.Aggregate result

tests/e2e/tests/regression/database/logical-databases.e2e.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,5 @@ test('Verify that if user enters any index of the logical database that does not
3636
await t.typeText(cliPage.cliCommandInput, 'Select 19', { paste: true });
3737
await t.pressKey('enter');
3838
//Verify the error
39-
await t.expect(cliPage.cliOutputResponseFail.textContent).eql('ERR DB index is out of range', 'Error is dispalyed in CLI');
39+
await t.expect(cliPage.cliOutputResponseFail.textContent).eql('"ERR DB index is out of range"', 'Error is dispalyed in CLI');
4040
});

0 commit comments

Comments
 (0)