Chamilo is a learning management system focused on ease of use and accessibility
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
chamilo-lms/tests/behat
Borja Sánchez 240b2ab5f3 System: Change field to find 3 years ago
..
features System: Change field to find 3 years ago
uploadable_files Behat add test to check exercises with questions by categories 7 years ago
README.md Testing: Make Behat environment setup doc clearer 4 years ago
behat.yml Minor - Add create user via CSV behat test 8 years ago

README.md

In order to run behat tests locally with the right support for browser and JS environments under Linux, you will need to:

  • Have Java (or OpenJDK) installed.
# On Ubuntu, this might look like this:
sudo apt install openjdk-11-jre-headless
#Example:
wget https://selenium-release.storage.googleapis.com/3.141/selenium-server-standalone-3.141.59.jar
java -jar selenium-server-standalone-3.141.59.jar

This has to keep running for the duration of your tests, so launch it in a separate terminal, in a screen or in any equivalent context.

  • Install google-chrome (stable version, not beta or dev).
# on Ubuntu, you might use something like this:
wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | sudo apt-key add 
sudo sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list'
sudo apt update
sudo apt install google-chrome-stable
# check in the download info which version of the browser you are downloading,
# as the chromedriver in the next step needs to be the same version
cd /tmp && wget https://chromedriver.storage.googleapis.com/85.0.4183.83/chromedriver_linux64.zip && unzip chromedriver_linux64.zip && sudo mv chromedriver /usr/local/bin
  • Test if chromedriver is working correctly, the result should be something like:
chromedriver --version
ChromeDriver 92.0.4515.43 (8c61b7e2989f2990d42f859cac71319137787cce-refs/branch-heads/4515@{#306})

Chamilo configuration

  • An administrator user should be created with these parameters:

    • Username "admin"
    • Password "admin"
    • First name "John"
    • Last name "Doe"
    • user_id = 1 (this one is set when you install Chamilo, but just in case...)
  • Edit the tests/behat/behat.yml file and update the base_url param with your own Chamilo local URL.

  • The main platform language and the admin user's language must be English (platformLanguage = english and admin user profile)

  • Social network tool must be available (allow_social_tool = true)

  • Student can register to the system (allow_registration = yes)

  • Teacher can register to the system (allow_registration_as_teacher = yes)

  • The CHECK_PASS_EASY_TO_FIND in app/config/profile.conf.php must be set to false

Run tests

To run all features:

# /var/www/html/chamilo
cd tests/behat
 ../../vendor/behat/behat/bin/behat -v

To run an specific feature:

../../vendor/behat/behat/bin/behat features/course.feature