1

下面是我想在另一个场景中执行一个场景的示例。有没有办法做到这一点?

Scenario: scenario-A
   Create an object obj-A
   Read  'key1' from the object obj-A

Scenario: scenario-B
   Step1: Create an object obj-B
   Step2: Read 'key2' from obj-B
   Step3: # I want to execute scenario-A here. This gives me value of 'key-1'
   Step4: Perform an operation using 'key1' and 'key2'
4

1 回答 1

0

用于context.execute_steps()从另一个步骤中重建您的场景或其中的一部分。我认为让您的第二个场景更加精简并专注于您正在测试的任何内容是值得的,但要小心未来的维护。

于 2019-02-15T10:14:18.973 回答