- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有下图作为测试用例
] 1
在使用behave的时候,我们在写这样一个场景
Given When user is logged in to the platform
When user opens the settings window
Then user should see the following values
| Field | Value |
| Currency | Reported currency |
| Conversion Method | MI recommended |
| Magnitude | Millions (6) |
| Display Null Value As | SOA_Null |
| Function Options | Excluded from export |
| Dynamic Field Labels | Excluded from export |
我们现在正在迁移到 Pytest-BDD 而不是 Behave。但是我在 Pytest 中找不到对上述案例的支持。我浏览了 Pytest-BDD 文档,他们的支持是针对场景大纲的。
https://pytest-bdd.readthedocs.io/en/latest/
但我的案例不是场景大纲,因为我只需要运行一次这个场景,而不是迭代上面提到的字段值对
我也查看了 github,我能找到的最接近的是这个,但这似乎还没有被批准。
https://github.com/pytest-dev/pytest-bdd/pull/180
Pytest 是否支持以任何方式实现上述场景?是否有解决方法(如果不是直接的方法)来处理它?</p>
最佳答案
希望这有助于...
那么响应应该有以下属性:
| attr |
| id |
| activityId |
| activityName |
| activityType |
| processDefinitionId |
| processDefinitionUrl |
| processInstanceId |
| processInstanceUrl |
| executionId |
| taskId |
| calledProcessInstanceId |
| assignee |
| startTime |
| endTime |
| durationInMillis |
| tenantId |
Then verify response attribute values:
|attr | attr_value | path |
|activityId | endProcessSubmit | data[0].activityId |
|activityType | endEvent | data[0].activityType |
@then(parsers.parse ('response should have below attributes:\n{attr_table}'))
def verify_response_attributes(datatable,attr_table,query_historic_activity_instances):
query_data = query_historic_activity_instances.json()['data']
BaseTest.verify_tbl_attr(attr_table,query_data)
@then(parsers.parse('verify response attribute values:\n{attr_value_table}'))
def verify_response_attribute_values(datatable,attr_value_table,query_historic_activity_instances):
query_data = query_historic_activity_instances.json()
BaseTest.verify_tbl_attr_values(attr_value_table, query_data)
@staticmethod
def verify_tbl_attr_values(table_with_header,query_data):
# datatable = parse_str_table(attr_value_table)
list_attr=BaseTest.get_tbl_attr_values(table_with_header)
# for row in range(len(datatable.rows)):
# attr = list(datatable.rows[row].values())[0]
# attr_val = list(datatable.rows[row].values())[1]
# path = list(datatable.rows[row].values())[2]
for i in range(len(list_attr)):
attr = list_attr[i][0]
attr_val = list_attr[i][1]
path = list_attr[i][2]
for match in parse(path).find(query_data):
assert attr_val == match.value, "The expected %s and Actual %s for %s Dint match" % (
attr_val, match.value, attr)
@staticmethod
def get_tbl_attr_values(table_with_header):
datatable = parse_str_table(table_with_header)
list_attr_val = []
for row in range(len(datatable.rows)):
list_attr_val.append(list(datatable.rows[row].values()))
return list_attr_val
@staticmethod
def verify_tbl_attr(table_with_header,query_data):
list_attr = BaseTest.get_tbl_attr(table_with_header)
for i in range(len(query_data)):
for j in range(len(list_attr)):
assert list_attr[j] in query_data[i],"Response don't have %s" % list_attr[j]
@staticmethod
def get_tbl_attr(table_with_header):
datatable = parse_str_table(table_with_header)
list_attr = []
for row in datatable.rows:
for item in row:
list_attr.append(row[item])
return (list_attr)
@staticmethod
def verify_tbl_attr_by_column(table_with_header):
datatable = parse_str_table(table_with_header)
list_attr = []
for column in datatable.columns.values():
list_attr.append(column)
return (list_attr)
关于PyTest-BDD : Support for data tables without Scenario Outline,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55841009/
我收到多行错误,指出它有重复的类 Duplicate class android.support.v4.accessibilityservice.AccessibilityServiceInfoCom
我的项目昨天运行良好,今天却出现以下错误。请帮忙。 出了什么问题:无法解析配置“:app:debugCompileClasspath”的所有文件。 Could not find support-v4.
错误:配置项目“:app”时出现问题。 Could not find support-v4.jar (com.android.support:support-v4:24.0.0). Searched
我正在使用 react-native-webrtc 运行示例应用程序模块。我正在尝试在 android 中运行该应用程序,但出现这样的错误... * What went wrong: A probl
错误:配置项目“:app”时出现问题。 Could not find support-v4.jar (com.android.support:support-v4:24.0.0). Searched
我克隆了我的项目并使用 Android studio 打开,但构建失败并出现以下错误并且同一个项目在其他项目上运行良好。 出了什么问题:无法解析配置“:app:flavorUnsignedReleas
我正在运行示例应用程序......我正在使用 this模块.....但是我收到这样的错误... FAILURE: Build failed with an exception. * What went
我有一个 Ionic 项目,在升级到 OSx Mojave 后,出于某种原因不再构建。 该项目基于 Ionic 3 构建。 我有 Cordova CLI 7.0.0 当我运行时 ionic cordo
我有一个 Ionic 项目,在升级到 OSx Mojave 后,出于某种原因不再构建。 该项目基于 Ionic 3 构建。 我有 Cordova CLI 7.0.0 当我运行时 ionic cordo
添加 Android 平台(ionic cordova platform add android)后,我构建了我的 Ionic 项目(ionic cordova build android),但出现错
这个问题在这里已经有了答案: Manifest merger failed : Attribute application@appComponentFactory - Androidx (14 个答
关于我的 Gradle 文件中的以下“complie”: dependencies { compile 'com.android.support:support-v4:25.3.1' }
有些困惑。 我想更频繁地使用@supports 但是...我不关心浏览器如何看待它。希望您能说清楚,如果可以的话谢谢您。 如果浏览器本身不理解@supports,它如何计算@support 'not'
我刚刚升级到 Dart 2 和最新版本的 Flutter,现在我无法构建我的应用程序。我在互联网上环顾四周,但仍然不明白为什么会发生这种情况。 我得到的错误是: FAILURE: Build fail
我正在学习 Firebase,但由于以下错误而陷入困境: Error:Failed to resolve: com.android.support:customtabs:25.4.0 Error:Fa
我在构建本周时出于某种原因尝试使用Cordova进行项目时遇到问题: cordova build android gradle获取com.android.support:support alpha而不
对应的androidx是什么com.android.support:support-compat 的图书馆实现push notifications ? 他们说here它是 androidx 的一部分,
我正在尝试为我的应用设置插桩单元测试。并且我已根据以下开发者站点链接添加了依赖项。 https://developer.android.com/training/testing/unit-testin
当我想使用 Proguard 规则生成签名的 APK(发布)时,我收到了以下错误消息: Cannot find a version of 'com.android.support:support-an
这个问题在这里已经有了答案: Failed to resolve: com.android.support:appcompat-v7:26.0.0 (14 个答案) Failed to resolv
我是一名优秀的程序员,十分优秀!