Drupal.org

Create a step definition for Search buttons that excludes the sitewide search

Project:Drupal.org BDD
Component:Feature/Scenarios
Category:task
Priority:major
Assigned:ksbalajisundar
Status:closed (fixed)
Issue tags:sprint 2, sprint 4

Issue Summary

Problem/Motivation

(why the issue was filed, steps to reproduce the problem, etc.)
Behat's greedy matching means that the sitewide search seems to get found before the searches on all other pages, which makes us write extra step definitions each time that conflict arises. That's extra work we don't probably want to maintain.

Example URLs

The Views exposed filters at https://drupal.org/project/doobie and https://drupal.org/project/issues/doobie

Proposed resolution

(description of the proposed solution, the rationale behind it, and workarounds for people who cannot use the patch)
I have implemented a step to allow us to target the sitewide search
When I search sitewide for ""

I'm hoping that we could write a step that looks something like:
When I enter the term "" and press "" that excludes a match against the sitewide search's id tag.

If we include a comment beneath the step definition explaining the intent of the step it will appear with the -di output so people will undertand what it's intended for.

Comments

#1

Tagging for inclusion in sprint 2

#2

Assigned to:Anonymous» ksbalajisundar
Status:active» needs work

#3

Status:needs work» needs review

Attached is the patch file for the above step definition. The patch contains a sample feature that calls the step. The new step definition is like this:

When I fill in "doobie" for "Search for"
And I press "Search" in the "content" region
Then .............

Someone please review and let me know your thoughts.

AttachmentSize
doobie-search-button-1704922-2.patch 4.17 KB

#4

Status:needs review» needs work

I was thinking of something more generic even than this, but as soon as I looked at the label-less search field on the issue sidebar, I think your strategy here is the right approach for now. Thanks for taking this forward.

Unfortunately, the patch isn't applying cleanly:

error: while searching for:
  }else
    throw new Exception("No options/texts specified");
  }
}

#5

Status:needs work» needs review

Here's the updated patch.

AttachmentSize
doobie-search-testing-1704922-4.patch 3.98 KB

#6

Status:needs review» fixed

Committed, thanks!

#7

Issue tags:+sprint 4

tagging for sprint 4

#8

Status:fixed» closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.