Testing and QA

 
 
Picture of David Scotson
Running Selenium Tests Headless
Group DevelopersGroup Documentation writersGroup Particularly helpful Moodlers
Is anyone running the selenium tests headless? That is, on a server box. I'm using Xvfb and the FirefoxDriver and it doesn't seem to be finding the display I set up. I get the feeling that I'm doing something silly and it's close to working but I thought maybe someone else might have done this before?

regards,

dave
 
Average of ratings: -
Picture of Jean Michel
Re: Running Selenium Tests Headless
 

I recommend you take a look into the next link, it's not selenium but maybe could be useful for your goal:

https://github.com/dmonllao/behat-moodle/blob/master/README.md

Regards.

 
Average of ratings:Useful (1)
Picture of David Monllaó
Re: Running Selenium Tests Headless
Group DevelopersGroup Moodle Course Creator Certificate holdersGroup Moodle HQGroup Particularly helpful MoodlersGroup Testers

Hi,

At HQ we are working on acceptance testing both with headless browsers and regular browsers (using selenium webdriver) through behat and mink APIs, specifying the tests using a BDD syntax. The integration with Moodle is currently a "work in progress" the idea is to allow components and plugins to specify funcional tests like they do with phpunit.

More info in http://docs.moodle.org/dev/Acceptance_testing

 
Average of ratings:Useful (3)
Picture of David Scotson
Re: Running Selenium Tests Headless
Group DevelopersGroup Documentation writersGroup Particularly helpful Moodlers
Does this mean the java written test are officially deprecated, and the way forward is Behat and Mink?

I have to say I much prefer the Behat and Mink APIs so very am happy if they're the standard solution.

I had thought about rewriting the existing Java Selenium tests in Behat just to learn more about Behat (and to help test some renderers I was writing). Is there an official repository of tests yet that I could build on and contribute to (even if it's still in an alpha state), most of the documentation suggests that it's not quite got started yet but I'm happy to work on something half-finished if it's the way forward.
 
Average of ratings: -
Picture of David Monllaó
Re: Running Selenium Tests Headless
Group DevelopersGroup Moodle Course Creator Certificate holdersGroup Moodle HQGroup Particularly helpful MoodlersGroup Testers

Hi David,

Yes, we will go with Behat and Mink instead of the Java tests.

At the moment there are two issues and nothing is definitive. We are still deciding how to integrate Behat in Moodle (http://tracker.moodle.org/browse/MDL-35611) and on top of this issue there is the creation of basic steps and steps to group common tasks (http://tracker.moodle.org/browse/MDL-36269) which also needs more discussion and integrators approval.

You can checkout the work being done in https://github.com/dmonllao/moodle/tree/MDL-36269_master (this branch is on top of MDL-35611_master branch) is stable and the javascript tests are optional to allow execution without selenium dependencies but I would not recommend to work on top of it because the APIs and steps can change and our intention is to create a set of high-level steps to avoid tedious tests and allow the selection of site presets, so most of the tests created on top of this base will be easier to create once we have high-level steps definitions.

 
Average of ratings: -
Picture of Jean Michel
Re: Running Selenium Tests Headless
 

Hola David,

I'd like to start using Behat-Moodle to do my development and tests. I know it's a work on progress... so can I use it right now?

By the way, I've using the repo: 

So, what is the goal of the next projects? I mean, Are they necessary?:

Gracias y un saludo!

Juan

 

 
Average of ratings: -
Picture of David Monllaó
Re: Running Selenium Tests Headless
Group DevelopersGroup Moodle Course Creator Certificate holdersGroup Moodle HQGroup Particularly helpful MoodlersGroup Testers

Hola Juan,

Thanks for asking because there were different projects, things changes fast, and it can be confusing. The main documentation page always up-to-date with the dev. status is http://docs.moodle.org/dev/Acceptance_testing

  • moodle-behat-features: Was the first approach, you can use the steps provided by Behat and other libraries, don't take it seriously please, use it as a playground, the second one is much better smile
  • http://tracker.moodle.org/browse/MDL-36269: Is the work in progress branch with tests, you can play with it and make an idea of how it works, but at the moment there are not enough steps definitions to test complex features, we are trying hard to make it very easy to use for devs. and for tests writers.

The behat-moodle project was part of the second option, but we found a better way to manage it and now is useless (in fact I've just deleted the project from my github account)

You can use it and all the feedback you can provide will be very appreciated smile but consider that it's not even integrated in master (future Moodle 2.5) so there can be changes. The main tracker issue is: http://tracker.moodle.org/browse/MDL-35611

Saludos,

David

 
Average of ratings:Useful (1)
Picture of Joseph Rézeau
Re: Running Selenium Tests Headless
Group DevelopersGroup Particularly helpful MoodlersGroup TestersGroup Translators

Thanks to the two Davids I just learned a new - to me - concept, headless browser.

Joseph

 
Average of ratings: -