I'm using tox to run protractor tests which will test an application which uses django+angularjs, there is a glue library (django-protractor) which makes this easier, except that it makes the call to protractor inside a django management command, and relies on $PATH to show it where protractor is.
So if I set the $PATH properly before running tox, it works fine, but I'd rather not require all the devs to do that manually.
To use environment variables tox provides the syntax {env:VARIABLE}. To set them tox provides the setenv section.
These can be used together to modify the PATH variable that can be used by commands:
[testenv]
setenv =
  PATH = {env:PATH}{:}/path/to/protractor
commands = 
  echo {env:PATH}
Another option that might work in some cases is symlink or download the binary in a writable path of the PATH, hopefully we always have one available: the virtual environments' binary folder, which is {envbindir} in tox.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With