cypress-autorecord
cypress-autorecord copied to clipboard
Why not allow specific config on per test basis?
I am new to this plugin, just wondering why not allow tests to set their own patterns and config? I frequently find myself going back to the config to adjust config just for certain tests, of which I don't want adjusting for globally.
ie:
const autoRecord = require('cypress-autorecord'); // Require the autorecord function
describe('Test Articles Page', function() { // Do not use arrow functions
autorecord( {
interceptPattern: "**/api/v1/items/articles/**",
// forceRecord: true,
// cleanMocks: true,
});
// Your hooks (beforeEach, afterEach, etc) goes here
it('...', function() { // Do not use arrow functions
// Your test goes here
});
});
This:
- makes it clearer what's going on in that particular test
- allows config to be specific to the test case only
- allows one to forceRecord / clear mocks on demand for specific test
- makes everything easier to maintain by separating actual plugin config from tests (I don't want to change configuration only to revert it back because I am working on a particular test I need to recapture data for)
and yes, I have not looked into the source to determine the possibility of this, however, I believe this is a more clearer and more efficient manner to do this.