I'd like to see this logic delegated to the page itself, so the step definitions remain descriptive and high-level.