Expand or collapse a category in the category tree of a category page, as a person does with its toggle. Expanding waits for the tree's own request (api.php action=categorytree) and for the list it brings.
Examples
When I expand the category "Test guides" in the category tree
When I collapse the category "Test guides" in the category tree
And we expand the category "Editing guides" in the category tree
When we collapse the category "Editing guides" in the category tree
When I expand the category "Test pages" in the category tree
Pattern
When(/^(I |we )*(expand|collapse) the category "([^"]*)" in the category tree$/, …)
Part of @webship-js/mediawiki-steps (github.com/webship/mediawiki-steps), a step pack for Webship-js 2.0.x.