Skip to content

Commit cc77c10

Browse files
committed
Update to Travis Bionic + use headless Chrome
1 parent 4d04d9a commit cc77c10

File tree

4 files changed

+47
-39
lines changed

4 files changed

+47
-39
lines changed

.travis.yml

Lines changed: 23 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,23 @@
11
language: php
22

3-
dist: trusty
3+
os: linux
44

5-
sudo: false
5+
dist: bionic
66

77
php:
88
- '7.3'
9+
- '7.4'
10+
11+
services:
12+
- mysql
13+
14+
addons:
15+
apt:
16+
sources:
17+
- google-chrome
18+
packages:
19+
- google-chrome-stable
20+
chrome: stable
921

1022
cache:
1123
yarn: true
@@ -35,37 +47,23 @@ before_script:
3547
- (cd tests/Application && bin/console cache:warmup -vvv)
3648
- (cd tests/Application && yarn build)
3749

38-
# Configure display
39-
- /sbin/start-stop-daemon --start --quiet --pidfile /tmp/xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -ac -screen 0 1680x1050x16
40-
- export DISPLAY=:99
41-
42-
# Download and configure ChromeDriver
43-
- |
44-
if [ ! -f $SYLIUS_CACHE_DIR/chromedriver ] || [ "$($SYLIUS_CACHE_DIR/chromedriver --version | grep -c 2.34)" = "0" ]; then
45-
curl http://chromedriver.storage.googleapis.com/2.34/chromedriver_linux64.zip > chromedriver.zip
46-
unzip chromedriver.zip
47-
chmod +x chromedriver
48-
mv chromedriver $SYLIUS_CACHE_DIR
49-
fi
50-
51-
# Run ChromeDriver
52-
- $SYLIUS_CACHE_DIR/chromedriver > /dev/null 2>&1 &
53-
54-
# Download and configure Selenium
50+
# Downloading Symfony CLI
5551
- |
56-
if [ ! -f $SYLIUS_CACHE_DIR/selenium.jar ] || [ "$(java -jar $SYLIUS_CACHE_DIR/selenium.jar --version | grep -c 3.4.0)" = "0" ]; then
57-
curl http://selenium-release.storage.googleapis.com/3.4/selenium-server-standalone-3.4.0.jar > selenium.jar
58-
mv selenium.jar $SYLIUS_CACHE_DIR
52+
if [ ! -f $SYLIUS_CACHE_DIR/symfony ]; then
53+
wget https://get.symfony.com/cli/installer -O - | bash
54+
mv ~/.symfony/bin/symfony $SYLIUS_CACHE_DIR
5955
fi
56+
php -v | head -n 1 | awk '{ print $2 }' > .php-version
6057
61-
# Run Selenium
62-
- java -Dwebdriver.chrome.driver=$SYLIUS_CACHE_DIR/chromedriver -jar $SYLIUS_CACHE_DIR/selenium.jar > /dev/null 2>&1 &
58+
# Run Chrome Headless
59+
- google-chrome-stable --enable-automation --disable-background-networking --no-default-browser-check --no-first-run --disable-popup-blocking --disable-default-apps --allow-insecure-localhost --disable-translate --disable-extensions --no-sandbox --enable-features=Metal --headless --remote-debugging-port=9222 --window-size=2880,1800 --proxy-server='direct://' --proxy-bypass-list='*' http://127.0.0.1 > /dev/null 2>&1 &
6360

6461
# Run webserver
65-
- (cd tests/Application && bin/console server:run 127.0.0.1:8080 --quiet > /dev/null 2>&1 &)
62+
- (cd tests/Application && $SYLIUS_CACHE_DIR/symfony server:start --port=8080 --dir=public --daemon)
6663

6764
script:
6865
- composer validate
66+
6967
- vendor/bin/phpstan analyse -c phpstan.neon -l max src/
7068

7169
- vendor/bin/phpunit

behat.yml.dist

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ imports:
44

55
default:
66
extensions:
7+
DMore\ChromeExtension\Behat\ServiceContainer\ChromeExtension: ~
8+
79
Lakion\Behat\MinkDebugExtension:
810
directory: etc/build
911
clean_start: false
@@ -13,10 +15,14 @@ default:
1315
files_path: "%paths.base%/vendor/sylius/sylius/src/Sylius/Behat/Resources/fixtures/"
1416
base_url: "http://localhost:8080/"
1517
default_session: symfony
16-
javascript_session: chrome
18+
javascript_session: chrome_headless
1719
sessions:
1820
symfony:
1921
symfony: ~
22+
chrome_headless:
23+
chrome:
24+
api_url: http://127.0.0.1:9222
25+
validate_certificate: false
2026
chrome:
2127
selenium2:
2228
browser: chrome

composer.json

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,25 +7,27 @@
77
"require": {
88
"php": "^7.3",
99

10-
"sylius/sylius": "^1.7.4"
10+
"sylius/sylius": "^1.7.5"
1111
},
1212
"require-dev": {
1313
"behat/behat": "^3.6.1",
14-
"behat/mink-selenium2-driver": "^1.3",
14+
"behat/mink-selenium2-driver": "^1.4",
15+
"dmore/behat-chrome-extension": "^1.3",
16+
"dmore/chrome-mink-driver": "^2.7",
1517
"friends-of-behat/mink": "^1.8",
16-
"friends-of-behat/mink-browserkit-driver": "^1.3",
17-
"friends-of-behat/mink-extension": "^2.2",
18+
"friends-of-behat/mink-browserkit-driver": "^1.4",
19+
"friends-of-behat/mink-extension": "^2.4",
1820
"friends-of-behat/page-object-extension": "^0.3",
1921
"friends-of-behat/suite-settings-extension": "^1.0",
20-
"friends-of-behat/symfony-extension": "^2.0",
21-
"friends-of-behat/variadic-extension": "^1.1",
22+
"friends-of-behat/symfony-extension": "^2.1",
23+
"friends-of-behat/variadic-extension": "^1.3",
2224
"lakion/mink-debug-extension": "^1.2.3",
2325
"phpspec/phpspec": "^6.1",
24-
"phpstan/phpstan-doctrine": "^0.12",
25-
"phpstan/phpstan": "^0.12",
26-
"phpstan/phpstan-webmozart-assert": "^0.12",
27-
"phpunit/phpunit": "^8.0",
28-
"sensiolabs/security-checker": "^5.0",
26+
"phpstan/phpstan": "0.12.25",
27+
"phpstan/phpstan-doctrine": "0.12.13",
28+
"phpstan/phpstan-webmozart-assert": "0.12.4",
29+
"phpunit/phpunit": "^8.5",
30+
"sensiolabs/security-checker": "^6.0",
2931
"sylius-labs/coding-standard": "^3.1",
3032
"symfony/browser-kit": "^4.4",
3133
"symfony/debug-bundle": "^4.4|^5.0",

phpunit.xml.dist

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22

33
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4-
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/8.0/phpunit.xsd"
4+
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/8.5/phpunit.xsd"
55
colors="true"
66
bootstrap="tests/Application/config/bootstrap.php">
77
<testsuites>
@@ -11,9 +11,11 @@
1111
</testsuites>
1212

1313
<php>
14+
<ini name="error_reporting" value="-1" />
15+
1416
<server name="KERNEL_CLASS_PATH" value="/tests/Application/AppKernel.php" />
1517
<server name="IS_DOCTRINE_ORM_SUPPORTED" value="true" />
16-
18+
1719
<env name="APP_ENV" value="test"/>
1820
<env name="SHELL_VERBOSITY" value="-1" />
1921
</php>

0 commit comments

Comments
 (0)