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

BehatMage + Vagrant #81

Open
dwickstrom opened this issue Nov 30, 2014 · 4 comments
Open

BehatMage + Vagrant #81

dwickstrom opened this issue Nov 30, 2014 · 4 comments

Comments

@dwickstrom
Copy link

Thinking about it, I'm not sure how using behatmage with a remote (virtual) machine setup would work. Mage::app(); would still be instantiated locally which would quite make sense as you want to test your code in your isolated environment (vagrant machine).

Running behat from within my vagrant machine doesnt feel like an option.

What are your thoughts?

@jamescowie
Copy link
Member

Hello,

So BehatMage will instantiate Mage::app() that means a DB connection among other things will be required. When working in a VM ( Vagrant ) I run Behat on the VM so its no issue for me. However there are limitation, So when using selenium I cant see the browser opening when running the tests as I could if this was local.

There are ways around this, You can set selenium up to forward so it will use your Host machines selenium. However you still need to run Behat on the VM.

You could always create a script on your host machine within the repo to run: vagrant ssh -c "./bin/behat" so that you don't need to be in the virtual machine at all times.

What issues does using the VM face for you ?

@dwickstrom
Copy link
Author

Hi,

Just that - wanting to use fixtures + real browsers. Thanks for the tip. Will specifying the address to selenium running on the host machine in my behat.yml file. Something like this, on the guest machine, maybe:

// behat.yml
selenium2:
    wd_host: "http://10.0.0.2:4444/wd/hub"

Will report back here.

@debo
Copy link
Contributor

debo commented Dec 1, 2014

@dwickstrom as @jamescowie said you will still need to run behatmage within the VM. Your only escape is to have a local.xml behat config that points to the guest db, that also means you have to allow mysql to accept remote connections. Does it make sense?

@dwickstrom
Copy link
Author

@marcodebortoli I'm afraid that confuses me a little. If I am running behatmage on my VM, then which remote database would I have my local.xml point to? Did you mean, if I still want to run behatmage off the host machine, then I could point to the VM db in my local.xml?

Anyhow, I think I am fine running behatmage on the VM, as I've successfully tested connecting to a selenium server on the host machine.

My next quest will be figuring out whether I can use fixtures to do end to end testing through selenium.

Thanks for helping out.

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