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

Mink Zombie driver isn't working #57

Open
Shashikant86 opened this issue Aug 21, 2015 · 6 comments
Open

Mink Zombie driver isn't working #57

Shashikant86 opened this issue Aug 21, 2015 · 6 comments

Comments

@Shashikant86
Copy link

Just trying to run my phpunit tests through Mink and Zombie driver. Here is my config

array(
            'driver' => 'zombie',

            // Defaults for this driver
            'port' => 8124,
            'driverOptions' => array(
                'node_bin' => 'node',
                'server_path' => null,
                'threshold' => 2000000,
                'node_modules_path' => '/Users/path to/node_modules/',
            ),
        ),

I have installed zombie locally with npm and exported NODE_PATH in my .zshrc

When I run my test I get following

PHPUnit 4.5.1 by Sebastian Bergmann and contributors.

E

Time: 4.12 seconds, Memory: 6.75Mb

There was 1 error:

1) BrandingHomeTest::testHomePage
RuntimeException: Server did not respond in time: () [Stopped]

/Users//vendor/behat/mink-zombie-driver/src/Behat/Mink/Driver/NodeJS/Server.php:399
/Users//vendor/behat/mink-zombie-driver/src/Behat/Mink/Driver/NodeJS/Server.php:300
/Users//vendor/behat/mink-zombie-driver/src/Behat/Mink/Driver/ZombieDriver.php:78
/Users/vendor/behat/mink/src/Session.php:70
/Users//vendor/aik099/phpunit-mink/library/aik099/PHPUnit/Session/IsolatedSessionStrategy.php:79
/Users/vendor/aik099/phpunit-mink/library/aik099/PHPUnit/BrowserTestCase.php:289
/Users/HomeTest.php:11
/Users/vendor/aik099/phpunit-mink/library/aik099/PHPUnit/BrowserTestCase.php:371
/Users/vendor/aik099/phpunit-mink/library/aik099/PHPUnit/BrowserTestCase.php:319

FAILURES!
Tests: 1, Assertions: 0, Errors: 1.

I am not sure if I am missing any config ?

Have someone tried that ?

@aik099
Copy link
Member

aik099 commented Aug 21, 2015

'node_modules_path' => '/Users/path to/node_modules/',

You can override this from browser configuration array.

Questions/Ideas:

  1. If used Zombie version is 4.x or higher, then:
    • you need to specify path to IO.JS installation instead of Node.JS installation (I have no idea why "npm install" even gets Zombie 4.x)
    • downgrade to Zombie 3.x or smaller
  2. Does example from https://github.com/minkphp/MinkZombieDriver repo homepage work?

@stof
Copy link
Member

stof commented Aug 21, 2015

@aik099 npm only shows a warning when the engine does not match, but it does not prevent installing it (yeah, I also consider it as WTF)

@Shashikant86
Copy link
Author

@aik099 Given up with this one 'MinkBundle' did good job with phpunit. It didn't count WebAssert assertions but writing another proxy did the job. Works great with GhostDriver + MinkBundle + PHUUnit combination.

@aik099
Copy link
Member

aik099 commented Sep 13, 2015

@Shashikant86 , I don't understand you.

If you have a computer where Zombie + MinkBundle + PHPUnit-Mink are installed and Zombie works in MinkBundle, but doesn't in PHPUnit-Mink, then surely there is something wrong with set of options used to connect to Zombie.

I just wanted for you to print ones used at MinkBundle (at low level where ZombieServer class is created) and do the same for PHPUnit-Mink.

@aik099 aik099 changed the title Mink Zombie driver isn't working with mink-phpunit Mink Zombie driver isn't working May 22, 2016
@rbrisita
Copy link

I am working on a legacy project, introduced functional testing and ran into this issue. There is a SessionProxy used that starts the session on the visit method call. A call like $this->getSession()->executeScript('alert("Hello");') will result on an error that the server didn't start. Either have a static session that stores the visit method result call to use in your tests or always call visit in each test.

@aik099
Copy link
Member

aik099 commented Oct 29, 2019

@rbrisita , That is an expected Mink behavior, where session is auto-started upon page is visited via Session->visit method call. You can't execute any JS on a page until you have actually opened it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants