BDD - Cucumber:是否可以仅对功能中的一种场景禁用后台逻辑?

byt*_*ian 6 bdd cucumber

在一个功能文件中有一个背景和几个场景,但现在需要一个与不必运行后台逻辑的相同功能相关的场景,是否可以仅禁用一个场景?

更新 - 添加示例:

Feature: Sign Up

  In order to access to protected parts of site
  A user
  Should sign up

  Background:
     Given I am on sign up page
     And I am not logged in

  Scenario: User sign up succesfully
    When I sign up with valid fields
    Then I should view dashboard page 

  Scenario: User altredy sign up
    When I sign up with altredy registred user e-mail
    Then I should view altredy sign up message and link to forgot password page

  Scenario: User try to sign up with missing/wrong data
    When I will try to sign up with missing/wrong data
    Then I should error message

  Scenario: User altredy sign in
    #here disable background
    Given I am logged in
    When I am on sign up page
    Then i should be redirect to dashboard page
Run Code Online (Sandbox Code Playgroud)

And*_*ite 1

我会完全删除背景条款——这是不必要的细节。如果没有它,你的场景就完全有意义。

您可以访问注册页面,并验证用户尚未登录,作为“当我使用有效字段注册时”步骤定义的一部分。