Skip to content

openbraininstitute/sbo-qa-automation

Repository files navigation

UI Tests with Selenium Python Pytest

Documentation

Features

  • The tests use setup/teardown methods for the session.
  • Test with Chrome and Firefox (also in headless).
  • Possibility to visually see the execution.
  • Possibility to see the screenshots of the errors.
  • A html report generated at each test run.

Important Notes for Forked Repositories

If you’ve forked the repository, make sure to sync it with the original repository:

Sync Your Fork:

git remote add upstream git@github.com:openbraininstitute/sbo-qa-automation.git
git fetch upstream
git checkout main
git merge upstream/main

Push Your Changes:

git push origin main

Install

Prerequisites

  • Python 3.x installed
  • pip package manager installed
  • Make sure pip is installed in your system (please see the instructions below).
  • Install virtual environment.
  • A json file with login credentials would need to be created.

** Linux/Unix: **

  • Run:
sudo apt update && sudo apt install python3-pip

Install uv

Before setting up your virtual environment, make sure to install uv. Follow these steps:

  • For Linux and macOS:
curl -LsSf https://astral.sh/uv/install.sh | sh
  • Alternatively, with Homebrew (macOS):
brew install uv
  • With Pip (cross-platform):
pip install uv

Create the virtual environment

Using uv (recommended):

uv venv -p 3.11

Alternatively, using virtualenv:

Windows/Linux/Unix

  1. Install virtualenv if not already installed:
    pip install virtualenv
    
    or use Python's built-in venv module:
    python -m venv myenv
    
  2. Create a virtual environment:
    virtualenv myenv
    
  3. Activate the virtual environment:
    • Windows:
      myenv\Scripts\activate
      
    • Linux/Unix:
      source myenv/bin/activate
      
  4. Upgrade pip:
    python -m pip install --upgrade pip
    
  5. Install project dependencies
    uv pip install -r requirements.txt
    

Make sure to replace myenv with your preferred name for the virtual environment.

JSON File for Login Credentials

  • Create a JSON file with login credentials to authorize test execution.

Running Tests & Linting with Makefile

  • The purpose of the Makefile is to simplify the execution of commands.
  • Please refer to the instructions for running the tests.

Navigate to the directory containing your test files.

Run Tests in Production environment:

make production

This command is equivalent to:

uv run pytest tests/test_file.py --env=production --env_url=production -sv --browser-name=firefox --headless

Run Tests in Staging:

make staging

Run Tests in Sauce-Labs:

make sauce-labs

Test Artifacts, Logs, and Reports

  • Screenshots (in case of test failures) are stored in the latest_logs/errors directory.
  • Logs are stored in the latest_logs directory.
  • Reports generated by pytest are stored as HTML files in the latest_logs directory, with filenames indicating the environment and browser used. These files are created during the test run and can be found in the GitHub Actions workspace for further investigation.

The current execution run tests on:

Homepage

  • The display of:
    • Main titles
    • Small titles
    • Top nav buttons
    • Logos

Explore

  • The display of:
    • Titles, eg. experimental data types, model data etc.
    • Number of records (resources)
    • Neurons panel & m-types
    • 3D Atlas (fullscreen)
  • Searching for a specific brain region

Explore experimental data tabs:

  • Morphology
  • Electrophysiology
  • Neuron density
  • Model data page
    • The display of column headers
    • Ticking check boxes
    • Using the free text search and the filter for searching for M-types
    • Verifying the presence of thumbnails
    • Clicking on rows to see the detail view
    • Verifying the presence of detail view headers and metadata

Spelling/Links

This README file has been checked for spelling errors and links have been verified.

Acknowledgment

The development of this software was supported by funding to the Blue Brain Project, a research center of the École polytechnique fédérale de Lausanne (EPFL), from the Swiss government's ETH Board of the Swiss Federal Institutes of Technology.

Copyright © 2024 Blue Brain Project/EPFL

Copyright © 2025 Open Brain Institute

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages