Group the records by an entry of "Group By" in the search options. The entry is a toggle: grouping by an entry that is on removes the grouping.
Examples
When I group the records by "Salesperson"
When we group the records by "Stage"
And I group the records by "Customer"
When I group the records by "Country"
And we group the records by "Sales Team"
Pattern
When(/^(I |we )*group the records by "([^"]*)"$/, …)
Part of @webship-js/odoo-steps (github.com/webship/odoo-steps), a step pack for Webship-js 2.0.x.