@@ -1014,16 +1014,24 @@ def skip_step(self, step):
1014
1014
self .step (step )
1015
1015
self .mark_current_step_skipped ()
1016
1016
1017
- def skip_all_remaining_steps (self , starting_step ):
1017
+ def skip_all_remaining_steps (self , starting_step_number ):
1018
1018
''' Skips all remaining test steps starting with provided starting step
1019
1019
1020
- starting_step must be provided, and is not derived intentionally. By providing argument
1020
+ starting_step_number gives the first step to be skipped, as defined in the TestStep.test_plan_number
1021
+ starting_step_number must be provided, and is not derived intentionally. By providing argument
1021
1022
test is more deliberately identifying where test skips are starting from, making
1022
1023
it easier to validate against the test plan for correctness.
1023
1024
'''
1024
- last_step = len (self .get_test_steps (self .current_test_info .name )) + 1
1025
- for index in range (starting_step , last_step ):
1026
- self .skip_step (index )
1025
+ steps = self .get_test_steps (self .current_test_info .name )
1026
+ for idx , step in enumerate (steps ):
1027
+ if step .test_plan_number == starting_step_number :
1028
+ starting_step_idx = idx
1029
+ break
1030
+ else :
1031
+ asserts .fail ("skip_all_remaining_steps was provided with invalid starting_step_num" )
1032
+ remaining = steps [starting_step_idx :]
1033
+ for step in remaining :
1034
+ self .skip_step (step .test_plan_number )
1027
1035
1028
1036
def step (self , step : typing .Union [int , str ]):
1029
1037
test_name = self .current_test_info .name
0 commit comments