@@ -2,6 +2,8 @@ import { rte } from '../../../helpers/constants';
2
2
import { acceptLicenseTermsAndAddDatabase , deleteDatabase } from '../../../helpers/database' ;
3
3
import { CliPage } from '../../../pageObjects' ;
4
4
import { commonUrl , ossStandaloneConfig } from '../../../helpers/conf' ;
5
+ import { ClientFunction } from 'testcafe' ;
6
+ import { lowerCase } from 'lodash' ;
5
7
6
8
const cliPage = new CliPage ( ) ;
7
9
@@ -10,6 +12,7 @@ const COMMAND_APPEND = 'APPEND';
10
12
const COMMAND_GROUP_SET = 'Set' ;
11
13
const COMMAND_GROUP_TIMESERIES = 'TimeSeries' ;
12
14
const COMMAND_GROUP_GRAPH = 'Graph' ;
15
+ const getPageUrl = ClientFunction ( ( ) => window . location . href ) ;
13
16
14
17
fixture `CLI Command helper`
15
18
. meta ( { type : 'critical_path' } )
@@ -135,11 +138,17 @@ test
135
138
for ( let i = 0 ; i < commandsCount ; i ++ ) {
136
139
await t . expect ( cliPage . cliHelperOutputTitles . nth ( i ) . textContent ) . eql ( timeSeriesCommands [ i ] , 'Results in the output contains searched value' ) ;
137
140
}
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 ( ) ;
138
146
} ) ;
139
147
test
140
148
. meta ( { rte : rte . standalone } )
141
149
( 'Verify that user can type GRAPH. in Command helper and see auto-suggestions from RedisGraph commands.json' , async t => {
142
150
const commandForSearch = 'GRAPH.' ;
151
+ const externalPageLink = 'https://redis.io/commands/graph.config-get/' ;
143
152
//Open Command Helper
144
153
await t . click ( cliPage . expandCommandHelperButton ) ;
145
154
//Select group from list and remeber commands
158
167
for ( let i = 0 ; i < commandsCount ; i ++ ) {
159
168
await t . expect ( cliPage . cliHelperOutputTitles . nth ( i ) . textContent ) . eql ( graphCommands [ i ] , 'Results in the output contains searched value' ) ;
160
169
}
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 ( ) ;
161
175
} ) ;
0 commit comments