-
-
Notifications
You must be signed in to change notification settings - Fork 148
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
feature: option to customize mocha template #3
Comments
Could you explain a bit more what's the usecase here? Maybe an example of a different template/structure you would possibly like to use? |
I'd like to use a template that would gather the scenario's tags and skip the test if they don't match a specific list. |
I'm using an environment variable called |
Another use case I just found is adding my own Specifically, the app I'm testing stores the authentication token in a cookie. But because the template is rendering every step as a different test, Cypress is clearing the cookie after the login. So my solution was to add: beforeEach(function () {
Cypress.Cookies.preserveOnce('token',);
}); To the template, and that cookie is retained through the feature. |
@fcurella I'm thinking more about this.. is the cookie removed in between steps of a single scenario? or between separate scenarios? |
@lgandecki between steps, since each step is converted to a single test |
aside from the fact that it might be nice to have dynamic templates, I think preserving cookie and the local storage should be a default inside a scenario, what do you think? but we can have a temporary solution . This is not really usable if we clear cookies and local storage betwen every it :) |
Due to personal reasons, the previous maintainers of this package are stepping down and handing the reigns over to me, a long-time contributor to the project and a user of it myself. This is a responsibility I'm very excited about. Furthermore, I'd like to thank @lgandecki ++ for all the work that they've done so far. Read more about the transfer of ownership here. The repository has however moved and all outstanding issues are being closed. This is not a reflection of the perceived importance of your reported issue. However, if after upgrading to the new version, you still find there to be an issue, feel free to open up another ticket or comment below. Please make sure to read CONTRIBUTING.md before doing so. |
right now the
.feature
files gets converted to a mocha test using a hardcoded template. Would be nice if we could pass an option to the preprocessor to override the templateThe text was updated successfully, but these errors were encountered: