behat install problem

Re: behat install problem

by Rajesh Taneja -
Number of replies: 2

Aha, docker. 


As localhost within docker means different than on the host, it will only work if you pass ip so when selenium open browser within docker it should be able to access moodle site.

Also, above will fail for scenarios with @_file_upload tag as the file doesn't exist within docker. To make @_file_upload pass you need to share moodle path within your selenium docker at same location.


FYIhttps://github.com/rajeshtaneja/docker/ might help you running your tests using docker.

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

Re: behat install problem

by Xavier Brosseau -

At this point you've been really helpfull an i thank you for that.

Now if you could help me about giving acces of my moodle to the docker that be very great !

Is there some sort of configuration somewhere ?

The docker i use is the one in the acceptance testing tutorial from moodle:

https://docs.moodle.org/dev/Acceptance_testing#Selenium_docker_images

"docker run -d -p 4444:4444 selenium/standalone-firefox:2.53.1-beryllium"


Thank you again smile

In reply to Xavier Brosseau

Re: behat install problem

by Rajesh Taneja -

My docker instance is rajeshtaneja/selenium:2.53.1 to execute this:

  • Set $CFG->behat_wwwroot = 'http://{IP_ADDRESS}/im';
  • docker run -ti -p 4444:4444 -v {ABSOULET_PATH_OF_MOODLE_INSTANCE}/:{ABSOULET_PATH_OF_MOODLE_INSTANCE} rajeshtaneja/selenium:2.53.1
  • Now initialize behat
  • Run behat . Test this with --tags=@_file_upload first.

NOTE:

  1. Selenium docker -v should have absolute path, as link will not work.
  2. host path should terminate with /, else mapping will not be correct.