End-to-end tests for edX applications.
UI-level tests for edX applications:
pages
: PageObjects for interacting with pages under test.e2e_test
: Bokchoy tests for the Learning Management System (LMS) and Studio.
We recommend using the provided Vagrant environment to develop and run tests.
- Install Vagrant
- In the edx-e2e-tests directory, execute this command:
vagrant up
- This will create and provision a new Vagrant environment.
- Enter a terminal session in the virtual environment with:
vagrant ssh
You will also need a deployed installation of edX lms and studio to run the tests against. See edx/configuration for instructions on provisioning an edX instance.
- Before running the commands change your working directory to edx-e2e-tests. Note that the 'e2e' python virtual environment will automatically be activated.
cd edx-e2e-tests/
- Update the base python requirements in case they have changed since you created the vagrant environment:
pip install -r requirements/base.txt
- OPTIONAL: Cloning the edx-platform repo into a mounted directory in a vagrant environment can take a long time (several minutes). An alternative is to navigate to the lib directory back on your host system and clone the edx-platform repo there before proceeding.
- Install the page objects for the application from the edx platform repo. This will clone the entire repo into lib/edx-platform so that it can use the page objects and helper methods from common/test/acceptance. We also install capa and xmodule into the virtual environment from common/lib.
paver install_pages
Make sure you are in the correct folder.
cd $HOME/edx-e2e-tests
To run the tests locally, following environmental variables needs to be changed before running tests.
==> BASIC_AUTH_USER
==> BASIC_AUTH_PASSWORD
==> USER_LOGIN_EMAIL
==> USER_LOGIN_PASSWORD
To run all the tests:
paver e2e_test
The commands also accept nose-style specifiers for test case or module:
To run all the tests in the file:
paver e2e_test lms/test_dashboard.py
To run all the tests in a particular class:
paver e2e_test lms/test_dashboard.py:DashboardTest
To run a single test:
paver e2e_test lms/test_dashboard.py:DashboardTest.test_resume_course
To update page objects installed from external repos:
paver install_pages
The code in this repository is licensed under version 3 of the AGPL unless otherwise noted.
Please see LICENSE.txt
for details.
Contributions are very welcome. The easiest way is to fork this repo, and then make a pull request from your fork. The first time you make a pull request, you may be asked to sign a Contributor Agreement.
Please do not report security issues in public. Please email security@edx.org
You can discuss this code on the edx-code Google Group or in the
edx-code
IRC channel on Freenode.