rspec - cucumber Scenario Outlines: how to skip step for one scenario -
i have strange situation have 2 examples. , have 1 step fill mandatory fields of user form
need execute 1 example ("scope_self"). other should not run.
is there way achieve this
examples: | action | | "scope_self" | | "scope_new" |
it easier option create separate scenario mandatory step. cleaner implementation.
anyways, there way work in same scenario outline.
- split examples table two. give first table
@mandatory
tag has one example ("scope_self").
scenario outline: given ............ when ............. ............. @mandatory examples: | action | | "scope_self" | examples: | action | | "scope_new" |
setup variable flag , set false.
create tagged before hook @mandatory tag. in set flag variable true.
in step definition code mandatory option check if flag variable set true or false. if true run remaining code else skip return.
i basing java should work in rspec...
Comments
Post a Comment