Comments (22)
Can you please:
- upgrade your node/npm
- show version of Zombie being used
?
from minkzombiedriver.
you need to run the fixtures server:
vendor/bin/mink-test-server
if you want to block a terminal with it (allowing to stop it withCtrl+C
vendor/bin/mink-test-server > /dev/null 2>&1 &
to run it silently in the background (you then have to find the process id and kill it to stop it)
from minkzombiedriver.
$ git clone https://github.com/minkphp/MinkZombieDriver.git
$ cd MinkZombieDriver/
$ npm install zombie
npm WARN saveError ENOENT: no such file or directory, open '/private/tmp/mink/MinkZombieDriver/package.json'
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN enoent ENOENT: no such file or directory, open '/private/tmp/mink/MinkZombieDriver/package.json'
npm WARN MinkZombieDriver No description
npm WARN MinkZombieDriver No repository field.
npm WARN MinkZombieDriver No README data
npm WARN MinkZombieDriver No license field.
+ [email protected]
added 98 packages in 9.699s
$ composer install
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 5 installs, 0 updates, 0 removals
- Installing symfony/phpunit-bridge (v3.3.2): Loading from cache
- Installing symfony/css-selector (v3.3.2): Loading from cache
- Installing behat/mink (dev-master 9ea1ceb): Cloning 9ea1cebe3d from cache
- Installing mink/driver-testsuite (dev-master 1d2e9fc): Cloning 1d2e9fcef1 from cache
- Installing symfony/process (v3.3.2): Loading from cache
symfony/phpunit-bridge suggests installing symfony/debug (For tracking deprecated interfaces usages at runtime with DebugClassLoader)
symfony/phpunit-bridge suggests installing ext-zip (Zip support is required when using bin/simple-phpunit)
behat/mink suggests installing behat/mink-browserkit-driver (extremely fast headless driver for Symfony\Kernel-based apps (Sf2, Silex))
behat/mink suggests installing behat/mink-goutte-driver (fast headless driver for any app without JS emulation)
behat/mink suggests installing behat/mink-selenium2-driver (slow, but JS-enabled driver for any app (requires Selenium2))
Writing lock file
Generating autoload files
$ node -v
v8.1.0
$ npm -v
5.0.3
(In separate terminal window, to make the server work on my sytem, I had to replace readlink with greadlink)
$ vendor/bin/mink-test-server
PHP 5.6.27 Development Server started at Tue Jun 13 15:22:17 2017
Listening on http://localhost:8002
Document root is /private/tmp/mink/MinkZombieDriver/vendor/mink/driver-testsuite/web-fixtures
Press Ctrl-C to quit.
(In the original terminal window)
$ phpunit --stop-on-failure
PHPUnit 4.5.0 by Sebastian Bergmann and contributors.
Configuration read from /private/tmp/mink/MinkZombieDriver/phpunit.xml.dist
........................E
Time: 152 ms, Memory: 9.25Mb
There was 1 error:
1) Behat\Mink\Tests\Driver\Basic\BasicAuthTest::testSetBasicAuth with data set #0 ('mink-user', 'mink-password', 'is authenticated')
RuntimeException: No connection available. Did you start the server?
/private/tmp/mink/MinkZombieDriver/src/NodeJS/Server.php:441
/private/tmp/mink/MinkZombieDriver/src/NodeJS/Server.php:411
/private/tmp/mink/MinkZombieDriver/src/ZombieDriver.php:197
/private/tmp/mink/MinkZombieDriver/vendor/behat/mink/src/Session.php:159
/private/tmp/mink/MinkZombieDriver/vendor/mink/driver-testsuite/tests/Basic/BasicAuthTest.php:16
FAILURES!
Tests: 25, Assertions: 62, Errors: 1.
Legacy deprecation notices (2)
from minkzombiedriver.
hmm, the driver is not tested with Zombie 5 currently, so it may be broken (I was not aware that they released a version 5). Try with version 4 (use npm install zombie@^4
for the install command).
regarding readlink vs greadlink, this is possible indeed. I actually never tried the server script on Mac OS X (as I don't have such environment). The script was used on Linux for now (I am on Linux, and our CI is as well)
from minkzombiedriver.
I just tried with zombiejs 4.3.0 with the same result.
I have also tried to follow the steps above on a pretty clean apricity linux, using the same node, npm and phpunit versions, the result is the same.
from minkzombiedriver.
Actually I've tried to run it myself now (Zombie 4.2.1, Node 5.4.1, Npm 3.3.12) and it failed with same errors as you've seen. :(
from minkzombiedriver.
@aik099 That's good news to me, so it's not only me ;)
from minkzombiedriver.
Apparently Zombie did change something again to break everything for us.
from minkzombiedriver.
Do the test on your Travis CI still work?
from minkzombiedriver.
I've restarted a couple of jobs from the latest build (1st and last): https://www.travis-ci.org/minkphp/MinkZombieDriver/builds/175044232 . Let's see if they will pass.
from minkzombiedriver.
It did fail in some places, but not that massively as it did when we've executed it locally:
- Zombie 4.3.0: https://www.travis-ci.org/minkphp/MinkZombieDriver/jobs/175044245
- Zombie 3.1.1: https://www.travis-ci.org/minkphp/MinkZombieDriver/jobs/175044233
from minkzombiedriver.
@aik099 Will you be working on this? I fear that my knowledge of this project is not sufficient to effectively address these problems.
from minkzombiedriver.
Unfortunately I'm occupied with other things at the moment.
Here is approach I've used to solve Zombie issues:
- determine Zombie version for which all tests passed (you can get it from last passed build on Travis CI)
- try increasing used Zombie version until problem starts to appear
- see what changes were made to Zombie that might have caused issues with tests
- if it isn't Zombie bug try adopting driver code to work with older and newer version of Zombie
- repeat process until all tests pass for latest Zombie 5 version
from minkzombiedriver.
Ok, after further digging I haven't found a problem with zombie itself, but instead I have found these 2 problems in MinkZombieDriver and Mink:
- Session start: minkphp/Mink@9ea1ceb introduced lazy starting of sessions when calling the visit method. This makes all the tests in
Behat\Mink\Tests\Driver\Basic\BasicAuthTest
create errors. If I add the following code to the top ofBehat\Mink\Session::setBasicAuth
the the tests pass:
// start session if needed
if (!$this->isStarted()) {
$this->start();
}
- HTML5 tests: minkphp/driver-testsuite@55ea007 added 2 new tests for HTML5 form elements. These are not yet fully supported by zombiejs and should therefor be added to the exclude list in
Behat\Mink\Tests\Driver\ZombieConfig::skipMessage
from minkzombiedriver.
1 - that is unexpected considering that according to documentation (see https://github.com/minkphp/Mink/blob/master/src/Session.php#L57-L67) the setBasicAuth
method should work prior to session being started
2 - sure, please send a PR fixing that
FYI: The support for setting authentication headers is currently limited to these drivers:
- ZombieDriver basicAuth: https://github.com/minkphp/MinkZombieDriver/blob/master/src/ZombieDriver.php#L168
- BrowserKit basicAuth: https://github.com/minkphp/MinkBrowserKitDriver/blob/master/src/BrowserKitDriver.php#L192
The BrowserKit is setting headers, that would be picked up upon session start, but the Zombie apparently wants to start session first and then set authentication to be picked up by next visit
call.
from minkzombiedriver.
1 - since apparently Zombie expects session to be started prior to setting auth info we need to do this on driver level instead of session level.
@stof , thoughts?
from minkzombiedriver.
@aik099 For 2. Sure, I created #180
from minkzombiedriver.
@aik099 yeah, it would make sense to start the session at the driver level in this case (the starting actually happens at the driver anyway. Starting a session just delegates starting to the driver)
from minkzombiedriver.
@berliner , does it work for you now, when PR was merged?
from minkzombiedriver.
@aik099 Yes, the test are passing now:
$ phpunit
PHPUnit 4.5.0 by Sebastian Bergmann and contributors.
Configuration read from /private/tmp/mink/MinkZombieDriver/phpunit.xml.dist
............................................................... 63 / 190 ( 33%)
..........................S...S......SSSSS...............SSSS.S 126 / 190 ( 66%)
S.............S..........................S...............S..SSS 189 / 190 ( 99%)
Time: 15.9 seconds, Memory: 11.75Mb
OK, but incomplete, skipped, or risky tests!
Tests: 187, Assertions: 438, Skipped: 19.
Legacy deprecation notices (2)
from minkzombiedriver.
Then you can safely close the issue I guess.
from minkzombiedriver.
Ah, right. Thanks for your support.
from minkzombiedriver.
Related Issues (20)
- Cannot read property 'nodeType' of null HOT 12
- Throw exception, when options are changed on running server HOT 3
- Changing host or port should regenerate server code HOT 2
- The "node_modules" path not validated during server construction HOT 1
- Using "Behat\Mink\Driver\NodeJS\Server::createTemporaryServer" replaces user provided server code HOT 4
- The server should not use a temporary file HOT 2
- The "wait()" does not work, when Zombie has empty event loop HOT 6
- Warning: socket_read(): unable to read from socket [10054]: An existing connection was forcibly closed by the remote host. HOT 10
- How to change timeout? HOT 4
- Zombie Server is still active and listening to port after a Behat exception HOT 2
- Using a local Zombie installation HOT 23
- The PHP 7 tests failing on Travis CI HOT 3
- Update README.md with example of setting options HOT 1
- Driver does not work with Symfony 4.0+ HOT 3
- Fails with latest zombie
- Can't find module HOT 7
- Handle non-ascii characters in url
- SinglePageApplication: Javascript is not executed HOT 4
- Tests failing on ppc64le architecture for master and versions v1.4.0,v1.5.0 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from minkzombiedriver.