Skip to content

Commit 6e1055a

Browse files
committed
behat use chrome headless
1 parent 45a2648 commit 6e1055a

File tree

1 file changed

+15
-30
lines changed

1 file changed

+15
-30
lines changed

.github/workflows/behat.yaml

Lines changed: 15 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ jobs:
8484
run: |
8585
echo "const bootstrapTheme = require('./themes/BootstrapTheme/webpack.config');" >> webpack.config.js
8686
echo "module.exports = [bootstrapTheme];" >> webpack.config.js
87+
cat webpack.config.js
8788
8889
- name: Theme - Config Assets
8990
working-directory: ./sylius
@@ -119,44 +120,28 @@ jobs:
119120
working-directory: ./sylius
120121
run: php bin/console sylius:install -n -s default
121122

122-
- name: Behat - Configure display
123-
working-directory: ./sylius
124-
run: |
125-
/sbin/start-stop-daemon --start --quiet --pidfile /tmp/xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -ac -screen 0 1680x1050x16
126-
export DISPLAY=:99
123+
- name: Symfony CLI - Downloading
124+
run: wget https://get.symfony.com/cli/installer -O - | bash
127125

128-
- name: Behat - Download and configure ChromeDriver
129-
working-directory: ./sylius
126+
- name: Symfony CLI - PHP version
130127
run: |
131-
if [ ! -f chromedriver ] || [ "$(chromedriver --version | grep -c 2.34)" = "0" ]; then
132-
curl http://chromedriver.storage.googleapis.com/2.34/chromedriver_linux64.zip > chromedriver.zip
133-
unzip chromedriver.zip
134-
chmod +x chromedriver
135-
fi
128+
php -v | head -n 1 | awk '{ print \$2 }' > .php-version
129+
/home/runner/symfony local:php:list
130+
/home/runner/symfony symfony php -v
136131
137-
- name: Behat - Run ChromeDriver
138-
working-directory: ./sylius
139-
run: chromedriver > /dev/null 2>&1 &
132+
- name: Symfony CLI - Certificat
133+
run: /home/runner/symfony server:ca:install
140134

141-
- name: Behat - Download and configure Selenium
142-
working-directory: ./sylius
143-
run: |
144-
if [ ! -f selenium.jar ] || [ "$(java -jar selenium.jar --version | grep -c 3.4.0)" = "0" ]; then
145-
curl http://selenium-release.storage.googleapis.com/3.4/selenium-server-standalone-3.4.0.jar > selenium.jar
146-
fi
147-
148-
- name: Behat - Run Selenium
149-
working-directory: ./sylius
150-
run: java -Dwebdriver.chrome.driver=chromedriver -jar selenium.jar > /dev/null 2>&1 &
135+
- name: Chrome - Run
136+
run: 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 &"
151137

152-
- name: Behat - Run webserver
153-
working-directory: ./sylius
154-
run: bin/console server:run 127.0.0.1:8080 --quiet > /dev/null 2>&1 &
138+
- name: Symfony CLI - Server start
139+
run: /home/runner/symfony server:start --port=8080 --dir=public --daemon
155140

156141
- name: Behat - Run Behat tests
157142
working-directory: ./sylius
158-
run: vendor/bin/behat --strict -vvv --no-interaction -f progress --tags="~@javascript && ~@todo && ~@cli" vendor/sylius/sylius/features/account/registering.feature || \
159-
vendor/bin/behat --strict -vvv --no-interaction -f progress --tags="~@javascript && ~@todo && ~@cli" vendor/sylius/sylius/features/account/registering.feature --rerun
143+
run: vendor/bin/behat --strict -vvv --no-interaction -f progress --tags="~@javascript && ~@todo && ~@cli" || \
144+
vendor/bin/behat --strict -vvv --no-interaction -f progress --tags="~@javascript && ~@todo && ~@cli" --rerun
160145

161146
services:
162147
mariadb:

0 commit comments

Comments
 (0)