gpt4 book ai didi

cucumber - 功能文件中是否提供其他概念(小 cucumber 语言)?

转载 作者:行者123 更新时间:2023-12-04 16:59:40 26 4
gpt4 key购买 nike

无论如何,我们可以在特征文件中使用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

最佳答案

不是我知道的。但是,小 cucumber (和 cucumber )在指定谨慎的业务案例时最好使用,并且应该是可重复的,否则它们将难以遵循和测试。看来您至少有两个故事:

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

关于cucumber - 功能文件中是否提供其他概念(小 cucumber 语言)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30233391/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com