Closed (fixed)
Project:
Behat Drupal Extension
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
20 Sep 2013 at 07:58 UTC
Updated:
19 Jun 2014 at 23:58 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
Vanille commentedHave attached a patch that adds a function to get the css selector for a region defined in the region_map.
Useful when you write your own step definitions that uses regions.
Comment #2
jhedstromThere's a method called
getRegion()that returns a region object. That method is currently marked private--would that be sufficient, or is there a use case for getting the name/css selector independently?Comment #3
skruf commentedWould be good if this method was defined as protected so we can use it in extending FeatureContext class.
Comment #4
jhedstromI made the method protected instead of private. Please re-open if an additional method is still needed. Thanks!
Comment #5
Vanille commentedThe use case I had can be solved with the change. Thanks.
Wanted a step definition to just test for the existence of a region without having to use the css selector in the step, ex: "Then I should see the region"
Would be nice to be able to define css selectors for elements also. Like in the "Business Selectors extension". Will create another issue on that.
Comment #9
justintilson commentedWould someone be willing to make the getRegion() method pubic? It fails to work when calling it from a SubContext (explained here - http://dspeak.com/drupalextension/subcontexts.html & http://docs.behat.org/guides/4.context.html#using-subcontexts):
return $this->getMainContext()->getRegion($region);
Fatal error: Call to protected method Drupal\DrupalExtension\Context\DrupalContext::getRegion() from context 'DesktopSubContext' in /Users/justin.tilson/Sites/wfmcom/tests-behat/context/DesktopSubContext.php on line 22
My SubContext based tests run fine when I change 'protected' to 'public'
Comment #10
jhedstrom@justintilson I just made this method public in the 1.0 branch and in master.