Skip to content

Commit db25013

Browse files
Merge pull request #558 from RedisInsight/feature/e2e-command-helper-urls
e2e - command helper urls
2 parents 42f606f + f81f5bd commit db25013

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

tests/e2e/tests/critical-path/cli/cli-command-helper.e2e.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ import { rte } from '../../../helpers/constants';
22
import { acceptLicenseTermsAndAddDatabase, deleteDatabase } from '../../../helpers/database';
33
import { CliPage } from '../../../pageObjects';
44
import { commonUrl, ossStandaloneConfig } from '../../../helpers/conf';
5+
import { ClientFunction } from 'testcafe';
6+
import { lowerCase } from 'lodash';
57

68
const cliPage = new CliPage();
79

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

1417
fixture `CLI Command helper`
1518
.meta({ type: 'critical_path' })
@@ -135,11 +138,17 @@ test
135138
for(let i = 0; i < commandsCount; i++){
136139
await t.expect(cliPage.cliHelperOutputTitles.nth(i).textContent).eql(timeSeriesCommands[i], 'Results in the output contains searched value');
137140
}
141+
//Check first command documentation url
142+
await t.click(cliPage.cliHelperOutputTitles.withExactText(timeSeriesCommands[0]));
143+
await t.click(cliPage.readMoreButton);
144+
await t.expect(getPageUrl()).eql(`https://redis.io/commands/${timeSeriesCommands[0].toLowerCase()}/`, 'The opened page');
145+
await t.switchToParentWindow();
138146
});
139147
test
140148
.meta({ rte: rte.standalone })
141149
('Verify that user can type GRAPH. in Command helper and see auto-suggestions from RedisGraph commands.json', async t => {
142150
const commandForSearch = 'GRAPH.';
151+
const externalPageLink = 'https://redis.io/commands/graph.config-get/';
143152
//Open Command Helper
144153
await t.click(cliPage.expandCommandHelperButton);
145154
//Select group from list and remeber commands
@@ -158,4 +167,9 @@ test
158167
for(let i = 0; i < commandsCount; i++){
159168
await t.expect(cliPage.cliHelperOutputTitles.nth(i).textContent).eql(graphCommands[i], 'Results in the output contains searched value');
160169
}
170+
//Check first command documentation url
171+
await t.click(cliPage.cliHelperOutputTitles.withExactText(graphCommands[0]));
172+
await t.click(cliPage.readMoreButton);
173+
await t.expect(getPageUrl()).eql(externalPageLink, 'The opened page');
174+
await t.switchToParentWindow();
161175
});

0 commit comments

Comments
 (0)