[英]How to deal with iteration/looping in Python behave or BDD Scenarios in general?
[英]how to run same set of scenarios in 2 backgrounds in behave python
我的登录页面有 2 个背景 1) 用户接受 cookie 2) 用户拒绝 cookies。
Feature:ORG_LOGIN|Login action with organization ID after accepting cookies
Background:
Given User is on login page
When user accepts the cookies
And User navigates to organization tab
And clicks on password eye
# @positive
# Scenario:Login with valid credentials
# When User enters valid Organization ID, username and password
# And hits Login button
# Then Dashboard page is displayed
在此之后,需要测试同一组场景(8 个)。
我正在使用 behave 1.2.6 和 python 3.11.0 和 selenium 4.6.0
Since there can be only 1 background per feature file, I tried copying all scenarios into another feature file with different background. I get following error
behave.step_registry.AmbiguousStep: @given('User is on login page') has already been defined in existing step @given('User is on login page') at steps/login_ac.py:8
任何想法我该如何实施。
我通过删除步骤的重复实现来解决它。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.