Press the friendship button of the member's profile that is open ("Add Friend", "Cancel Friendship Request", "Cancel Friendship") and wait for its new state. The two accounts come back as they were when the scenario ends.
Examples
When I press "Add Friend" on the profile
And I press "Cancel Friendship Request" on the profile
When we press "Cancel Friendship" on the profile
And I press "Add Friend" on the profile
When I press "Cancel Friendship" on the profile
Pattern
When(/^(I |we )*press "(Add Friend|Cancel Friendship Request|Cancel Friendship)" on the profile$/, …)
Part of @webship-js/buddypress-steps (github.com/webship/buddypress-steps), a step pack for Webship-js 2.0.x.