To install Pyroute you may choose one out of three different options:
- Pipenv
- Vagrant
- Docker
- Clone this repo, we use
developbranch for development. - Install pipenv on global python from your machine
pip install --user pipenv - Run
pipenv --three - Run
pipenv install '-e .' --dev - Go to your ~/.bashrc or ~/.zshrc
- Edit the file and issue these commands to setup an alias
- Restart your terminal
This works with zsh shell:
# ——— PYROUTE ——— #
export PYROUTEPATH=$HOME/Projects/pyroute
pyroute_activate(){
ssh-add ~/.ssh/id_rsa
cd $PYROUTEPATH
pipenv shell
}
alias pyrouteenv=pyroute_activate
-
Create a test folder in different location than pyroute code
-
Create a subfolder named
config -
Create a
config.jsonfile, copy and save the following to it:
{
"tests": {
"path": [
"tests/sprint01_features"
],
"preffix": "test_",
"data": "$PATH"
},
"modules": {
"REST": {
"timeout": "50000",
"endpoint": "http://google.com",
"reset_headers": "True",
"otro_param": "here"
},
"SSH": {
"computer": "computer_Service"
}
}
}
-
Create a
pyroute_tests_folderfolder -
Create a file named
features.py -
From this folder you're going to run
pyroute runcommand
Install Vagrant and Virtual Box
- Install vagrant using the commands
wget https://releases.hashicorp.com/vagrant/1.9.3/vagrant_1.9.3_x86_64.deb
sudo dpkg -i vagrant_1.9.3_x86_64.deb
- Install VirtualBox using the command
sudo apt-get install virtualbox - Install the vagrant box
ubuntu/xenial64using the commandvagrant box add ubuntu/xenial64
Set Up Pyroute with Vagrant
- Clone this repo, we use
developbranch for development. - From the cloned repo run
vagrant upthis will setup everything (It will take some time to install everything) - Once everything is installed run
vagrant sshto log into the machine
Run the first Pyroute Test
- Open a new Terminal in your Local Machine
- Run selenium standalone in your local machine using the following command
java -jar selenium-server-standalone-3_X_X.jar -role node -hub http://10.0.0.10:4444/grid/register - Go to the terminal where your virtual machine is logged in and type
pyrouteenv - Go to the directory /Test using the command
cd Test - Once the standalone is up and you are placed in the correct directory use:
pyroute run - This will run your first test.
NOTE
- Selenium Standalone Server must be up to date or at least 3.5.0 (On your local machine)
- Selenium Standalone is running on the background (On your virtual machine)
- To turn off Selenium Standalone run
ShutdownSelenium(On your virtual machine) - If Selenium Standalone is not running or you Shut it down, just run
SeleniumOnto turn it on again. (On your virtual machine)