@@ -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,19 @@ 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
+ 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 ( ) ;
138
148
} ) ;
139
149
test
140
150
. meta ( { rte : rte . standalone } )
141
151
( 'Verify that user can type GRAPH. in Command helper and see auto-suggestions from RedisGraph commands.json' , async t => {
142
152
const commandForSearch = 'GRAPH.' ;
153
+ const externalPageLink = 'https://redis.io/commands/graph.config-get/' ;
143
154
//Open Command Helper
144
155
await t . click ( cliPage . expandCommandHelperButton ) ;
145
156
//Select group from list and remeber commands
158
169
for ( let i = 0 ; i < commandsCount ; i ++ ) {
159
170
await t . expect ( cliPage . cliHelperOutputTitles . nth ( i ) . textContent ) . eql ( graphCommands [ i ] , 'Results in the output contains searched value' ) ;
160
171
}
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 ( ) ;
161
177
} ) ;
0 commit comments