Moodle Behat testing under a CI server

Moodle Behat testing under a CI server

by Neill Magill -
Number of replies: 4
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers
I'm currently working on building a CI server so that we can do nightly runs of our Behat and unit tests.


The Unit tests seem fairly straight forward to get working and reporting, however it would be great to get some advice on how to get Behat tests running especially the @javascript ones.

Average of ratings: -
In reply to Neill Magill

Re: Moodle Behat testing under a CI server

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

I am not an expert on the CI aspect of that, but I don't think it is fundamentally different from what it says on https://docs.moodle.org/dev/Acceptance_testing for getting it working on your own computer. (If you have not already done so, getting it working on your own computer would obviously be the best place to start.)

I hope you get a real reply from someone who has actually done this.

In reply to Tim Hunt

Re: Moodle Behat testing under a CI server

by Neill Magill -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers

I have behat working on my own system

I was trying and failing so far to get it working via Jenkins on my dev PC (but some of my issues with that may just be that it is a windows based system)

In reply to Neill Magill

Re: Moodle Behat testing under a CI server

by Rajesh Taneja -

Hello Neill,

If you plan to run behat on CI server, then you should look at executing tests headlessly using xvfb.

  1. Install xvfb 
  2. Run selenium using xvfb 
    • xvfb-run -a java -jar PATH_TOSELENIUM/selenium-server.jar
  3. Run behat