Set the time range of the open page (a dashboard, Explore) to one of its quick ranges, by the words the time picker shows ("Last 24 hours"); wait for the toolbar to say it.
Examples
When I set the time range to "Last 24 hours"
When we set the time range to "Last 7 days"
And I set the time range to "Last 1 hour"
Given I set the time range to "Last 6 hours"
When I set the time range to "Last 30 days"
Pattern
When(/^(?:I |we )?set the time range to "([^"]*)"$/, …)
Part of @webship-js/grafana-steps (github.com/webship/grafana-steps), a step pack for Webship-js 2.0.x.