I am using a Groovy script to check for a condition (if local) and skipping the next step if it is true. I am currently skipping it by name but I would prefer just to use the (calculated) step index in case the step name changes or the other non-skipped steps change order. In general, I want to avoid referencing steps by name in case of name changes.
Is there a way I can calculate the index of the step I am currently on to skip over the next step? Something like the following?
if(condition){
stepNum = context.getCurrentStep().index //--unsure how to do this
stepNum = stepNum+2
testRunner.gotoStep(stepNum)
}