我目前正在將機(jī)器人框架用于具有 Gherkin 語(yǔ)言策略(Given When Then)的項(xiàng)目。我的特征文件如下:*** Settings ***Documentation... In Order to eat a dessert safely, ... As a king... I want to not take a lethal dessert Library eat_or_pass.Eat_or_pass*** Test cases ***Lethal Dessert [Template] The result of ${hungriness} should be ${dessert} very hungry apple pie hungry biscuit not very hungry apple*** Keywords ***The result of ${hungriness} should be ${dessert} Given the king is ${hungriness} Then the related dessert is ${dessert}我想將關(guān)鍵字“ Given the king is ${hungriness}” 鏈接到 Python 模塊 Eat_or_pass.py 中包含的 Python 定義,該模塊當(dāng)前實(shí)現(xiàn)如下:class Eat_or_pass(object):def given_the_king_is_hungriness(self): pass當(dāng)我運(yùn)行機(jī)器人框架時(shí),出現(xiàn)以下錯(cuò)誤:“致命甜點(diǎn) | 失敗 | 未找到名為 'Given the king is ${hungriness}' 的關(guān)鍵字。” 我不知道如何解決它。有沒(méi)有人可以幫助我解決這個(gè)問(wèn)題?
在機(jī)器人框架內(nèi)定義包含變量的關(guān)鍵字
慕桂英3389331
2021-08-17 16:25:03