Skip to main content

An easy to use automated QA testing tool based on QEMU

Project description

miniQA

A simple to use automated QA test tool: miniQA runs an OS of your choice in QEMU, interacts with it based on your YAML test files and ensures the results match your criteria.

miniQA includes a simple web editor/mini IDE providing some helpful tools to write your test cases in quick iterations with the VM screen on the side.

Setup

Via PIP

miniQA can be installed via pip:

pip install miniqa  # - or: `pip install miniqa[ocr]` for text recognition support

Make sure you have the runtime dependencies (qemu-system-x86, qemu-utils and optionally ovmf) installed as well:

  • Debian: sudo apt install qemu-system-x86 qemu-utils ovmf
  • Fedora: sudo dnf install qemu-system-x86 qemu-img edk2-ovmf

To run your tests, invoke this from your tests folder:

miniqa run    # - or: `miniqa editor` for the webui

Via Podman/Docker

Alternatively, miniQA can be used without any installation via podman or docker. The image includes QEMU already. To do so, just invoke a command such as this from your tests folder:

docker run \
    --rm \
    -it \
    --device /dev/kvm \
    --tmpfs /tmp:size=1G,mode=1700 \
    -p 8080:8080 \
    -p 6080:6080 \
    -v .:/tests \
    ghcr.io/mityax/miniqa run    # - or: `miniqa editor` for the webui

Note that the default images include text recognition support; if you don't use that functionality, you can use the ghcr.io/mityax/miniqa:latest-no-ocr image instead, which is just about half the size.

Quick Start

Setup the Files:

This is the directory structure we're going to need:

your_project
├── …
└── tests
    ├── img
    │   └── gnome_os_disk.img
    ├── tests
    │   ├── example_test.yml
    │   ├── second_example_test.yml
    │   └── …
    └── miniqa.yml
  • The img folder: The OS image(s) will be located here. For example, you can grab a copy of GNOME OS Nightly and place it in img/gnome_os_disk.img.

  • The miniqa.yml file: This file contains your overall miniQA configuration and can look like this:

     image: img/gnome_os_disk.img                   # the image our VM boots
    
     use_ovmf: true                                 # required to boot GNOME OS
     qemu_args: [
       "-device", "virtio-multitouch-pci",          # adds multitouch capabilities to the VM
       "-device", "VGA,edid=on,xres=1080,yres=720"  # ensures a fixed screen resolution
     ]
     
     cache_directory: ./miniqa-cache
    
  • The nested tests folder: This will contain your test cases, e.g. example_test.yml, or this one:

    steps:
      - wait:                                      # - wait for boot to complete, and then for the GNOME OS
          for:                                     #   setup wizard (which has gray background) to show up
            dominant_color: '#fafafb' 
          timeout: 120s                            # - on timeout, our test will fail
      - click:                                     # - go to the next page      
          find:
            text: Next
      - snapshot: base                             # - create a snapshot other tests can start from
    

Run your Tests

Now, you're ready to run your first test:

cd your_project/tests
miniqa run

Edit in the Webui

Afterward, you can edit your tests in any editor you like, but I'd highly recommend using miniQA's webui. This way you'll be able to

  • run tests right away,
  • see the VM's screen right next to the YAML editor, and
  • have basic autocomplete making it easy to discover miniQA's features.

The webui also has tools allowing you to easily pick screen positions, regions and colors right from the VM.

To launch it, run:

miniqa editor

Check the Docs

Well, docs might be a bit far-fetched, but there's a bit of reference in ./docs.

The aim is, that this should be enough to easily find your way into miniQA and work with it in the long run; should you have questions or miss anything in there, please don't hesitate to create an issue to get in touch.

Contribute

I'd highly value your contributions – if you'd like to add a new feature or make bigger changes, please create an issue to briefly discuss it upfront, so we can make sure your work is not for nothing; for small fixes feel free to just open a PR.

Please be aware that the codebase is not yet quite as clean as I'd like it to be, since this project was originally just a sidequest and I haven't yet had much time to fully clean it up. However, I'm glad to help you around, should you have questions!

Support

If miniQA is helpful for you, I'd appreciate you supporting me with a small amount. Even a dollar a month helps!

To donate, choose a platform below:

Buy Me a Coffee at ko-fi.com
Recommended! Most payment methods, one-time or recurring donations, no sign up required.

Buy Me a Coffee
Donate by card, no sign up required.

License

This project is licensed under GPL-3.0-or-later.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

miniqa-0.2.0.tar.gz (91.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

miniqa-0.2.0-py3-none-any.whl (109.9 kB view details)

Uploaded Python 3

File details

Details for the file miniqa-0.2.0.tar.gz.

File metadata

  • Download URL: miniqa-0.2.0.tar.gz
  • Upload date:
  • Size: 91.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for miniqa-0.2.0.tar.gz
Algorithm Hash digest
SHA256 367d08693b24c2397df9159431b0840dbb2fcf30a911325c9f9c5aaf8e0e3b65
MD5 701be5c978fbefeab97131c58f4f8b7d
BLAKE2b-256 f698c6afaa82270ea016189f59e48d2ec6215e867e3d8977b72b3eeb2b22e8a4

See more details on using hashes here.

Provenance

The following attestation bundles were made for miniqa-0.2.0.tar.gz:

Publisher: python-publish.yml on mityax/miniqa

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file miniqa-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: miniqa-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 109.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for miniqa-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d39045afb86e8e7f170ffca522b2d0b9416db6d7375b53217f298f4a7708ea8d
MD5 c38310a2faec82b4f7da59c32c4404d3
BLAKE2b-256 c0dcf626460128c62ea6e93d89947a610392d0ba8a9b948b9d45a0a547c4bdcf

See more details on using hashes here.

Provenance

The following attestation bundles were made for miniqa-0.2.0-py3-none-any.whl:

Publisher: python-publish.yml on mityax/miniqa

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page