@@ -2,6 +2,8 @@ import { rte } from '../../../helpers/constants';
22import { acceptLicenseTermsAndAddDatabase , deleteDatabase } from '../../../helpers/database' ;
33import { CliPage } from '../../../pageObjects' ;
44import { commonUrl , ossStandaloneConfig } from '../../../helpers/conf' ;
5+ import { ClientFunction } from 'testcafe' ;
6+ import { lowerCase } from 'lodash' ;
57
68const cliPage = new CliPage ( ) ;
79
@@ -10,6 +12,7 @@ const COMMAND_APPEND = 'APPEND';
1012const COMMAND_GROUP_SET = 'Set' ;
1113const COMMAND_GROUP_TIMESERIES = 'TimeSeries' ;
1214const COMMAND_GROUP_GRAPH = 'Graph' ;
15+ const getPageUrl = ClientFunction ( ( ) => window . location . href ) ;
1316
1417fixture `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 } ) ;
139147test
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
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