Add functional/e2e UI tests
We already have e2e test for the cli, but here the idea is to automatically test the UI of bitmask for it's functionality. I.e.
- launch bitmask
- sign in as a registered user @ci.leap.se
- start vpn
- see if egress IP changes as expected
- turn it off
- log out
jadajada and more.
At pixelated we used behave[0] together with phantomjs and chrome-driver for the tests. See how to run them in a vagrant box (some components are mocked though)[1], or the output of the last CI tests (see the "make functional_tests_ci" section)[2].
There is also an example of simple smoke test collection (in gherkin language)[3].
I went ahead and created a first functional ui test in my "functional_tests" branch.
See this Readme how to setup/run the tests: https://0xacab.org/varac/bitmask-dev/tree/functional_tests/tests/functional
It's a rough proof of concept, in order to go further we need all buttons to have unique identifiers (best would be to add an id) to all buttons, so we can detect them better. Maybe there's a way to do so right now but my limited js/css skills didn't let me succceed.
[0] http://pythonhosted.org/behave/
[1] https://github.com/pixelated/pixelated-user-agent/wiki/Running-Tests#functional
[2] https://circleci.com/gh/pixelated/pixelated-user-agent/269