Only available on *dev* environments
On the frontend, to launch the functionals tests:
$ cd /opt/irma/irma-frontend/current/web $ npm run functional-tests
IRMA scenarios can be found in
actions used to perform these steps are available in the file
When an error occured, you will get a screenshot of the page where the scenario
ends. It will be available on the VM at
Using the headless mode of Chromium, it will be difficult to debug if an error occured.
- You can launch the test using a real Chromium instance on your host:
Install IRMA web interface devDependencies on your host
$ cd frontend/web $ npm install --only=dev
frontend/web/tests/functionals/support/steps.js) variable to the location of your IRMA web url (for example:
const ROOT_URL="http://172.16.1.30") and toggle the
Run the tests:
$ npm run functional-tests
You can also use the power of X11 Forwarding through SSH to see a real browser launching the tests on the VM and getting the result on the host, without having to install NodeJS:
$ vagrant ssh # to connect as vagrant user/superuser $ sudo apt-get install xorg # to install a X11 server to launch Chromium $ sudo sed -i "s/^X11Forwarding .*/X11Forwarding yes/" /etc/ssh/sshd_config $ sudo systemctl restart sshd $ exit # disconnect from vagrant user $ vagrant ssh -- -l deploy -X # to connect as deploy with XForwarding enable $ cd /opt/irma/irma-frontend/current/web $ sed -i "s/^const HEADLESS = true;/const HEADLESS = false;/" tests/functionals/support/hooks.js $ npm run functional-tests
You should see an instance of a Chromium browser on your host machine, running the tests.
Take a look at the argument pass to the
puppeteer.launch() function in
frontend/web/tests/functionals/support/hooks.js. For example, by modifying
SLOW_MOTION_DELAY you can force Puppeteer to slow down its operations.