4 The blackbox driver assumes no privileged access to the site. You can run the
5 tests on a local or remote server, and all the actions will take place through
6 the site's user interface. This driver was enabled as part of the installation
7 instructions by lines 13 and 14, highlighted below.
9 .. literalinclude:: _static/snippets/behat-bb.yml
13 :emphasize-lines: 13-14
18 It may be really important that a block is in the correct region, or you may
19 have a link or button that doesn't have a unique label. The blackbox driver
20 allows you to create a map between a CSS selector and a user-readable region
21 name so you can use steps like the following without having to write any custom
25 I press "Search" in the "header" region
26 I fill in "a value" for "a field" in the "content" region
27 I fill in "a field" with "Stuff" in the "header" region
28 I click "About us" in the "footer" region
33 A stock Drupal 7 installation has a footer area identified by the CSS Id
34 "footer". By editing the behat.yml file and adding lines 15 and 16 below:
36 .. literalinclude:: _static/snippets/behat-bb.yml
39 :emphasize-lines: 15-16
41 You can use a step like the following without writing any custom PHP::
43 When I click "About us" in the "footer" region.
46 Using the blackbox driver configured with the regions of your site, you can
47 access the following region-related steps:
50 These examples won't work unless you define the appropriate regions in
53 .. literalinclude:: _static/snippets/blackbox.feature
61 The Drupal Extension makes use of three selectors for message. If your CSS
62 values are different than the defaults (shown below), you'll need to update
69 Drupal\DrupalExtension:
71 message_selector: '.messages'
72 error_message_selector: '.messages.messages-error'
73 success_message_selector: '.messages.messages-status'
75 Message-related steps include:
77 .. literalinclude:: _static/snippets/blackbox.feature
85 The Drupal Extension relies on default text for certain steps. If you have
86 customized the label visible to users, you can change that text as follows:
90 Drupal\DrupalExtension:
94 password_field: "Enter your password"
95 username_field: "Nickname"