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:
License
Distributed under the MIT License. Copyrights Thomas Zilliox and others.
Metadata
Release files for lv-ui-testing 2.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| lv_ui_testing-2.4.0.tar.gz | 10.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| lv_ui_testing-2.4.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 23.8 kB
Release files / lv_ui_testing-2.4.0.tar.gz
| Download URL | lv_ui_testing-2.4.0.tar.gz |
|---|---|
| Size | 10.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9435ba95b28d9ac976fcce77ff311ffc99b22d2cbb5c23593283eb7cbeda88f7
|
|
BLAKE2b-256 checksum How to use checksums |
d26b4652ec3616c0d6b81c8af5dd26ca7893c326b266dee36fece3449f197fb5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.10.7
|
Release files / lv_ui_testing-2.4.0-py3-none-any.whl
| Download URL | lv_ui_testing-2.4.0-py3-none-any.whl |
|---|---|
| Size | 13.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e3c09323e85cdd5f04a46d05403d2fa69c8a2c707278162efb2ee4e10ca81cf2
|
|
BLAKE2b-256 checksum How to use checksums |
414ff8d2331a9c75013ce4f59b5fbe089dabb8b8bad6d0342b54e2cd43021d28
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.10.7
|