Merge branch '4'

This commit is contained in:
Dan Hensby 2020-04-01 18:07:21 +01:00
commit be83e2afa8
No known key found for this signature in database
GPG Key ID: F76D6B5FE0626A99
3 changed files with 26 additions and 3 deletions

View File

@ -1,6 +1,6 @@
language: php
dist: precise
dist: xenial
sudo: false
@ -21,8 +21,8 @@ env:
before_script:
- export PATH=~/.composer/vendor/bin:$PATH
- composer validate
- composer require --prefer-dist --no-update silverstripe/recipe-core:5.x-dev
- composer install --prefer-source --no-interaction --no-progress --no-suggest --optimize-autoloader --verbose --profile
- composer require --no-update silverstripe/recipe-core:5.x-dev
- composer install --prefer-dist --no-interaction --no-progress --no-suggest --optimize-autoloader --verbose --profile
- if [[ $PHPCS_TEST ]]; then composer global require squizlabs/php_codesniffer:^3 --prefer-dist --no-interaction --no-progress --no-suggest -o; fi
- phpenv rehash

View File

@ -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

View File

@ -240,6 +240,11 @@ abstract class SilverStripeContext extends MinkContext implements SilverStripeAw
);
}
$webDriverSession = $this->getSession();
if (!$webDriverSession->isStarted()) {
$webDriverSession->start();
}
$state = $this->getTestSessionState();
$this->testSessionEnvironment->startTestSession($state);