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

[WIP] Facebook driver #304

Closed
wants to merge 66 commits into from
Closed
Show file tree
Hide file tree
Changes from 37 commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
5be40f8
moved driver to facebook/webdriver
oleg-andreyev Nov 30, 2018
9921b40
fixing initial commit
oleg-andreyev Nov 30, 2018
34197e2
added chrome to travis
oleg-andreyev Nov 30, 2018
ecd9e46
updated run-selenium.sh
oleg-andreyev Nov 30, 2018
305323d
crlf to lf for bin, removed local override in phpunit.xml.dist, some …
oleg-andreyev Dec 2, 2018
6666a62
adjusted travis for chrome and ff
oleg-andreyev Dec 2, 2018
3a988ef
fixing
oleg-andreyev Dec 2, 2018
4b97f28
fixing
oleg-andreyev Dec 2, 2018
ed49807
fixing
oleg-andreyev Dec 2, 2018
2181be3
fixing upload & wait
oleg-andreyev Dec 8, 2018
d1cdddc
unskipping testWindowMaximize
oleg-andreyev Dec 8, 2018
e7ad036
updated phpunit.xml.dist with examples for FF, updated Selenium2Confi…
oleg-andreyev Dec 9, 2018
9dcf505
downgrade firefox to 2.53.1
oleg-andreyev Dec 15, 2018
d84acc3
reverted "setRequestHeader", unified key actions
oleg-andreyev Dec 30, 2018
77c961f
reverted tests/Custom
oleg-andreyev Jan 4, 2019
25a2d90
added fix to getAttribute, added fix to setValue file-upload, fixing …
oleg-andreyev Jan 4, 2019
2f2ea4f
removed accident phpunit from composer
oleg-andreyev Jan 4, 2019
fcbb4c4
removed charToOptions
oleg-andreyev Jan 4, 2019
8afc38b
reverted spaces in composer, removed roave/security-advisories
oleg-andreyev Jan 4, 2019
c4f0b73
updated .travis.yml to match facebook/webdriver
oleg-andreyev Jan 4, 2019
63fa6fc
added no-api
oleg-andreyev Jan 4, 2019
939caf7
added prefer-dist
oleg-andreyev Jan 4, 2019
4fc6729
fix
oleg-andreyev Jan 4, 2019
aa12542
removed bin/
oleg-andreyev Jan 4, 2019
b01aea6
added logs dir
oleg-andreyev Jan 4, 2019
ba7fad4
fixing travis build
oleg-andreyev Jan 3, 2019
00cc9a8
Merge branch 'fix-master-build' into facebook-driver
oleg-andreyev Jan 5, 2019
bea3c59
adapted .travis.yml from facebook/php-webdriver
oleg-andreyev Jan 5, 2019
d705afc
returned driver specific timeouts, setTimeouts/applyTimeouts
oleg-andreyev Jan 5, 2019
2d4a965
fixing setDesiredCapabilities and getWebDriverSessionId, added more t…
oleg-andreyev Jan 5, 2019
f584e6f
improving wait
oleg-andreyev Jan 5, 2019
a58f29a
improving Selenium2Config
oleg-andreyev Jan 5, 2019
97c2c0b
updated build config
oleg-andreyev Jan 5, 2019
643c0cc
fixing build
oleg-andreyev Jan 5, 2019
c2bb586
fixing build
oleg-andreyev Jan 5, 2019
a5fb84e
update build
oleg-andreyev Jan 5, 2019
d785496
removed selenium jar
oleg-andreyev Jan 5, 2019
b54d351
reusing mink-test-server instead of direct php build-in server, updat…
oleg-andreyev Jan 8, 2019
1180e1c
removed USE_ZEND_ALLOC, added travis_retry
oleg-andreyev Jan 8, 2019
839e9c8
renamed DEPENDENCIES to COMPOSER_FLAGS
oleg-andreyev Jan 8, 2019
1db167c
bumped dev-master alias to 2.0.x-dev
oleg-andreyev Jan 8, 2019
8a96a7f
commented WEB_FIXTURES_HOST in phpunit.xml.dist and added comment
oleg-andreyev Jan 8, 2019
fb7bf5c
removed typehint from Selenium2Config
oleg-andreyev Jan 8, 2019
e79fc7a
added test case for 7.0 with SELENIUM_DRIVER
oleg-andreyev Jan 8, 2019
7d68a07
added BROWSER_NAME for SELENIUM_DRIVER, added --network=host
oleg-andreyev Jan 8, 2019
77f0d98
added typehint to setTimeouts
oleg-andreyev Jan 8, 2019
14ca3c6
moved "if started" check up
oleg-andreyev Jan 8, 2019
390326d
removed "setWebDriver"
oleg-andreyev Jan 8, 2019
127434f
added "getWebDriver" to bypass Mink API
oleg-andreyev Jan 8, 2019
f0351a1
changed visibility of executeJsOnXpath from protected to private
oleg-andreyev Jan 8, 2019
f6000fa
removed $started property in favor of isStarted, where we are checkin…
oleg-andreyev Jan 8, 2019
33d7e8f
avoid override $element variable in getValue/setValue
oleg-andreyev Jan 8, 2019
eeeb1e1
removed comment from clickOnElement
oleg-andreyev Jan 8, 2019
5510e51
removed typehint from attachFile, added correct return type to findEl…
oleg-andreyev Jan 8, 2019
4ba0fe5
changed exception in resizeWindow/maximizeWindow from generic Excepti…
oleg-andreyev Jan 8, 2019
eddbe48
removed extra space in ensureInputType
oleg-andreyev Jan 8, 2019
97827c0
removed unused method uploadFile
oleg-andreyev Jan 8, 2019
d964481
updated docblock to keyModifier/decodeChar
oleg-andreyev Jan 8, 2019
ae01600
updated docblock to `wait` method
oleg-andreyev Jan 8, 2019
12209e5
updated travis.yml
oleg-andreyev Jan 8, 2019
c00efd4
changed implementation of focus/blur
oleg-andreyev Jan 8, 2019
741cd41
return --network to docker
oleg-andreyev Jan 8, 2019
0959ab8
update .travis.yml
oleg-andreyev Jan 8, 2019
3bba166
dummy commit (trigger build)
oleg-andreyev Jan 8, 2019
35544c1
dummy commit (trigger build)
oleg-andreyev Jan 8, 2019
1bc41c1
fixing build for selenium-firefox:2.53.1
oleg-andreyev Jan 10, 2019
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
75 changes: 51 additions & 24 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,43 +1,70 @@
language: php

sudo: false
dist: trusty

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

addons:
chrome: stable

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

env:
global:
- WEBDRIVER=selenium
- DISPLAY=:99.0
- BROWSER_NAME="chrome"
- DRIVER_OPTIONS='{"args":["headless", "no-sandbox","window-size=1024,768"]}'
- CHROMEDRIVER_VERSION="2.38"
- START_XVFB="0"

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

matrix:
fast_finish: true
include:
- php: 7.0
env: WEBDRIVER=selenium-remote
oleg-andreyev marked this conversation as resolved.
Show resolved Hide resolved
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
# XVFB with regular Chrome (not headless)
- php: 7.2
env:
- DRIVER_OPTIONS='{"args":["no-sandbox","window-size=1024,768"]}'
- START_XVFB=1
# build with lowest deps
- php: 7.2
env:
- DEPENDENCIES="--prefer-lowest"
oleg-andreyev marked this conversation as resolved.
Show resolved Hide resolved
# build with latest chromedriver
- php: 7.2
env:
- CHROMEDRIVER_VERSION="latest"

before_script:
- sh bin/run-"$WEBDRIVER".sh

- composer install
install:
- travis_retry composer update --no-interaction $DEPENDENCIES

# Start a webserver for web fixtures.
- vendor/bin/mink-test-server > /dev/null 2>&1 &
before_script:
- mkdir ./logs
- if [[ "$BROWSER_NAME" = "chrome" && "$CHROMEDRIVER_VERSION" = "latest" ]]; then CHROMEDRIVER_VERSION=`curl -sS chromedriver.storage.googleapis.com/LATEST_RELEASE`; fi
- if [ "$BROWSER_NAME" = "chrome" ]; then mkdir chromedriver; wget -q -t 3 https://chromedriver.storage.googleapis.com/$CHROMEDRIVER_VERSION/chromedriver_linux64.zip; unzip chromedriver_linux64 -d chromedriver; fi
- if [ "$START_XVFB" = "1" ]; then sh -e /etc/init.d/xvfb start; fi;
- ./chromedriver/chromedriver --port=4444 --url-base=wd/hub --verbose &> ./logs/chromedriver.log &
- until $(echo | nc localhost 4444); do sleep 1; echo Waiting for ChromeDriver on port 4444...; done; echo "ChromeDriver started"
# https://bugs.php.net/bug.php?id=71443
- USE_ZEND_ALLOC=0 travis_retry php -d memory_limit=8G -S localhost:8002 -t ./vendor/mink/driver-testsuite/web-fixtures &> ./logs/mink-test-server.log &
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:
- 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/chromedriver.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
php -S localhost:8002 -t ./vendor/mink/driver-testsuite/web-fixtures
oleg-andreyev marked this conversation as resolved.
Show resolved Hide resolved
```
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.

25 changes: 16 additions & 9 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,29 +18,36 @@
"homepage": "http://everzet.com"
}
],

"repositories": [
oleg-andreyev marked this conversation as resolved.
Show resolved Hide resolved
{
"type": "vcs",
"url": "https://github.com/oleg-andreyev/driver-testsuite.git",
"no-api": true
},
{
"type": "vcs",
"url": "https://github.com/oleg-andreyev/php-webdriver.git",
"no-api": true
}
],
"require": {
"php": ">=5.3.1",
"behat/mink": "~1.7@dev",
"instaclick/php-webdriver": "~1.1"
"php": ">=5.6",
"behat/mink": "~1.7@dev",
"facebook/webdriver": "dev-adjust-getRelatedElements"
oleg-andreyev marked this conversation as resolved.
Show resolved Hide resolved
},

"require-dev": {
"mink/driver-testsuite": "dev-master"
"mink/driver-testsuite": "dev-integration-branch"
},

"autoload": {
"psr-4": {
"Behat\\Mink\\Driver\\": "src/"
}
},

"autoload-dev": {
"psr-4": {
"Behat\\Mink\\Tests\\Driver\\": "tests"
}
},

"extra": {
"branch-alias": {
"dev-master": "1.3.x-dev"
oleg-andreyev marked this conversation as resolved.
Show resolved Hide resolved
Expand Down
20 changes: 17 additions & 3 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>

<phpunit colors="true" bootstrap="vendor/autoload.php">
<phpunit
colors="true"
bootstrap="vendor/autoload.php"
>
<testsuites>
<testsuite name="Driver test suite">
<directory>tests</directory>
Expand All @@ -11,15 +14,26 @@
<php>
<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" /-->
<!-- Docker for Mac, see https://docs.docker.com/docker-for-mac/networking/#there-is-no-docker0-bridge-on-macos#i-want-to-connect-from-a-container-to-a-service-on-the-host -->
<!--<server name="WEB_FIXTURES_HOST" value="http://host.docker.internal:8002"/>-->
<server name="WEB_FIXTURES_HOST" value="http://localhost:8002"/>
oleg-andreyev marked this conversation as resolved.
Show resolved Hide resolved

<!--<env name="BROWSER_NAME" value="htmlunit"/>-->

<!--<env name="BROWSER_NAME" value="chrome"/>-->
<!--<env name="DRIVER_OPTIONS" value='{"args":["headless", "no-sandbox","window-size=1024,768"]}'/>-->

<!--<env name="BROWSER_NAME" value="firefox"/>-->
<!--<env name="DRIVER_OPTIONS" value='{"preference": {"general.useragent.override": "x"}}'/>-->

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

<!-- where DocumentRoot of 'Test Machine' is mounted to on 'Driver Machine' (only if these are 2 different machines) -->
<!--server name="DRIVER_MACHINE_BASE_PATH" value="" /-->
<!--server name="TEST_MACHINE_BASE_PATH" value="" /-->

<!--<env name="DRIVER_OPTIONS" value='{}'/>-->
</php>

<filter>
Expand Down
8 changes: 0 additions & 8 deletions src/Resources/syn.js

This file was deleted.

Loading