Help with setting up Behat on a Mac

Help with setting up Behat on a Mac

by Mike Churchward -
Number of replies: 5
Picture of Core developers Picture of Plugin developers Picture of Testers

Hi All -

I'm trying to set up Behat/Selenium on my Mac. I am following the instructions on the Acceptance Testing page, but I'm obviously missing something.

I can run the command line successfully using "vendor/bin/behat --config [path to my tests]", and I can see the results from that in the command shell. I have also started the Selenium server from the Java Jar.

But, how do I see the tests run in the browser? From what I read, the browser should just open when I run the behat command?

mike

Average of ratings: -
In reply to Mike Churchward

Re: Help with setting up Behat on a Mac

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Try these instructions: https://gist.github.com/danpoltawski/8036489

(Someone really needs to edit those into the Moodle docs wiki page, which needs a good clean-up.)

In reply to Tim Hunt

Re: Help with setting up Behat on a Mac

by Mike Churchward -
Picture of Core developers Picture of Plugin developers Picture of Testers

Thanks Tim.

I had found those instructions in another post somewhere. Looks like it was the "@javascript" suggestion below.

mike

In reply to Mike Churchward

Re: Help with setting up Behat on a Mac

by Gregory Faller -

Hi Mike,

I ran a single behat test recently that did not require javascript and the browser didn't display while running this test. Adding a '@javascript' tag caused the browser window to open. Not sure if that explains your situation?

Greg

Average of ratings: Useful (1)
In reply to Mike Churchward

Re: Help with setting up Behat on a Mac

by Rajesh Taneja -

Hello Mike,

Gregory is correct, if you are running a test which doesn't have @javascript tag then it uses goutte driver and not selenium driver, that means no browser will open.

Can you please try running the test with --tags @javascript 


Average of ratings: Useful (1)
In reply to Rajesh Taneja

Re: Help with setting up Behat on a Mac

by Mike Churchward -
Picture of Core developers Picture of Plugin developers Picture of Testers

Bingo!

Thanks Gregory and Rajesh. Adding "@javascript" to the script made it work.

mike