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
- ALM/QMS Integrations
- 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
- Automatic check for updates
- Installing the community version
- Support
- Writing Tests
- Fixtures
- Assertions
- Behavior Driven Development
- Features
- Scenarios
- Steps
- Writing Features
- Writing Scenarios
- Example Feature
- Complex Scenarios
- Implementing Steps
- Running Features
- Steps with Parameters
- Long Lines
- Multi-Language Support
- Context Fixture
- Attach Data to Steps
- Tagging
- Requirements
- Implemented Tests
- 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
blue
blue_bold
blue_bold_underline
blue_on_cyan
blue_on_cyan_bold
blue_on_cyan_bold_underline
blue_on_cyan_underline
blue_on_green
blue_on_green_bold
blue_on_green_bold_underline
blue_on_green_underline
blue_on_grey
blue_on_grey_bold
blue_on_grey_bold_underline
blue_on_grey_underline
blue_on_magenta
blue_on_magenta_bold
blue_on_magenta_bold_underline
blue_on_magenta_underline
blue_on_red
blue_on_red_bold
blue_on_red_bold_underline
blue_on_red_underline
blue_on_white
blue_on_white_bold
blue_on_white_bold_underline
blue_on_white_underline
blue_on_yellow
blue_on_yellow_bold
blue_on_yellow_bold_underline
blue_on_yellow_underline
blue_underline
bold
bold_underline
critical
cyan
cyan_bold
cyan_bold_underline
cyan_on_blue
cyan_on_blue_bold
cyan_on_blue_bold_underline
cyan_on_blue_underline
cyan_on_green
cyan_on_green_bold
cyan_on_green_bold_underline
cyan_on_green_underline
cyan_on_grey
cyan_on_grey_bold
cyan_on_grey_bold_underline
cyan_on_grey_underline
cyan_on_magenta
cyan_on_magenta_bold
cyan_on_magenta_bold_underline
cyan_on_magenta_underline
cyan_on_red
cyan_on_red_bold
cyan_on_red_bold_underline
cyan_on_red_underline
cyan_on_white
cyan_on_white_bold
cyan_on_white_bold_underline
cyan_on_white_underline
cyan_on_yellow
cyan_on_yellow_bold
cyan_on_yellow_bold_underline
cyan_on_yellow_underline
cyan_underline
debug
demo
error
failure
green
green_bold
green_bold_underline
green_on_blue
green_on_blue_bold
green_on_blue_bold_underline
green_on_blue_underline
green_on_cyan
green_on_cyan_bold
green_on_cyan_bold_underline
green_on_cyan_underline
green_on_grey
green_on_grey_bold
green_on_grey_bold_underline
green_on_grey_underline
green_on_magenta
green_on_magenta_bold
green_on_magenta_bold_underline
green_on_magenta_underline
green_on_red
green_on_red_bold
green_on_red_bold_underline
green_on_red_underline
green_on_white
green_on_white_bold
green_on_white_bold_underline
green_on_white_underline
green_on_yellow
green_on_yellow_bold
green_on_yellow_bold_underline
green_on_yellow_underline
green_underline
grey
grey_bold
grey_bold_underline
grey_on_blue
grey_on_blue_bold
grey_on_blue_bold_underline
grey_on_blue_underline
grey_on_cyan
grey_on_cyan_bold
grey_on_cyan_bold_underline
grey_on_cyan_underline
grey_on_green
grey_on_green_bold
grey_on_green_bold_underline
grey_on_green_underline
grey_on_magenta
grey_on_magenta_bold
grey_on_magenta_bold_underline
grey_on_magenta_underline
grey_on_red
grey_on_red_bold
grey_on_red_bold_underline
grey_on_red_underline
grey_on_white
grey_on_white_bold
grey_on_white_bold_underline
grey_on_white_underline
grey_on_yellow
grey_on_yellow_bold
grey_on_yellow_bold_underline
grey_on_yellow_underline
grey_underline
info
magenta
magenta_bold
magenta_bold_underline
magenta_on_blue
magenta_on_blue_bold
magenta_on_blue_bold_underline
magenta_on_blue_underline
magenta_on_cyan
magenta_on_cyan_bold
magenta_on_cyan_bold_underline
magenta_on_cyan_underline
magenta_on_green
magenta_on_green_bold
magenta_on_green_bold_underline
magenta_on_green_underline
magenta_on_grey
magenta_on_grey_bold
magenta_on_grey_bold_underline
magenta_on_grey_underline
magenta_on_red
magenta_on_red_bold
magenta_on_red_bold_underline
magenta_on_red_underline
magenta_on_white
magenta_on_white_bold
magenta_on_white_bold_underline
magenta_on_white_underline
magenta_on_yellow
magenta_on_yellow_bold
magenta_on_yellow_bold_underline
magenta_on_yellow_underline
magenta_underline
make_style
on_blue
on_blue_bold
on_blue_bold_underline
on_blue_underline
on_cyan
on_cyan_bold
on_cyan_bold_underline
on_cyan_underline
on_green
on_green_bold
on_green_bold_underline
on_green_underline
on_grey
on_grey_bold
on_grey_bold_underline
on_grey_underline
on_magenta
on_magenta_bold
on_magenta_bold_underline
on_magenta_underline
on_red
on_red_bold
on_red_bold_underline
on_red_underline
on_white
on_white_bold
on_white_bold_underline
on_white_underline
on_yellow
on_yellow_bold
on_yellow_bold_underline
on_yellow_underline
red
red_bold
red_bold_underline
red_on_blue
red_on_blue_bold
red_on_blue_bold_underline
red_on_blue_underline
red_on_cyan
red_on_cyan_bold
red_on_cyan_bold_underline
red_on_cyan_underline
red_on_green
red_on_green_bold
red_on_green_bold_underline
red_on_green_underline
red_on_grey
red_on_grey_bold
red_on_grey_bold_underline
red_on_grey_underline
red_on_magenta
red_on_magenta_bold
red_on_magenta_bold_underline
red_on_magenta_underline
red_on_white
red_on_white_bold
red_on_white_bold_underline
red_on_white_underline
red_on_yellow
red_on_yellow_bold
red_on_yellow_bold_underline
red_on_yellow_underline
red_underline
skipped
success
system
underline
warning
white
white_bold
white_bold_underline
white_on_blue
white_on_blue_bold
white_on_blue_bold_underline
white_on_blue_underline
white_on_cyan
white_on_cyan_bold
white_on_cyan_bold_underline
white_on_cyan_underline
white_on_green
white_on_green_bold
white_on_green_bold_underline
white_on_green_underline
white_on_grey
white_on_grey_bold
white_on_grey_bold_underline
white_on_grey_underline
white_on_magenta
white_on_magenta_bold
white_on_magenta_bold_underline
white_on_magenta_underline
white_on_red
white_on_red_bold
white_on_red_bold_underline
white_on_red_underline
white_on_yellow
white_on_yellow_bold
white_on_yellow_bold_underline
white_on_yellow_underline
white_underline
yellow
yellow_bold
yellow_bold_underline
yellow_on_blue
yellow_on_blue_bold
yellow_on_blue_bold_underline
yellow_on_blue_underline
yellow_on_cyan
yellow_on_cyan_bold
yellow_on_cyan_bold_underline
yellow_on_cyan_underline
yellow_on_green
yellow_on_green_bold
yellow_on_green_bold_underline
yellow_on_green_underline
yellow_on_grey
yellow_on_grey_bold
yellow_on_grey_bold_underline
yellow_on_grey_underline
yellow_on_magenta
yellow_on_magenta_bold
yellow_on_magenta_bold_underline
yellow_on_magenta_underline
yellow_on_red
yellow_on_red_bold
yellow_on_red_bold_underline
yellow_on_red_underline
yellow_on_white
yellow_on_white_bold
yellow_on_white_bold_underline
yellow_on_white_underline
yellow_underline
- Mixins
- Checksums
- Changelog
- htf-4.2.0
- 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