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

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

Now, you can just run your tests by running 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 \
    miniqa run    # - or: `miniqa editor` for the webui

Quick Start

Setup the Files:

In your project, create a tests folder. Everything miniQA will live in this folder. In this folder, you need to create:

  • An img folder: Here, the OS image(s) will be located. For example, you can grab a copy of GNOME OS Nightly and place it in img/gnome_os_disk.img.

  • A 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
    
  • A 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
    

Your overall directory structure should now look like this:

your_project
├── …
└── tests
    ├── img
    │   └── gnome_os_disk.img
    ├── tests
    │   ├── example_test.yml
    │   ├── second_example_test.yml
    │   └── …
    └── miniqa.yml

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.1.0.tar.gz (91.3 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.1.0-py3-none-any.whl (109.6 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for miniqa-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d50ae5743beac5a741c101a65ecbc5d883079be27393f22a736cacdfe39f2fba
MD5 1e765d7fd0c787a69329aa83fb17e452
BLAKE2b-256 62a42cc9a8018f3afb10ea1dc7b4042936578b38609e7210b2c04b961d73e076

See more details on using hashes here.

Provenance

The following attestation bundles were made for miniqa-0.1.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.1.0-py3-none-any.whl.

File metadata

  • Download URL: miniqa-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 109.6 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.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bb7cd610c0dd80705365e024827200d1e65a106c334796f33776468744fcabca
MD5 e2a0b5e2de034173e77518c3a3356d79
BLAKE2b-256 f64dbcd74c563279c09256354a86368c0c9ab5b7fe80f46362f9667dd6e22049

See more details on using hashes here.

Provenance

The following attestation bundles were made for miniqa-0.1.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