0
步驟之間傳遞參數我有多個示例場景輪廓看起來像這樣:中的行爲
Examples:
| country | type | number |
| Poland | An individual | - |
| Poland | Company | 8971660890 |
| Germany | An individual | - |
| France | Company | 92511490856 |
我想用這個例子,並把它傳遞給步驟定義之一,以創建條件表達式,例如:
@step(check_sth)
def step_imp(country, type, number):
if county == Poland:
do sth
elif type == individual:
do other thing
是否有可能在bahave?
但是我可以在不同的步驟中使用國家,類型和編號嗎?我有步驟:'「{type}」被選中「並且」{country}「被選中',我想在另一個步驟中使用country和type。 – Ewa
是的,您可以在相同的場景中重複使用它們。只需使用相同的參數定義另一個步驟。 –