Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why not allow specific config on per test basis? #78

Open
emahuni opened this issue Jul 11, 2023 · 0 comments
Open

Why not allow specific config on per test basis? #78

emahuni opened this issue Jul 11, 2023 · 0 comments

Comments

@emahuni
Copy link

emahuni commented Jul 11, 2023

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.

@emahuni emahuni changed the title Why allow specific config on per test basis? Why not allow specific config on per test basis? Jul 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant