Skip to main content

A LabVIEW User Interface Testing framework.

Project description

LabVIEW User Interface testing

The aim of that package is to create LabVIEW User Interface testing through scripts through pyTest.

Requirements

This package allows python to communicate with the LabVIEW package "ui-testing". You need to have that package installed within your LabVIEW IDE and have the main.vi put in your top VI.

Documentation

Examples can be found on the wiki of the project.

The following example will set a value to control labelled "myNumber", the boolean indicator "greater" should be TRUE when myNumber is > 5.

NOTE: Even tough it's recommended to start the VI first, it should also work as the python script is waiting to connect to it.

# Start the VI "example 2 - value" first then run that script
from lv_ui_testing import ui_testing
import pytest

def test_front_most_vi():
    # Ask the tester daemon what is the front most VI
    front_most_vi = ui_testing.FMV_get_vi_name()
    assert front_most_vi == "example 2 - value.vi"

@pytest.mark.parametrize("number, expected_bool", [ (x, x > 5) for x in range(1, 11)])

def test_set_value(number,expected_bool):
    # Set value to 0
    ui_testing.FMV_set_value_DBL("myNumber", number)
    data_number = ui_testing.FMV_get_value_DBL("myNumber")
    data_bool = ui_testing.FMV_get_value_bool("greater")

    assert data_bool == expected_bool
    assert data_number == number

Run the following command in your command line:

python -m pytest example2.py

You should see the following test happening:

Example 2

License

Distributed under the MIT License. Copyrights Thomas Zilliox and others.

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

lv_ui_testing-1.1.1.tar.gz (7.4 kB view details)

Uploaded Source

Built Distribution

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

lv_ui_testing-1.1.1-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

Details for the file lv_ui_testing-1.1.1.tar.gz.

File metadata

  • Download URL: lv_ui_testing-1.1.1.tar.gz
  • Upload date:
  • Size: 7.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.10.7

File hashes

Hashes for lv_ui_testing-1.1.1.tar.gz
Algorithm Hash digest
SHA256 e3efdb45350e5f4e2791637b8d95d1400a64ac5b4af693d089a41b5f8d7c91e4
MD5 0751500b640addc30a079380ac7e90d8
BLAKE2b-256 e9989456587bd74db207ba26b1ca79c4ad04f0d8a4602bc9c7ea2d2b8d14f754

See more details on using hashes here.

File details

Details for the file lv_ui_testing-1.1.1-py3-none-any.whl.

File metadata

  • Download URL: lv_ui_testing-1.1.1-py3-none-any.whl
  • Upload date:
  • Size: 5.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.10.7

File hashes

Hashes for lv_ui_testing-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3b6656f1de5f53ab0e81d9e963b44f6bc05055c76a1694c2b0a35193160ed0ee
MD5 a6c62c685be508fca26b6bf73794daf2
BLAKE2b-256 9211c8b5aca9b8ac28d2a89eca95309724bfbaf5e54a84953fca01d797d18b12

See more details on using hashes here.

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