-
-
Notifications
You must be signed in to change notification settings - Fork 729
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
[Enhancement] Allow to use decorators and to filter what to run based on them #730
Comments
BTW, an alternative to use decorators would be passing an "option" object as argument to features or scenarios. Example: Feature( 'Feature 1', { importance: 9 } );
Scenario( 'Scenario 1', ( I ) => {
// body here
}, { importance: 6, slow: true } ); |
Hi @thiagodp, unfortunately, it impossible to use decorators on function, it works only on the // feature-1.js
@Feature('Feature 1', {importance: 9})
class MyCoolFeature{
@Scenario('Scenario 1', { importance: 6, slow: true })
someScenario(I) {
// scenario here
}
} or // feature-1.js
@Feature('Feature 1')
@importance(9)
class MyCoolFeature{
@Scenario('Scenario 1')
@importance(6)
@slow()
someScenario(I) {
// scenario here
}
} I support your suggestion for allowing decorators because more and more libraries supporting decorators(e.g. node-decorators, di-typescript, inversify-js) Use full links for decorators: |
Hi @vitalics, |
ES6 (a.k.a. ES2015) supports decorators. It would be very nice if CodeceptJS had its own decorators and we could use them for filtering the test cases to run.
This is specially needed for small applications with slow tests and, of course, medium-big applications - that have hundreds of tests.
Let's suppose that we have this:
We would have these decorators:
@slow
: indicates a slow test.@fast
: indicates a fast test.@importance( <number> )
: indicates the importance of a feature or a scenario, with a number varying from 1-10. The default importance of a feature or a scenario could be 5....and we also could do this:
codecept run --no-slow --min-feature-importance=7 --min-scenario-importance=6
I think it would benefit a lot of projects.
The text was updated successfully, but these errors were encountered: