@@ -1022,7 +1022,7 @@ describe('Playwright', function () {
10221022 describe ( '#mockRoute, #stopMockingRoute' , ( ) => {
10231023 it ( 'should mock a route' , async ( ) => {
10241024 await I . amOnPage ( '/form/fetch_call' )
1025- await I . mockRoute ( 'https ://reqres.in /api/comments/1' , route => {
1025+ await I . mockRoute ( 'http ://localhost:3001 /api/comments/1' , route => {
10261026 route . fulfill ( {
10271027 status : 200 ,
10281028 headers : { 'Access-Control-Allow-Origin' : '*' } ,
@@ -1032,7 +1032,7 @@ describe('Playwright', function () {
10321032 } )
10331033 await I . click ( 'GET COMMENTS' )
10341034 await I . see ( 'this was mocked' )
1035- await I . stopMockingRoute ( 'https ://reqres.in /api/comments/1' )
1035+ await I . stopMockingRoute ( 'http ://localhost:3001 /api/comments/1' )
10361036 await I . click ( 'GET COMMENTS' )
10371037 await I . see ( 'data' )
10381038 await I . dontSee ( 'this was mocked' )
@@ -1041,9 +1041,9 @@ describe('Playwright', function () {
10411041
10421042 describe ( '#makeApiRequest' , ( ) => {
10431043 it ( 'should make 3rd party API request' , async ( ) => {
1044- const response = await I . makeApiRequest ( 'get' , 'https ://reqres.in /api/users?page=2' )
1045- expect ( response . status ( ) ) . to . equal ( 200 )
1046- expect ( await response . json ( ) ) . to . include . keys ( [ 'page ' ] )
1044+ const response = await I . makeApiRequest ( 'get' , 'http ://localhost:3001 /api/users?page=2' )
1045+ expect ( response . status ( ) ) . to . equal ( 200 )
1046+ expect ( await response . json ( ) ) . to . include . keys ( [ 'data ' ] )
10471047 } )
10481048
10491049 it ( 'should make local API request' , async ( ) => {
@@ -1054,10 +1054,10 @@ describe('Playwright', function () {
10541054 it ( 'should convert to axios response with onResponse hook' , async ( ) => {
10551055 let response
10561056 I . config . onResponse = resp => ( response = resp )
1057- await I . makeApiRequest ( 'get' , 'https ://reqres.in /api/users?page=2' )
1058- expect ( response ) . to . be . ok
1059- expect ( response . status ) . to . equal ( 200 )
1060- expect ( response . data ) . to . include . keys ( [ 'page' , 'total '] )
1057+ await I . makeApiRequest ( 'get' , 'http ://localhost:3001 /api/users?page=2' )
1058+ expect ( response ) . to . be . ok
1059+ expect ( response . status ) . to . equal ( 200 )
1060+ expect ( response . data ) . to . include . keys ( [ 'data ' ] )
10611061 } )
10621062 } )
10631063
0 commit comments