-
-
Notifications
You must be signed in to change notification settings - Fork 192
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #467 from jhedstrom/466-configure-ajax-timeout
Allows AJAX timeout to be overridden.
- Loading branch information
Showing
13 changed files
with
80 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Change log | ||
|
||
All notable changes to this project will be documented in this file. | ||
|
||
The format is based on [Keep a Changelog](http://keepachangelog.com/) | ||
and this project adheres to [Semantic Versioning](http://semver.org/). | ||
|
||
## [Unreleased] | ||
|
||
### Added | ||
* [#467](https://github.com/jhedstrom/drupalextension/pull/467): Allows | ||
AJAX timeout to be overridden via an `ajax_timeout` parameter in `behat.yml`. | ||
In order to utilize this parameter, `Drupal\MinkExtension` should be specified | ||
in the `extensions` portion of `behat.yml` rather than `Behat\MinkExtension`. | ||
|
||
[Unreleased]: https://github.com/jhedstrom/drupalextension/compare/v4.0.0alpha2...HEAD |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
spec/Drupal/MinkExtension/ServiceContainer/MinkExtensionSpec.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?php | ||
|
||
namespace spec\Drupal\MinkExtension\ServiceContainer; | ||
|
||
use Behat\Testwork\ServiceContainer\Extension; | ||
use PhpSpec\ObjectBehavior; | ||
|
||
class MinkExtensionSpec extends ObjectBehavior | ||
{ | ||
function it_is_a_testwork_extension() | ||
{ | ||
$this->shouldHaveType(Extension::class); | ||
} | ||
|
||
function it_is_named_mink() | ||
{ | ||
$this->getConfigKey()->shouldReturn('mink'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
src/Drupal/MinkExtension/ServiceContainer/MinkExtension.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php | ||
|
||
namespace Drupal\MinkExtension\ServiceContainer; | ||
|
||
use Behat\MinkExtension\ServiceContainer\MinkExtension as BaseMinkExtension; | ||
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition; | ||
|
||
class MinkExtension extends BaseMinkExtension | ||
{ | ||
|
||
/** | ||
* Default wait time for AJAX to finish (in seconds). | ||
* | ||
* @var int | ||
*/ | ||
const AJAX_TIMEOUT = 5; | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function configure(ArrayNodeDefinition $builder) | ||
{ | ||
parent::configure($builder); | ||
|
||
// Add extended options. | ||
$builder-> | ||
children()-> | ||
scalarNode('ajax_timeout')-> | ||
defaultValue(static::AJAX_TIMEOUT)-> | ||
info(sprintf('Change the maximum time to wait for AJAX calls to complete. Defaults to %s seconds.', static::AJAX_TIMEOUT))-> | ||
end(); | ||
} | ||
} |