无论如何,我们可以在功能文件中使用 if/else 概念吗?例如:
Scenario: User should be able to check login page
Given I am on login page
When I click on SignIn button
Then I should be in home page
If yes
Then I will create a new profile
Else
Then I will logout from page
据我所知,情况并非如此。小黄瓜(和黄瓜)最好在指定谨慎的业务案例时使用,并且应该是可重复的,否则它们很难遵循和测试。看起来你在这里至少有两个故事:
Scenario: A new user should be asked to sign in
Given I am a new user
And I navigate to the login page
When I click on SignIn button
I should not be able to get to the home page
Scenario: An existing user should be able to log in
Given I am an existing user
And I navigate to the login page
And I submit valid credentials
When I click on SignIn button
I should be taken to the home page
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)