[英]How can I use radish with Pycharm to have behave step autocomplete
[英]How do I print a step variable in Radish test framework?
我想打印從蘿卜測試用例中的特征文件讀取的表和變量。
反正有打印變量嗎?
假設您已定義步驟(在您的問題中提供一些上下文 [代碼] 會很好),您有幾個選擇。 最終,您將需要使用正則表達式來識別變量的位置,然后將它們保存以備后用。
您的選擇是:
創建列表:
var_list = []
@step("I have the number {number:g}")
def have_number(step, number):
step.context.var_list.append(number)
或打印到文件:
world.OutputPath = world.dirname + "your_file_name_here.txt"
file = open(world.OutputPath,mode='w+', encoding="utf-8")
@step("I have the number {number:g}")
def have_number(step, number):
file.write(number)
file.close()
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.