Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
language: php

dist: xenial

jdk:
- openjdk8

addons:
chrome: stable

Expand All @@ -10,16 +15,15 @@ cache:
env:
global:
- DISPLAY=:99.0
- CHROME_DRIVER_VERSION=2.36
- SELENIUM_VERSION=3.6.0
- CHROME_DRIVER_VERSION=89.0.4389.23
- SELENIUM_VERSION=3.141.59
matrix:
- DEPS="" PROFILE=default
# - DEPS="--prefer-lowest" PROFILE=default
- DEPS="" PROFILE=symfony2
# - DEPS="--prefer-lowest" PROFILE=symfony2

php:
- 7.0
- 7.1
- 7.2
- nightly
Expand All @@ -34,7 +38,7 @@ before_script:

- wget "https://chromedriver.storage.googleapis.com/${CHROME_DRIVER_VERSION}/chromedriver_linux64.zip"
- unzip chromedriver_linux64.zip
- wget "https://selenium-release.storage.googleapis.com/${SELENIUM_VERSION%%.[[:digit:]]}/selenium-server-standalone-${SELENIUM_VERSION}.jar" -O selenium.jar
- wget "https://selenium-release.storage.googleapis.com/${SELENIUM_VERSION%.*}/selenium-server-standalone-${SELENIUM_VERSION}.jar" -O selenium.jar
- java -jar -Dwebdriver.chrome.driver=./chromedriver selenium.jar &> /dev/null &

- echo "memory_limit = 2G" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
Expand Down
9 changes: 8 additions & 1 deletion behat.yml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,14 @@ default:
base_url: 'http://localhost:8080'
files_path: 'tests/fixtures/files'
goutte: ~
selenium2: ~
selenium2:
capabilities:
chrome:
switches:
- "--headless"
- "--disable-gpu"
- "--no-sandbox"
javascript_session: selenium2
browser_name: 'chrome'
sessions:
default:
Expand Down
26 changes: 13 additions & 13 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,25 @@
"type": "library",
"homepage": "https://github.com/IntegralService/BehatContext",
"license": "MIT",
"minimum-stability": "dev",
"minimum-stability": "stable",

"require": {
"php": ">=5.6",
"behat/behat": "^3.5.0",
"behat/mink-extension": "^2.3.1",
"behat/symfony2-extension": "^2.1.5",
"symfony/security": "^3.4",
"behat/behat": "^3.6",
"behat/mink-extension": "^2.3",
"behat/symfony2-extension": "^2.1",
"symfony/security": "^4.0",
"symfony/dom-crawler": "^2.4|^3.0|^4.0",
"symfony/translation": "^3.4",
"symfony/config": "^3.4",
"symfony/dependency-injection": "^3.4",
"phpunit/php-code-coverage": "^5",
"phpunit/phpunit": "^6"
"symfony/translation": "^4.0",
"symfony/config": "^4.0",
"symfony/dependency-injection": "^4.0",
"phpunit/php-code-coverage": ">=6.1",
"phpunit/phpunit": ">=7.5"
},

"require-dev": {
"behat/mink-goutte-driver": "^1.1",
"fabpot/goutte": "^3.2",
"behat/mink-goutte-driver": "^1.2",
"fabpot/goutte": "^3.3",
"guzzlehttp/guzzle": "^6.3",
"behat/mink-selenium2-driver": "^1.3"
},
Expand All @@ -33,7 +33,7 @@
"IntegralService\\": "src/"
}
},

"config": {
"bin-dir": "bin/"
}
Expand Down
16 changes: 16 additions & 0 deletions src/BehatContext/WebContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -356,4 +356,20 @@ protected function fixStepArgument($argument)
{
return str_replace('\\"', '"', $argument);
}

/**
* @Then I fill in wysiwyg field :locator with :value
*/
public function iFillInWysiwygOnFieldWith($locator, $value) {
$el = $this->getSession()->getPage()->findField($locator);
if (empty($el)) {
throw new \Exception('Could not find WYSIWYG with locator: ' . $locator);
}
$fieldId = $el->getAttribute('id');
if (empty($fieldId)) {
throw new \Exception('Could not find an id for field with locator: ' . $locator);
}
$this->getSession()
->executeScript("CKEDITOR.instances[\"$fieldId\"].setData(\"$value\");");
}
}