Skip to content
Merged
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
14 changes: 14 additions & 0 deletions tests/e2e/tests/critical-path/cli/cli-command-helper.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import { rte } from '../../../helpers/constants';
import { acceptLicenseTermsAndAddDatabase, deleteDatabase } from '../../../helpers/database';
import { CliPage } from '../../../pageObjects';
import { commonUrl, ossStandaloneConfig } from '../../../helpers/conf';
import { ClientFunction } from 'testcafe';
import { lowerCase } from 'lodash';

const cliPage = new CliPage();

Expand All @@ -10,6 +12,7 @@ const COMMAND_APPEND = 'APPEND';
const COMMAND_GROUP_SET = 'Set';
const COMMAND_GROUP_TIMESERIES = 'TimeSeries';
const COMMAND_GROUP_GRAPH = 'Graph';
const getPageUrl = ClientFunction(() => window.location.href);

fixture `CLI Command helper`
.meta({ type: 'critical_path' })
Expand Down Expand Up @@ -135,11 +138,17 @@ test
for(let i = 0; i < commandsCount; i++){
await t.expect(cliPage.cliHelperOutputTitles.nth(i).textContent).eql(timeSeriesCommands[i], 'Results in the output contains searched value');
}
//Check first command documentation url
await t.click(cliPage.cliHelperOutputTitles.withExactText(timeSeriesCommands[0]));
await t.click(cliPage.readMoreButton);
await t.expect(getPageUrl()).eql(`https://redis.io/commands/${timeSeriesCommands[0].toLowerCase()}/`, 'The opened page');
await t.switchToParentWindow();
});
test
.meta({ rte: rte.standalone })
('Verify that user can type GRAPH. in Command helper and see auto-suggestions from RedisGraph commands.json', async t => {
const commandForSearch = 'GRAPH.';
const externalPageLink = 'https://redis.io/commands/graph.config-get/';
//Open Command Helper
await t.click(cliPage.expandCommandHelperButton);
//Select group from list and remeber commands
Expand All @@ -158,4 +167,9 @@ test
for(let i = 0; i < commandsCount; i++){
await t.expect(cliPage.cliHelperOutputTitles.nth(i).textContent).eql(graphCommands[i], 'Results in the output contains searched value');
}
//Check first command documentation url
await t.click(cliPage.cliHelperOutputTitles.withExactText(graphCommands[0]));
await t.click(cliPage.readMoreButton);
await t.expect(getPageUrl()).eql(externalPageLink, 'The opened page');
await t.switchToParentWindow();
});