Hello all.
Wondering if anyone else has solved this.
Some websites (including the intranet app I am working on) have a form
in
the top corner of the site that is buttonless. If you focus on this form
enter text and hit enter, it submits. usually used for quick search
boxes.
Question, has anyone managed to tie that into a cucumber feature?
Scenario: Using the quick search box
Given I am logged in
And I visit the home page
And there is someone called ‘Bob S.’ to search for
When I put ‘Bob S.’ into the quick search box
And I hit enter
Then I should be shown the search results page
And there should be ‘Bob S.’ on the page
Question, has anyone managed to tie that into a cucumber feature?
it’s the ‘And I hit enter’ that is bugging me
WDYT?
I agree with Matt. Unless it was really really really important to the
customer how the thing was submitted I wouldn’t try to automate the
pressing of the enter button in the browser. I would more or less
just say what I was doing rather than how I was doing it. I might end
up with:
Given I’m a logged in user at the home page
And there is someone called ‘Bob S.’ to earch for
When I do a quick search for ‘Bob S.’
Then I should see that ‘Bob S.’ is found in the search results
If you’re wondering how you submit the quick search (since it has no
button) then here’s a suggestion that Ben M. gave me back in
September: use tags to have a button on the page that
Webrat can submit, but that the browser won’t render.