I know pytest-bdd can use pytest scope(function/module/package/session) by define a fixture by using scope="module", but this scope is belong to step file? i'm not really sure about this
But how to apply scope(like package) to a feature file
For example, i have a feature definition like below
Feature: feature one
Background:
# My requirement is that execute this step once when I run two scenarios: a and b.
# how to apply this?
Given step executed only once for both a and b
Scenario: scenario a
When sleep one second
Scenario: scenario b
When sleep one second
My requirement is that the Given step step executed only once for both a and b will only be executed only once when I run the two scenarios a and b. Can this requirement be met?
I know pytest-bdd can use pytest scope(function/module/package/session) by define a fixture by using scope="module", but this scope is belong to step file? i'm not really sure about this But how to apply scope(like package) to a feature file
For example, i have a feature definition like below
My requirement is that the
Given
stepstep executed only once for both a and b
will only be executed only once when I run the two scenarios a and b. Can this requirement be met?