Codeceptjs playright mocking network request

224 Views Asked by At
I.mockRoute('/api/**', route => {
  if (route.request().postData().includes('my-string'))
    route.fulfill({ body: 'mocked-data' });
  else
    route.continue();
});

Command is not mocking with correct route. I copied route from network tab.but data is not loading in front end.I think 1) I am mocking it with wrong path. 2)in Application I use fetch so in network tab it is not showing req type... 3) If anyone have ref code please share

0

There are 0 best solutions below