htf - Hardware Testing Frameworkο
htf is a professional Hardware Testing Framework based on Python to easily realize Automated Hardware Tests. It has a strong focus on reporting, industrial applications and functional safety and integrates seamlessly with Continuous Integration and Continuous Delivery as well as end-of-line testing systems.
What makes htf special?
It is validated and certified for ISO/TR 80002-2: Medical device software - Part 2: Validation of software for medical device quality systems (see also certifications documentation).
It allows you to build teststands using Python-based tests for realtime testing with diverse hardware (PLC, Development-Boards, PyVisa, Arduino etc.).
It supports Behaviour Driven Development (BDD) to write low-code tests without prior coding experience.
It enables you to implement powerful tests in plain Python, too.
It provides you with the possibility to run interactive testing in case full automation is not possible and manual tests are required.
It produces visual Test Reports which can be showed to your clients or stakeholders.
It integrates seamlessly with QABench, which means it works smoothly with our Dashboard, allowing for easy management and tracking of requirements coverage.
It can be used for free with the community edition.
The framework can be easily extended to your liking, either by yourself or with our support. If you need help or have questions of any kind, send us an e-mail.
If you prefer video showcases, take a look at our demo.
Test Examplesο
Behavior Driven Development:
Feature: Device Boot
Requirements: REQ-Boot-1
Tags: boot
Scenario: Boot Device
Given the device is shut down
And the power supply is set to 0 V
When the power supply is switched 24 V
And the power button is set to on
Then the device boots up
And the device is be running after 10 seconds
Python:
@requirements("REQ-Boot-1")
@tag("boot")
async def test_boot(device, power_supply, delay):
"""
This tests checks that the device can be booted.
"""
with step("Shut down device"):
await device.shut_down()
await power_supply.power_off()
with step("Switch on device"):
await power_supply.power_on()
await device.switch_on()
with step("Check that the device boots up within 10 s"):
delay(10)
assert_true(device.is_up_and_running(), "The device did not boot up within 10 s")
Getting Startedο
To get started, take a look at the installation instructions, the introduction and how to write tests, fixtures and available test reports.
Learn how to run tests from the command line and Python scripts.
If you prefer a more guided introduction take a look at our HILSTER Testing Framework Demonstrator.
Exampleο
import htf
def test_example(step, assertions, attachments, threads):
with step("Tests can be structured with steps"):
assertions.assert_true(True, "This step succeeds")
with step("Attach a file if the outer step succeeds"):
attachments.attach_file("graph.png", "Important graph")
with step("Run something in the background"):
def tick():
while True:
print('tick')
threads.run_background(tick)
if __name__ == "__main__":
htf.main()
Contactο
The framework can be easily extended to your liking, either by yourself or with our support.
If you have any questions or ideas, please donβt hesitate and e-mail us via
support@hilster.io
.
Documentationο
- Introduction
- Editions
- Certifications
- Installation, Activation and Upgrading
- Requirements
- Installation on Windows
- Installation on Linux
- Installation on Raspberry Pi OS
- Installation in a virtual environment
- Installation using Anaconda
- Installation of htf via pip
- Installation options
- Installation behind a corporate proxy
- Installing a validated version of htf
- Activation
- Check installation
- Upgrading
- Installing a specific version
- Installing the community version
- Support
- Writing Tests
- Fixtures
- Assertions
- Behavior Driven Development
- Features
- Scenarios
- Steps
- Writing Features
- Writing Scenarios
- Example Feature
- Implementing Steps
- Running Features
- Steps with Parameters
- Long Lines
- Multi-Language Support
- Context Fixture
- Attach Data to Steps
- Tagging
- Requirements
- Background Steps
- Rules
- Scenario Outlines
- Scenario Outline Data Sources
- Skipping Features, Scenarios or Scenario Outlines
- Setup and Tear Down Code
- Parsing Steps
- Getting Available Steps and Statements
- Examples
- htf β Command line utility
- Running tests
- Specifying tests
- Running multiple tests
- Test-title
- HTML-report
- JUnit-XML-report
- JSON-report
- YAML-report
- Report Server
- Draft Reports
- Minimized Report Size
- Shuffle Tests
- Filename-templates
- Fail fast
- File pattern
- Tagging
- Metadata
- Overwriting Settings
- Parameters
- Bash-completion
- Enable Bash-completion
- Open docs
- View licenses
- Show version
- htf.main() β Testscript utility
- Docker Integration
- Dry Run
- Tagging
- Data Driven Testing
- Interactive Testing
- Settings
- Decorators
- Test Reports
- Signed Reports
- Report Tool
- Community Add-ons
- Modbus β The Modbus Testing Framework
- HART β The HART Testing Framework
- Communication
- I/O β Input and Output
- Power Supplies
- Retry Functions
- Issue Tracking
- Thread β A traceable thread implementation
- Metadata
- Keywords
- Miscellaneous
- Filters β Building generic filter expressions
- Terminal Colors
- Mixins
- Checksums
- Changelog
- htf-4.1.3
- htf-4.1.2
- htf-4.1.1
- htf-4.1.0
- htf-4.0.4
- htf-4.0.3
- htf-4.0.2
- htf-4.0.1
- htf-4.0.0
- htf-3.0.6
- htf-3.0.5
- htf-3.0.4
- htf-3.0.3
- htf-3.0.2
- htf-3.0.1
- htf-3.0.0
- htf-2.0.18
- htf-2.0.17
- htf-2.0.16
- htf-2.0.15
- htf-2.0.14
- htf-2.0.13
- htf-2.0.12
- htf-2.0.11
- htf-2.0.10
- htf-2.0.9
- htf-2.0.8
- htf-2.0.7
- htf-2.0.6
- htf-2.0.5
- htf-2.0.4
- htf-2.0.3
- htf-2.0.2
- htf-2.0.1
- htf-2.0.0
- htf-1.3.14
- htf-1.3.13
- htf-1.3.12
- htf-1.3.11
- htf-1.3.10
- htf-1.3.9
- htf-1.3.8
- htf-1.3.7
- htf-1.3.6
- htf-1.3.5
- htf-1.3.4
- htf-1.3.3
- htf-1.3.2
- htf-1.3.1
- htf-1.3.0