Getting fast-forward with Pytest and Selenium

In a previous tutorial, we configured everything from scratch. In this one, we will check out a project from GitHub that has the preconditions for executing almost right-at-the-bat. The difference here will rely on project initialization.

Note: Git should be installed and configured in the PATH. If not, you can follow the following tutorial.

Step-by-step guide:

Note: ChromeDriver is required to be downloaded and added to the PATH environment variable in windows. To do that, follow the next resource.

Install Python

  1. Go to the Python site and hit download to the latest version available.
  2. Once the download is complete, proceed with the installation. Consider including the executable in the Windows PATH location. That is in one of the steps of the installation wizard.
  3. A computer restart might be required. To check if Python was added to your PATH, open a Power Shell console and just type and hit enter:
    python
    
    If a bunch of messages is displayed indicating that parameters are missing, then you are good to go, otherwise, a computer restart is mandatory.

Next up: Install the IDE

Install PyCharm

  1. Go to the Jetbrains site and hit download to the latest version available.
  2. Once the download is complete, proceed with the installation.

Next up: Checking out the project

Checking out the project

  1. Create a new folder where you want to download the repository.
  2. Inside the folder right-click -> Open PowerShell window here
  3. Once the PowerShell console is open, type:
    git clone https://github.com/waltervr/pylenium.git
    
  4. That will download the project

Next up: Open and set up the project

Open and set up the project

  1. Open PyCharm
  2. Click on File -> Open and search for your project and select to open
  3. To be able to install all dependencies in fast-forward mode, pipenv is required. For more information about pipenv, please visit this video. In the terminal, execute the following command:
    pip install pipenv
    
  4. Now its time to install the dependencies in a fast-forward mode thanks to the pip file in the project
  5. Open the terminal within Pycharm and execute: pipenv install
  6. That should install pytest and selenium and you should be ready to run your project with pipenv run python -m pytest