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

Using with custom server #146

Open
L0rD59 opened this issue Jan 5, 2016 · 8 comments
Open

Using with custom server #146

L0rD59 opened this issue Jan 5, 2016 · 8 comments

Comments

@L0rD59
Copy link

L0rD59 commented Jan 5, 2016

Hi all,

I have a little trouble, my goal is using this lib throught docker and 2 separate containeur (in this case, node container and php container).

From what I could see, the node server and his socket connection are strongly linked (See : https://github.com/minkphp/MinkZombieDriver/blob/master/src/NodeJS/Server.php ).

Can we imagine that the node server is running in one side in node container, and the socket for the driver is running in other side in php container by seperating server & connection concept ?

I've seen this in lastest mink documentation :

http://mink.behat.org/en/latest/drivers/zombie.html#usage

$driver = new \Behat\Mink\Driver\ZombieDriver(
    new \Behat\Mink\Driver\Zombie\Server($host, $port, $nodeBin, $script)
)

but i dont see the Behat\Mink\Driver\Zombie namespace in the library.

I hope I have been understandable.

Thx a lot,

Best regard.

@aik099
Copy link
Member

aik099 commented Jan 5, 2016

There is probably a typo in the docs, because on repo homepage (see https://github.com/minkphp/MinkZombieDriver) the Behat\Mink\Driver\NodeJS\Server\ZombieServer is used.

I haven't tried scenario, where I've specified other then 127.0.0.1 server ip. Maybe it won't even work, because driver starts/stops server as it needs in the process.

@L0rD59
Copy link
Author

L0rD59 commented Jan 6, 2016

Hi,

Thx for reply,

My probleme is the js zombie server file is create by the lib and executing by running node on machine using symfony process. (and it's cool for default server !). But the lib need this default server for create associated socket for the driver.

I hope not to say too much stupidity and have understood the behavior of the lib.

Can we imagine to isolate the instanciation of the socket regarless of the default server and work in this way ?

Thx

@aik099
Copy link
Member

aik099 commented Jan 6, 2016

I understand, that you want to have something like Selenium, where you run a server once anywhere you want and then let driver connect to that.

Not sure if it's possible, because as you mentioned PHP is used all over NodeJS to make it work. Separating them might not be a good idea. We're running & stopping Zombie NodeJS server on the fly, because it keeps state inside it. This way if you start on Zombie NodeJS server and try to use it for several driver runs, then it would probably fail because each run would start where previous run ended.

I have no idea how the Zombie NodeJS server can be started remotely in another Docker container.

@stof
Copy link
Member

stof commented Mar 5, 2016

now that the node script is available as a node.js script (see #162), I have an idea of a refactoring which would allow to use a server started externally instead of managing the process in the driver. This would allow it (you would have to copy the mink-zombie-server.js file in your node container).

The only drawback would be that you would not be able to force strict isolation of your tests (i.e. stopping the session instead of resetting just it), as this involves stopping the driver and starting it again, which stops the process and starts a new one. But if you only use soft-isolation, this would work.

@stof
Copy link
Member

stof commented Mar 5, 2016

Note that this won't be available in the release I will do today. It will be for the next release.

@L0rD59
Copy link
Author

L0rD59 commented Mar 7, 2016

Hi @stof thx for information.

@L0rD59
Copy link
Author

L0rD59 commented Feb 1, 2018

Hi,

Is #162 and #166 fix this ?

Thx

@stof
Copy link
Member

stof commented Feb 2, 2018

#162 was the necessary work to be able to implement my idea to allow that. But it was not the implementation of this idea itself. I actually never worked on achieving this.

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

No branches or pull requests

3 participants