Log out as a person does: the "Log out" link of the user menu (opened first when the skin folds it), else the link wherever the skin puts it, else the logout page's own button. The step waits for the wiki to end the session.
Examples
When I log out
When we log out
And I log out
Then I log out
Given I log out
Pattern
When(/^(I |we )*log out$/, …)
Part of @webship-js/mediawiki-steps (github.com/webship/mediawiki-steps), a step pack for Webship-js 2.0.x.