stoplightio / desktop

The Stoplight desktop app + issues repository.
https://stoplight.io
78 stars 13 forks source link

Schedule each scenario step with delay #369

Closed Kapcash closed 5 years ago

Kapcash commented 5 years ago

Just wondering if it is possible to schedule scenario steps with some delay? I'm testing out some APIs that use dates and I can't find any way to delay the steps so that the sending date as timestamp isn't the same.

Should I use a before script and run something like setTimeout()? I can't manage to make it work, and it doesn't look like a proper solution, more like a workaround.

Any suggestion for that?

pytlesk4 commented 5 years ago

Just wondering if it is possible to schedule scenario steps with some delay? I'm testing out some APIs that use dates and I can't find any way to delay the steps so that the sending date as timestamp isn't the same.

Should I use a before script and run something like setTimeout()? I can't manage to make it work, and it doesn't look like a proper solution, more like a workaround.

Any suggestion for that?

Great question, try SL.sleep(ms) in a before script. Docs can be found here.

Kapcash commented 5 years ago

Work like a charm! Nevertheless, steps doesn't update their status (OK / Fail) until all of them finished. So we don't know where the scenario stops with that delay. But that is confort :) Thanks!