I want to mock all images loading from site, I use mockRequest: I.mockRequest('ANY', 'https://codecept.io/img/*', 200);
But mocking not working for images. Example project: https://github.com/zerkalica/codecept-bug-demo. After npm install ; npm run test i see first page with images. Raw pollyjs npm run test:polly works as i expect.
By default, pollyjs mocks only xhr, fetch requests and it's documentation is not full. I can mock external image request by passing adapterOptions.requestResourceTypes: [ 'xhr', 'fetch', 'image' ] option to pollyjs config. But codecept MockRequest helper doesn't provide option for it.
After #2060 i can pass this option to pollyjs.
But latest npm codeceptjs version is 2.36 without this feature:
this.polly = new PollyJS(title, {
mode: 'passthrough',
adapters: ['puppeteer'],
adapterOptions: {
puppeteer: { page },
},
});
Can you deploy new package version?
PS: I waste some time with this problem. May be add issue about requestResourceTypes and image to codecept/MockRequest documentation?
I want to mock all images loading from site, I use mockRequest:
I.mockRequest('ANY', 'https://codecept.io/img/*', 200);But mocking not working for images. Example project: https://github.com/zerkalica/codecept-bug-demo. After
npm install ; npm run testi see first page with images. Raw pollyjsnpm run test:pollyworks as i expect.By default, pollyjs mocks only xhr, fetch requests and it's documentation is not full. I can mock external image request by passing
adapterOptions.requestResourceTypes: [ 'xhr', 'fetch', 'image' ]option to pollyjs config. But codecept MockRequest helper doesn't provide option for it.After #2060 i can pass this option to pollyjs.
But latest npm codeceptjs version is 2.36 without this feature:
Can you deploy new package version?
PS: I waste some time with this problem. May be add issue about requestResourceTypes and image to codecept/MockRequest documentation?