File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -733,7 +733,7 @@ module.exports.goto = async (
733733 options = { navigationTimeout : defaultConfig . navigationTimeout } ,
734734) => {
735735 validate ( ) ;
736- if ( ! / : \/ \/ / i. test ( url ) ) {
736+ if ( ! / ^ a b o u t : | : \/ \/ / i. test ( url ) ) {
737737 url = 'http://' + url ;
738738 }
739739 if ( options . headers ) {
Original file line number Diff line number Diff line change @@ -83,6 +83,20 @@ describe(test_name, () => {
8383 expect ( actualUrl ) . to . equal ( expectedUrl ) ;
8484 } ) ;
8585
86+ it ( 'should not add protocol http:// if url is "about:*"' , async ( ) => {
87+ let aboutBlank = 'about:randomString' ;
88+ let expectedUrl = aboutBlank ;
89+ await taiko . goto ( aboutBlank ) ;
90+ expect ( actualUrl ) . to . equal ( expectedUrl ) ;
91+ } ) ;
92+
93+ it ( 'should add protocol http:// for url with port specified' , async ( ) => {
94+ let urlWithPort = 'localhost:8080' ;
95+ let expectedUrl = 'http://' + urlWithPort ;
96+ await taiko . goto ( urlWithPort ) ;
97+ expect ( actualUrl ) . to . equal ( expectedUrl ) ;
98+ } ) ;
99+
86100 it ( 'should configure provided headers for the domain' , async ( ) => {
87101 let options = {
88102 headers : { Authorization : 'Basic cG9zdG1hbjpwYXNzd29y2A==' } ,
You can’t perform that action at this time.
0 commit comments