When Before() and Before(‘@MyTag’) & When After() and After(‘@MyTag’) multiple times, can we ensure Before n After without tag will always called

In test case I saw multiple Before(@withSomeTag) and After(@withSomeTag) are used.

Example

Before(@withSomeTag1)

Before(@withSomeTag1)

Before()

After(@withSomeTag1)

After(@withSomeTag2)

After()

I want to open my resource in one Before and Close in After. But with multiple Before and After I’m confused. If I call

cucumber –tagĀ ‘@withSomeTag1,@withSomeTag2’
OR
cucumber –tagĀ ‘@withSomeTag1′,’@withSomeTag2’

Will it always call Before() and After() which do not have any tags associated with it ? I need this so that I don’t have to open and close my resource at multiple before and after tags

Add Comment
  • 0 Answer(s)
  • Your Answer

    By posting your answer, you agree to the privacy policy and terms of service.