Sort the index by an attribute of its "View" menu, in ascending or descending order.
Examples
When I sort the index by "Title" in "ascending" order
When I sort the index by "Post Date" in "descending" order
When we sort the index by "Date Created" in "ascending" order
And I sort the index by "Slug" in "descending" order
When I sort the index by "Filename" in "ascending" order
Pattern
When(/^(I |we )*sort the index by "([^"]*)" in "(ascending|descending)" order$/, …)
Part of @webship-js/craft-cms-steps (github.com/webship/craft-cms-steps), a step pack for Webship-js 2.0.x.