Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing build #303

Merged
merged 10 commits into from
Aug 28, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 36 additions & 25 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,43 +1,54 @@
language: php

sudo: false
dist: xenial

cache:
directories:
- $HOME/.composer/cache/files

php: [5.4, 5.5, 5.6, 7.0, 7.1, 7.2]
services:
- docker

env:
global:
- WEBDRIVER=selenium
php:
- 7.0
- 7.1
- 7.2
- 7.3.6
- 7.4snapshot

matrix:
fast_finish: true
allow_failures:
- php: 7.4snapshot
include:
- php: 7.0
env: WEBDRIVER=selenium-remote
sudo: required
services:
- docker
- php: 5.3
dist: precise
# Force using PHP 5.6 for the test server as PHP 5.3 does not have the builtin webserver
env: MINK_PHP_BIN=~/.phpenv/versions/5.6/bin/php
oleg-andreyev marked this conversation as resolved.
Show resolved Hide resolved
- php: 5.4
dist: trusty
- php: 5.5
dist: trusty
- php: 5.6
dist: trusty

before_script:
- sh bin/run-"$WEBDRIVER".sh
env:
global:
- DISPLAY=:99.0

- composer install
cache:
directories:
- $HOME/.composer/cache/files

install:
- composer install --no-interaction

# Start a webserver for web fixtures.
- vendor/bin/mink-test-server > /dev/null 2>&1 &
before_script:
- mkdir ./logs
- docker run -p 4444:4444 --network=host -v /dev/shm:/dev/shm --shm-size 2g selenium/standalone-firefox:2.53.1 &> ./logs/selenium.log &
- ./vendor/bin/mink-test-server &> ./logs/mink-test-server.log &
- until $(echo | nc localhost 4444); do sleep 1; echo Waiting for Selenium server on port 4444...; done; echo "Selenium server started"
oleg-andreyev marked this conversation as resolved.
Show resolved Hide resolved
- until $(echo | nc localhost 8002); do sleep 1; echo waiting for PHP server on port 8002...; done; echo "PHP server started"

script: phpunit -v --coverage-clover=coverage.clover
script:
- ./vendor/bin/simple-phpunit -v --coverage-clover=coverage.clover

after_script:
- wget https://scrutinizer-ci.com/ocular.phar
- php ocular.phar code-coverage:upload --format=php-clover coverage.clover

after_failure:
- cat /tmp/webdriver_output.txt
- cat ./logs/selenium.log
- cat ./logs/mink-test-server.log
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,29 @@ $> curl -sS http://getcomposer.org/installer | php
$> php composer.phar install
```

Testing
------------

1. Start WebDriver
1. If you have Docker installed, run
```bash
docker run -p 4444:4444 selenium/standalone-firefox:2.53.1
```
2. If you do not have Docker, but you have Java
```bash
curl -L http://selenium-release.storage.googleapis.com/2.53/selenium-server-standalone-2.53.1.jar > selenium-server-standalone-2.53.1.jar
java -jar selenium-server-standalone-2.53.1.jar
```
2. Start WebServer by running
``` bash
./vendor/bin/mink-test-server
```
3. Start PhpUnit
```bash
composer require --dev phpunit/phpunit
./vendor/bin/phpunit -v --coverage-clover=coverage.clover
```

Copyright
---------

Expand Down
7 changes: 0 additions & 7 deletions bin/run-selenium-remote.sh

This file was deleted.

11 changes: 0 additions & 11 deletions bin/run-selenium.sh

This file was deleted.

4 changes: 1 addition & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,11 @@
"homepage": "http://everzet.com"
}
],

"require": {
"php": ">=5.3.1",
"php": ">=5.4",
oleg-andreyev marked this conversation as resolved.
Show resolved Hide resolved
"behat/mink": "~1.7@dev",
"instaclick/php-webdriver": "~1.1"
},

"require-dev": {
"mink/driver-testsuite": "dev-master"
},
Expand Down
5 changes: 4 additions & 1 deletion phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@
<var name="driver_config_factory" value="Behat\Mink\Tests\Driver\Selenium2Config::getInstance" />

<!--server name="WEB_FIXTURES_HOST" value="http://test.mink.dev" /-->
<!--server name="WEB_FIXTURES_BROWSER" value="firefox" /-->
<!-- MacOS -->
<!--<server name="WEB_FIXTURES_HOST" value="http://docker.for.mac.localhost:8002"/>-->
oleg-andreyev marked this conversation as resolved.
Show resolved Hide resolved

<!--<server name="WEB_FIXTURES_BROWSER" value="firefox"/>-->

<!-- where driver will connect to -->
<server name="DRIVER_URL" value="http://localhost:4444/wd/hub" />
Expand Down