mirror of
https://github.com/silverstripe/silverstripe-behat-extension
synced 2024-10-22 17:05:32 +02:00
Merge pull request #189 from open-sausages/pulls/4/smarter-stepIPressTheButton
BUG Update stepIPressTheButton to accept a list of button names separated by |
This commit is contained in:
commit
bd4a737833
@ -1,6 +1,6 @@
|
||||
language: php
|
||||
|
||||
dist: precise
|
||||
dist: xenial
|
||||
|
||||
sudo: false
|
||||
|
||||
@ -29,7 +29,7 @@ before_script:
|
||||
- export PATH=~/.composer/vendor/bin:$PATH
|
||||
- composer validate
|
||||
- composer install --dev --prefer-dist
|
||||
- composer require --prefer-dist --no-update silverstripe/recipe-core:1.0.x-dev
|
||||
- composer require --prefer-dist --no-update silverstripe/recipe-core:^4
|
||||
- composer update
|
||||
- if [[ $PHPCS_TEST ]]; then composer global require squizlabs/php_codesniffer:^3 --prefer-dist --no-interaction --no-progress --no-suggest -o; fi
|
||||
- phpenv rehash
|
||||
|
@ -442,6 +442,24 @@ JS;
|
||||
$button->click();
|
||||
}
|
||||
|
||||
/**
|
||||
* @Given /^I press the "([^"]*)" buttons$/
|
||||
* @param string $text A list of button names can be provided by seperating the entries with the | character.
|
||||
*/
|
||||
public function stepIPressTheButtons($text)
|
||||
{
|
||||
$buttonNames = explode('|', $text);
|
||||
foreach ($buttonNames as $name) {
|
||||
$button = $this->findNamedButton(trim($name));
|
||||
if ($button) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
assertNotNull($button, "{$text} button not found");
|
||||
$button->click();
|
||||
}
|
||||
|
||||
/**
|
||||
* Needs to be in single command to avoid "unexpected alert open" errors in Selenium.
|
||||
* Example1: I press the "Remove current combo" button, confirming the dialog
|
||||
|
Loading…
Reference in New Issue
Block a user