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.

  1. 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" | 
  1. setup variable flag , set false.

  2. create tagged before hook @mandatory tag. in set flag variable true.

  3. 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

Popular posts from this blog

php - Permission denied. Laravel linux server -

google bigquery - Delta between query execution time and Java query call to finish -

python - Pandas two dataframes multiplication? -