Forum Discussion

naveens33_'s avatar
naveens33_
Contributor
2 years ago

How to skip the BDD test

How to skip the BDD test.

 

I have 2 scenarios below. I want Scenario2 should be Skipped. 

Feature: Check the User Profile settings
    Check all the ways to open the settings form.
    Check the edit features.

Scenario: Scenario1
 Given The tested app is running
 And The Login form is on screen
 When I enter JohnSmith in the Name edit box
 And I enter no password
 And I click Sign In
 Then I should see 'Hi, John Smith' in the toolbar

Scenario: Scenario2
 Given The tested app is running
 And The Login form is on screen
 When I enter JohnSmith in the Name edit box
 And I enter no password
 And I click Sign In
 Then I should see 'Hi, John Smith' in the toolbar

Can anyone please help with this.  

5 Replies

  • Marsha_R's avatar
    Marsha_R
    Champion Level 3

    Do you want to skip it always or for some particular condition?

  • Both the cases, I need the solution for -> skip it always and also for some particular condition

  • Stacy4554's avatar
    Stacy4554
    New Contributor

    You can use predefined "@skip" tag for the scenarios or features that you would like to skip and behave will automatically skip testing the scenario or the whole feature

    • naveens33_'s avatar
      naveens33_
      Contributor

      Does TestComplete use behave. Because, I have used "@skip" tag but still the test not skipped. 
      please find the below screenshot

  • Kitt's avatar
    Kitt
    Regular Contributor

    Each scenario should test one thing and fail for one particular reason. This means there should be no reason to skip steps.

     

    If there does seem to be a reason you’d want to skip steps conditionally, you probably have an anti-pattern. For instance, you might be trying to test multiple things in one scenario or you might not be in control of the state of your test environment or test data.

     

    The best thing to do here is to fix the root cause. [Gherkin Reference]