Skip to content

Commit ca27b3e

Browse files
add urls verifications
1 parent f2954d3 commit ca27b3e

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

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

Lines changed: 16 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,19 @@ 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+
console.log(timeSeriesCommands[0].toLowerCase());
145+
146+
await t.expect(getPageUrl()).eql(`https://redis.io/commands/${timeSeriesCommands[0].toLowerCase()}/`, 'The opened page');
147+
await t.switchToParentWindow();
138148
});
139149
test
140150
.meta({ rte: rte.standalone })
141151
('Verify that user can type GRAPH. in Command helper and see auto-suggestions from RedisGraph commands.json', async t => {
142152
const commandForSearch = 'GRAPH.';
153+
const externalPageLink = 'https://redis.io/commands/graph.config-get/';
143154
//Open Command Helper
144155
await t.click(cliPage.expandCommandHelperButton);
145156
//Select group from list and remeber commands
@@ -158,4 +169,9 @@ test
158169
for(let i = 0; i < commandsCount; i++){
159170
await t.expect(cliPage.cliHelperOutputTitles.nth(i).textContent).eql(graphCommands[i], 'Results in the output contains searched value');
160171
}
172+
//Check first command documentation url
173+
await t.click(cliPage.cliHelperOutputTitles.withExactText(graphCommands[0]));
174+
await t.click(cliPage.readMoreButton);
175+
await t.expect(getPageUrl()).eql(externalPageLink, 'The opened page');
176+
await t.switchToParentWindow();
161177
});

0 commit comments

Comments
 (0)