-
Python 3 (e.g. 3.7)
$ sudo add-apt-repository ppa:deadsnakes/ppa $ sudo apt-get update $ sudo apt-get install python3.7
-
pip:
$ sudo apt install python3-pip
-
Virtual environment for Python
- Installation
$ pip3 install virtualenvwrapper
- Add to file "~/.bashrc"
$ echo 'VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3' >> ~/.bashrc $ echo 'source `which virtualenvwrapper.sh`' >> ~/.bashrc $ source ~/.bashrc
- Create your own virtualenv:
$ mkvirtualenv qa-has-power -p `which python3.7`
- Switch to your virtualenv
$ workon qa-has-power
- Installation
-
Requirements:
- Behave and Selenium (installation from requirements):
$ pip install -r requirements.txt
- Behave and Selenium (installation from requirements):
-
Chrome and chromedriver
$ wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb && dpkg -i google-chrome-stable_current_amd64.deb; apt-get -fy install $ wget -O /tmp/chromedriver.zip http://chromedriver.storage.googleapis.com/73.0.3683.68/chromedriver_linux64.zip && sudo unzip /tmp/chromedriver.zip chromedriver -d /usr/local/bin/ && sudo chmod 755 /usr/local/bin/chromedriver;
-
Docker installation:
$ ./install_docker.sh
-
Give access to show windows run in Docker
$ xhost +local:root
-
Build docker image
$ docker build -t docker_tag .
-
Run docker image
$ docker run -it -v $PWD:/usr/src -v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY=$DISPLAY -t docker_tag bash
- Run test file to check if your environment is ready to use:
- For virtualenv - with virtualenv switched on
$ python ./check.py
- For Docker - inside the docker container (after command $ docker run...) :
$ python check.py
- For virtualenv - with virtualenv switched on
- Run tests:
$ behave
- To debug during implementation - you can use ipdb,
- Put this lines before line with error:
import ipdb ipdb.set_trace()
- Run tests with parameter:
$ behave --no-capture
- Tests should stop in correct place, there should be possible to n
- Put this lines before line with error: