Repository navigation
Expand file tree
/
Copy pathbehat.dist.php
More file actions
122 lines (116 loc) · 4.32 KB
/
Copy pathbehat.dist.php
File metadata and controls
122 lines (116 loc) · 4.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
<?php
/**
* Reference configuration setting every option 'BehatStepsExtension' declares.
*
* The 'steps' node carries example values for a selection of trait options.
*
* The suite in this repository runs from 'behat.php'. That file takes
* precedence, so Behat never loads this one here.
*/
declare(strict_types=1);
use Behat\Config\Config;
use Behat\Config\Extension;
use Behat\Config\Profile;
use Behat\Config\Suite;
use Behat\MinkExtension\Context\MinkContext;
use Behat\MinkExtension\ServiceContainer\MinkExtension;
use DrevOps\BehatSteps\Extension\ServiceContainer\BehatStepsExtension;
// 'FeatureContext' is the project's own context, which extends
// 'DrupalContext'. A shipped context registered beside it registers every
// web step twice.
$suite = (new Suite('default'))
->withPaths('%paths.base%/tests/behat/features')
->addContext(FeatureContext::class)
->addContext(MinkContext::class);
$profile = (new Profile('default', ['autoload' => ['%paths.base%/tests/behat/bootstrap']]))
->withSuite($suite)
->withExtension(new Extension(MinkExtension::class, [
'base_url' => 'http://your-site.local',
'files_path' => '%paths.base%/tests/behat/fixtures',
'browser_name' => 'chrome',
'javascript_session' => 'selenium2',
'sessions' => [
'browserkit_http' => ['browserkit_http' => NULL],
'selenium2' => ['selenium2' => ['wd_host' => 'http://localhost:4444/wd/hub']],
],
]))
->withExtension(new Extension(BehatStepsExtension::class, [
// The list is both the allow-list and the precedence order: a step
// resolves the first backend here that provides the capability it needs.
'backends' => ['drupal', 'drush', 'blackbox'],
'login_field' => 'name',
'login_wait' => 0,
'blackbox' => NULL,
'drupal' => [
'drupal_root' => 'web',
// A class such as AcmeCore::class replaces the Core the package ships
// for the site's Drupal major.
'core' => NULL,
// A 'field_handlers' entry such as 'rating' => RatingHandler::class adds
// a handler for a field type or replaces a shipped one.
'field_handlers' => [],
// A 'creation_aliases' entry such as OrganizationAlias::class adds a
// creation alias or replaces the shipped one with the same name.
'creation_aliases' => [],
],
'drush' => [
'alias' => 'self',
'binary' => 'vendor/bin/drush',
'root' => 'web',
'global_options' => '--uri=http://your-site.local',
// A class such as AcmeCommands::class replaces the commands the package
// ships for the detected Drush major.
'commands' => NULL,
'creation_aliases' => [],
],
// With 'strict' set, an experimental fallback throws the failure it would
// otherwise absorb.
'experimental' => [
'strict' => FALSE,
],
'text' => [
'login_url' => '/user',
'logout_url' => '/user/logout',
'logout_confirm_url' => '/user/logout/confirm',
'login' => 'Log in',
'logout' => 'Log out',
'username_field' => 'Username',
'password_field' => 'Password',
],
'selectors' => [
'login_form_selector' => 'form#user-login,form#user-login-form',
'logged_in_selector' => 'body.logged-in,body.user-logged-in',
],
'regions' => [
'content' => '#content',
'sidebar' => '#sidebar',
'footer' => '#footer',
],
// Example values of the options the step traits declare, keyed by trait
// group. STEPS.md lists every group and option.
'steps' => [
'accessibility' => ['sitemap_path' => '/sitemap.xml', 'sitemap_max_depth' => -1, 'sitemap_limit' => 0],
'browser_time' => ['enabled' => TRUE],
'entity' => ['enabled' => TRUE],
'javascript' => ['enabled' => TRUE, 'fail_on_errors' => TRUE],
'watchdog' => ['enabled' => TRUE, 'fail_on_errors' => TRUE],
'wait' => ['ajax_timeout' => 5],
'message' => [
'selectors' => [
'default' => '.messages',
'error' => '.messages.messages--error',
'success' => '.messages.messages--status',
'warning' => '.messages.messages--warning',
],
],
'mapping' => [
'groups' => [
'paths' => [
'User Login' => '/user/login',
'User Registration' => '/user/register',
],
],
],
],
]));
return (new Config())->withProfile($profile);