forked from php-webdriver/php-webdriver
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
144 lines (125 loc) · 5.63 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
language: php
dist: xenial
php:
- '7.1'
- '7.2'
- '7.3'
- '7.4'
env:
global:
- DISPLAY=:99.0
- BROWSER_NAME="htmlunit"
- SELENIUM_SERVER="https://selenium-release.storage.googleapis.com/3.14/selenium-server-standalone-3.14.0.jar" # Latest version including HtmlUnit
- COMPOSER_MEMORY_LIMIT=-1
- XDEBUG_MODE=coverage
services:
- xvfb
matrix:
include:
- name: 'PHP nightly build'
php: 'nightly'
env: DEPENDENCIES="--ignore-platform-req=php"
- name: 'PHP 7.0'
php: '7.0'
env: RUN_PHPUNIT_PATCHES="true"
- name: 'PHP 5.6'
php: '5.6'
env: RUN_PHPUNIT_PATCHES="true"
# Build with lowest possible dependencies on lowest possible PHP
- name: 'Lowest dependencies build'
php: '5.6'
env:
- DEPENDENCIES="--prefer-lowest"
- RUN_PHPUNIT_PATCHES="true"
# Firefox inside Travis environment
- name: 'Firefox 45 on Travis (OSS protocol); via legacy Selenium server'
php: '7.3'
env:
- BROWSER_NAME="firefox"
- SELENIUM_SERVER="legacy"
addons:
firefox: "45.8.0esr"
# Firefox with Geckodriver (W3C mode) inside Travis environment
- name: 'Firefox latest on Travis (W3C protocol); no Selenium server'
php: '7.3'
env:
- BROWSER_NAME="firefox"
- GECKODRIVER="1"
addons:
firefox: latest
# Stable Chrome + Chromedriver (W3C mode) inside Travis environment via Selenium server proxy
- name: 'Chrome stable on Travis (W3C protocol); via Selenium server'
php: '7.3'
env:
- BROWSER_NAME="chrome"
addons:
chrome: stable
# Stable Chrome + Chromedriver (W3C mode) inside Travis environment directly via Chromedriver
- name: 'Chrome stable on Travis (W3C protocol); no Selenium server'
php: '7.3'
env:
- BROWSER_NAME="chrome"
- CHROMEDRIVER="1"
addons:
chrome: stable
# Stable Chrome + Chromedriver (JsonWire OSS mode) inside Travis environment directly via Chromedriver
- name: 'Chrome stable on Travis (OSS protocol); no Selenium server'
php: '7.3'
env:
- BROWSER_NAME="chrome"
- CHROMEDRIVER="1"
- DISABLE_W3C_PROTOCOL="1"
addons:
chrome: stable
cache:
directories:
- $HOME/.composer/cache
install:
- travis_retry composer self-update
- travis_retry composer update --no-interaction $DEPENDENCIES
before_script:
- if [ "$RUN_PHPUNIT_PATCHES" = "true" ]; then ./scripts/apply-phpunit-patches.sh; fi
- if [ "$BROWSER_NAME" = "chrome" ]; then
mkdir chromedriver;
CHROME_VERSION=$(google-chrome --product-version);
CHROME_VERSION=${CHROME_VERSION%.*};
wget -q -t 3 https://chromedriver.storage.googleapis.com/$(curl -L https://chromedriver.storage.googleapis.com/LATEST_RELEASE_${CHROME_VERSION})/chromedriver_linux64.zip;
unzip chromedriver_linux64.zip -d chromedriver;
fi
- if [ "$BROWSER_NAME" = "chrome" ]; then export CHROMEDRIVER_PATH=$PWD/chromedriver/chromedriver; fi
- if [ "$GECKODRIVER" = "1" ]; then mkdir -p geckodriver; wget -q -t 3 https://github.com/mozilla/geckodriver/releases/download/v0.28.0/geckodriver-v0.28.0-linux64.tar.gz; tar xzf geckodriver-v0.28.0-linux64.tar.gz -C geckodriver; fi
- if [ ! -f jar/selenium-server-standalone.jar ] && [ -n "$SELENIUM_SERVER" ]; then
mkdir -p jar;
if [ "$SELENIUM_SERVER" = "legacy" ]; then
wget -q -t 3 -O jar/selenium-server-standalone.jar https://selenium-release.storage.googleapis.com/3.8/selenium-server-standalone-3.8.1.jar;
else
wget -q -t 3 -O jar/selenium-server-standalone.jar $SELENIUM_SERVER;
fi
fi
- if [ "$GECKODRIVER" = "1" ]; then
geckodriver/geckodriver &> ./logs/geckodriver.log &
elif [ "$CHROMEDRIVER" = "1" ]; then
chromedriver/chromedriver --port=4444 --url-base=/wd/hub &> ./logs/chromedriver.log &
elif [ "$SELENIUM_SERVER" = "legacy" ]; then
java -Dwebdriver.firefox.marionette=false -Dwebdriver.chrome.driver="$PWD/chromedriver/chromedriver" -jar jar/selenium-server-standalone.jar -enablePassThrough false -log ./logs/selenium.log &
else
java -Dwebdriver.chrome.driver="$PWD/chromedriver/chromedriver" -Dwebdriver.gecko.driver="$PWD/geckodriver/geckodriver" -jar jar/selenium-server-standalone.jar -log ./logs/selenium.log &
fi
- until $(echo | nc localhost 4444); do sleep 1; echo Waiting for Selenium server on port 4444...; done; echo "Selenium server started"
- php -S 127.0.0.1:8000 -t tests/functional/web/ &>>./logs/php-server.log &
- until $(echo | nc localhost 8000); do sleep 1; echo waiting for PHP server on port 8000...; done; echo "PHP server started"
script:
- if [ -n "$SAUCELABS" ]; then EXCLUDE_GROUP+="exclude-saucelabs,"; fi
- if [ -n "$SAUCELABS" ]; then export SAUCE_TUNNEL_IDENTIFIER="$TRAVIS_JOB_NUMBER"; fi
- if [ "$BROWSER_NAME" = "MicrosoftEdge" ]; then EXCLUDE_GROUP+="exclude-edge,"; fi
- if [ "$BROWSER_NAME" = "firefox" ]; then EXCLUDE_GROUP+="exclude-firefox,"; fi
- if [ "$BROWSER_NAME" = "chrome" ]; then EXCLUDE_GROUP+="exclude-chrome,"; fi
- if [ -n "$EXCLUDE_GROUP" ]; then EXTRA_PARAMS+=" --exclude-group $EXCLUDE_GROUP"; fi
- ./vendor/bin/phpunit --coverage-clover ./logs/coverage-clover.xml $EXTRA_PARAMS
after_script:
- if [ -f ./logs/selenium.log ]; then cat ./logs/selenium.log; fi
- if [ -f ./logs/php-server.log ]; then cat ./logs/php-server.log; fi
- if [ -f ./logs/geckodriver.log ]; then cat ./logs/geckodriver.log; fi
- if [ -f ./logs/chromedriver.log ]; then cat ./logs/chromedriver.log; fi
after_success:
- if [ "$TRAVIS_PHP_VERSION" != "nightly" ]; then travis_retry php vendor/bin/php-coveralls -v; fi