typescript - 将值传递到量角器中黄瓜的不同步骤
问题描述
我需要使用量角器 Typescript 通用示例在黄瓜的步骤定义文件中将值从一个步骤传递到另一个步骤:
When('the user enters the value {string}', function() {
//code written to enter the value
})
Then('the user has entered the value')
{
// I need the value entered in the previous step to be validated here
}
解决方案
let inputText = ''
When('the user enters the value {string}', function(string) {
inputText = string
//code written to enter the value
})
Then('the user has entered the value', function() {
expect().to.xxx(inputText)
// I need the value entered in the previous step to be validated here
})
推荐阅读
- azure-cosmosdb - 将数组对象转换为小写以在 CosmosDB 查询中进行比较
- python - 为什么我的二进制搜索比线性搜索慢(python)
- r - R - 识别并删除在另一个矩阵中有重复的矩阵行
- docker - Docker COPY 成功但检查无文件
- postgresql - 使用 NestJS 和 TypeOrm,在我运行 NestJS 应用程序后不会自动创建表
- confluent-schema-registry - 如何忽略 kafka jdbc sink 连接器中的错误消息?
- winforms - 检索 MongoDB 文档时 ToList 期间的 ProgressBar
- excel - How to distinguish between a linear region and a quadratic region
- python - 忽略 csv 列 python/django
- android - 在 Android 上使用日历查找该月的最后一天