From 861b44c67e078b7d6535fd5253c6a0c38354d4a1 Mon Sep 17 00:00:00 2001 From: Redwan Date: Thu, 5 Mar 2020 15:30:27 +0100 Subject: [PATCH 1/6] update composer.json for symfony 4 --- .travis.yml | 7 +++++-- behat.yml.dist | 9 ++++++++- composer.json | 20 ++++++++++---------- 3 files changed, 23 insertions(+), 13 deletions(-) diff --git a/.travis.yml b/.travis.yml index b4a70db..2551eb4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,10 @@ language: php +dist: trusty + +jdk: + - openjdk8 + addons: chrome: stable @@ -19,8 +24,6 @@ env: # - DEPS="--prefer-lowest" PROFILE=symfony2 php: - - 7.0 - - 7.1 - 7.2 - nightly diff --git a/behat.yml.dist b/behat.yml.dist index 8e7c31b..8c127c0 100644 --- a/behat.yml.dist +++ b/behat.yml.dist @@ -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: diff --git a/composer.json b/composer.json index 22d2b9f..35bbf49 100644 --- a/composer.json +++ b/composer.json @@ -9,21 +9,21 @@ "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", + "symfony/translation": "^4.0", + "symfony/config": "^4.0", + "symfony/dependency-injection": "^4.0", "phpunit/php-code-coverage": "^5", "phpunit/phpunit": "^6" }, "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" }, @@ -33,7 +33,7 @@ "IntegralService\\": "src/" } }, - + "config": { "bin-dir": "bin/" } From e3080c1fa64f45ed0229f68840faa20bc2fe7dd0 Mon Sep 17 00:00:00 2001 From: Redwan Date: Wed, 29 Apr 2020 15:48:46 +0200 Subject: [PATCH 2/6] feature to tests wysiwyg fields (CKEditor wysiwyg) --- src/BehatContext/WebContext.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/BehatContext/WebContext.php b/src/BehatContext/WebContext.php index cb3a9f0..ee424e4 100644 --- a/src/BehatContext/WebContext.php +++ b/src/BehatContext/WebContext.php @@ -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\");"); + } } From a6ad97b21f2c9cd07be6f91d8202681256999ea4 Mon Sep 17 00:00:00 2001 From: Julien Rouvier Date: Fri, 31 Jul 2020 10:37:11 +0200 Subject: [PATCH 3/6] Update phpunit and coverage version (#17) Update versions of phpunit and coverage, selenium, chrome driver and travis distrib --- .travis.yml | 9 +++++---- composer.json | 6 +++--- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2551eb4..19e2ac7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,6 @@ language: php -dist: trusty +dist: xenial jdk: - openjdk8 @@ -15,8 +15,8 @@ cache: env: global: - DISPLAY=:99.0 - - CHROME_DRIVER_VERSION=2.36 - - SELENIUM_VERSION=3.6.0 + - CHROME_DRIVER_VERSION=84.0.4147.30 + - SELENIUM_VERSION=3.141.59 matrix: - DEPS="" PROFILE=default # - DEPS="--prefer-lowest" PROFILE=default @@ -24,6 +24,7 @@ env: # - DEPS="--prefer-lowest" PROFILE=symfony2 php: + - 7.1 - 7.2 - nightly @@ -37,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 diff --git a/composer.json b/composer.json index 35bbf49..9806914 100644 --- a/composer.json +++ b/composer.json @@ -5,7 +5,7 @@ "type": "library", "homepage": "https://github.com/IntegralService/BehatContext", "license": "MIT", - "minimum-stability": "dev", + "minimum-stability": "stable", "require": { "php": ">=5.6", @@ -17,8 +17,8 @@ "symfony/translation": "^4.0", "symfony/config": "^4.0", "symfony/dependency-injection": "^4.0", - "phpunit/php-code-coverage": "^5", - "phpunit/phpunit": "^6" + "phpunit/php-code-coverage": "^6.1", + "phpunit/phpunit": "^7.5" }, "require-dev": { From ca08045e1adb458ed582e3290c19611bae0a0224 Mon Sep 17 00:00:00 2001 From: Julien Rouvier Date: Wed, 3 Mar 2021 11:25:22 +0100 Subject: [PATCH 4/6] Require any version of phpunit/php-code-coverage above 6.1 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 9806914..0d15f96 100644 --- a/composer.json +++ b/composer.json @@ -17,7 +17,7 @@ "symfony/translation": "^4.0", "symfony/config": "^4.0", "symfony/dependency-injection": "^4.0", - "phpunit/php-code-coverage": "^6.1", + "phpunit/php-code-coverage": ">=6.1", "phpunit/phpunit": "^7.5" }, From 1eca51098b630c06d0c3a1a2a8198c397972cf35 Mon Sep 17 00:00:00 2001 From: Julien Rouvier Date: Wed, 3 Mar 2021 11:55:54 +0100 Subject: [PATCH 5/6] Update chrome driver version for tests --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 19e2ac7..5762c4f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,7 +15,7 @@ cache: env: global: - DISPLAY=:99.0 - - CHROME_DRIVER_VERSION=84.0.4147.30 + - CHROME_DRIVER_VERSION=89.0.4389.23 - SELENIUM_VERSION=3.141.59 matrix: - DEPS="" PROFILE=default From 905f67e6fa1c8b75261f619545ee3674bdde8424 Mon Sep 17 00:00:00 2001 From: Julien Rouvier Date: Wed, 3 Mar 2021 12:07:23 +0100 Subject: [PATCH 6/6] Allow higher version of phpunit --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 0d15f96..67b2bfd 100644 --- a/composer.json +++ b/composer.json @@ -18,7 +18,7 @@ "symfony/config": "^4.0", "symfony/dependency-injection": "^4.0", "phpunit/php-code-coverage": ">=6.1", - "phpunit/phpunit": "^7.5" + "phpunit/phpunit": ">=7.5" }, "require-dev": {