Skip to content

Commit 200b8df

Browse files
mvorisekrobocoder
authored andcommitted
Add testing with mink/driver-testsuite
1 parent c893a53 commit 200b8df

File tree

2 files changed

+58
-2
lines changed

2 files changed

+58
-2
lines changed

Diff for: .github/workflows/ci.yml

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
env:
8+
DRIVER_URL: "http://localhost:4444/wd/hub"
9+
10+
jobs:
11+
Mink:
12+
runs-on: ubuntu-20.04
13+
strategy:
14+
matrix:
15+
selenium: [ '2.53.1', '3.141.59' ]
16+
php: [ '7.2', '7.3', '7.4', '8.0', '8.1' ]
17+
fail-fast: false
18+
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v2
22+
23+
- name: Setup PHP
24+
uses: shivammathur/setup-php@v2
25+
with:
26+
php-version: "${{ matrix.php }}"
27+
tools: composer
28+
ini-values: error_reporting=-1, display_errors=On
29+
30+
- name: Install dependencies
31+
run: |
32+
composer config version 1.4.99
33+
composer require --no-update behat/mink-selenium2-driver:dev-master --dev --quiet
34+
composer require --no-update mink/driver-testsuite:dev-master --dev --quiet
35+
php -r '$json = json_decode(file_get_contents ("composer.json"), true); $json["autoload"]["psr-4"]["Behat\\Mink\\Tests\\Driver\\"] = "vendor/behat/mink-selenium2-driver/tests/"; file_put_contents("composer.json", json_encode($json, JSON_UNESCAPED_SLASHES|JSON_PRETTY_PRINT));'
36+
composer update --no-interaction --prefer-dist
37+
38+
- name: Start Selenium & Mink test server
39+
run: |
40+
mkdir logs
41+
docker run --net host --name selenium --volume /dev/shm:/dev/shm --shm-size 2g "selenium/standalone-firefox:${{ matrix.selenium }}" &> logs/selenium.log &
42+
vendor/bin/mink-test-server &> logs/mink-test-server.log &
43+
while ! nc -z localhost 4444 </dev/null; do echo Waiting for remote driver to start...; sleep 1; done
44+
while ! nc -z localhost 8002 </dev/null; do echo Waiting for PHP server to start...; sleep 1; done
45+
46+
- name: Run Mink tests
47+
run: |
48+
sed -i "s~vendor/~../../../vendor/~" vendor/behat/mink-selenium2-driver/phpunit.xml.dist
49+
# remove test excludes once https://github.com/minkphp/MinkSelenium2Driver/pull/354 Selenium 3 issues are fixed
50+
if [ "${{ matrix.selenium }}" = "3.141.59" ]; then
51+
vendor/bin/phpunit --exclude-group none --no-coverage -v -c vendor/behat/mink-selenium2-driver --filter '^(?!Behat\\Mink\\Tests\\Driver\\(?:Basic\\IFrameTest::testIFrame|Js\\ChangeEventTest::testSetValueChangeEvent.*|Js\\WindowTest::testWindow|Custom\\TimeoutTest::testInvalidTimeoutSettingThrowsException|Js\\EventsTest::testRightClick)$)'
52+
else
53+
vendor/bin/phpunit --exclude-group none --no-coverage -v -c vendor/behat/mink-selenium2-driver
54+
fi

Diff for: composer.json

+4-2
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,11 @@
2727
"ext-curl": "*"
2828
},
2929
"require-dev": {
30-
"satooshi/php-coveralls": "^1.0||^2.0",
31-
"phpunit/phpunit": "^4.8"
30+
"satooshi/php-coveralls": "^1.0 || ^2.0",
31+
"phpunit/phpunit": "^8.5 || ^9.5"
3232
},
33+
"minimum-stability": "dev",
34+
"prefer-stable": true,
3335
"autoload": {
3436
"psr-0": {
3537
"WebDriver": "lib/"

0 commit comments

Comments
 (0)