Commit d31b0ee3 authored by LoveIsGrief's avatar LoveIsGrief Committed by James Valleroy

functional_tests: Allow provisioning VM for functional tests

It's now possible to run the tests in the VM more easily
without copy-pasting too much from
`vagrant provision --provisiion-with tests` will take care of the dependencies.

freedombox/plinth#1521 - Provision VM to run function functional tests
Reviewed-by: James Valleroy's avatarJames Valleroy <>
parent 5c2a8c0b
......@@ -169,6 +169,9 @@ executed (red).
### Install Dependencies
**For running tests in the VM** run `vagrant provision --provision-with tests`.
Otherwise follow the instructions below.
$ pip3 install splinter
$ pip3 install pytest-splinter
......@@ -209,7 +212,13 @@ tests will create the required user using FreedomBox's first boot process.
### Run Functional Tests
**When inside a VM you will need to target the guest VM**
export FREEDOMBOX_URL=https://localhost
You will be running `py.test-3`.
$ py.test-3 --include-functional
......@@ -44,6 +44,7 @@ Vagrant.configure(2) do |config|
# Install ncurses-term
DEBIAN_FRONTEND=noninteractive apt-get install -y ncurses-term
config.vm.provision "tests", run: "never", type: "shell", path: "functional_tests/"
config.vm.post_up_message = "FreedomBox virtual machine is ready
for development. You can run the development version of Plinth using
the following command.
set -euo pipefail
echo "Installing requirements"
sudo apt-get install -yq --no-install-recommends \
python3-pytest \
python3-pip firefox \
pip3 install splinter pytest-splinter pytest-bdd pytest-xvfb
echo "Installing geckodriver"
test -e /usr/local/bin/geckodriver && echo "geckodriver already installed" && exit 0
mkdir -p $DL_DIR
cd $DL_DIR
if ! [[ -e $FILENAME ]] ; then
wget --no-clobber \
--continue \
--no-verbose \
tar xf $FILENAME
sudo mv geckodriver /usr/local/bin/geckodriver
echo "Done"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment