HardPy config¶
HardPy uses the hardpy.toml file for configuration.
The user can change the fields at creation by using hardpy init.
Note
All HardPy project must have hardpy.toml file.
Minimal configuration file¶
title = "HardPy TOML config"
[database]
user = "dev"
password = "dev"
host = "localhost"
port = 5984
[frontend]
host = "localhost"
port = 8000
Full configuration file¶
title = "HardPy TOML config"
tests_name = "My tests"
current_test_config = ""
[database]
storage_type = "couchdb"
user = "dev"
password = "dev"
host = "localhost"
port = 5984
[frontend]
host = "localhost"
port = 8000
language = "en"
full_size_button = false
sound_on = false
measurement_display = true
manual_collect = false
test_history = true
auto_scroll = false
[frontend.modal_result]
enable = false
auto_dismiss_pass = true
auto_dismiss_timeout = 5
[frontend.reports_storage_menu]
show_standcloud = true
check_standcloud = true
[stand_cloud]
address = "standcloud.everypin.io"
connection_only = true
autosync = true
autosync_timeout = 30
api-key = "1234567890"
Configuration fields description¶
common¶
Common settings.
title¶
Configuration file header.
The value is always HardPy TOML config.
tests_name¶
Tests name. The user can change this value with the hardpy init --tests-name argument.
current_test_config¶
Tests file configuration name. An example of its use can be found on page Multiple configs.
database¶
Database settings.
storage_type¶
Storage type. The default is couchdb.
couchdb: Stores test results and measurements in a CouchDB database. Requires a running CouchDB instance.json: Stores test results and measurements in local JSON files. No external database required.
Files are stored in the .hardpy directory in the root of the project.
The user can change this value with the hardpy init --storage-type option.
storage_path¶
Path to the storage directory. The default is .hardpy in the root of the project.
The user can change this value in the hardpy.toml file using the storage_path option.
Both relative and absolute paths are supported.
[database]
storage_type = "json"
storage_path = "result"
user¶
Database user name. The default is dev.
The user can change this value with the hardpy init --database-user option.
password¶
Database password. The default is dev.
The user can change this value with the hardpy init --database-password option.
host¶
Database host name. The default is localhost.
The user can change this value with the hardpy init --database-host option.
port¶
Database port number. The default is 5984.
The user can change this value with the hardpy init --database-port option.
frontend¶
Frontend (operator panel) settings.
host¶
Operator panel host name. The default is localhost.
The user can change this value with the hardpy init --frontend-host option.
port¶
Operator panel port number. The default is 8000.
The user can change this value with the hardpy init --frontend-port option.
language¶
Language of operator panel. The default is en.
Available languages are there.
full_size_button¶
Enable full-size start/stop button layout in operator panel.
When set to true, the button will be displayed in full-size layout with larger dimensions and centered positioning.
Default is false.
sound_on¶
Enable or disable test completion sound notifications.
When set to true, sound will play when test execution completes (PASS/FAIL/STOP status).
Default is false.
measurement_display¶
Enable or disable measurement display in the operator panel.
When set to true, measurements created using set_case_measurement will be displayed as tags
showing name, value, and unit information.
Default is true.
manual_collect¶
Enable or disable manual test collection mode in the operator panel.
When set to true, users can selectively choose which tests to run by checking individual test cases,
and only the selected tests will be executed when starting the test run.
When set to false, all discovered tests will run automatically as before.
Default is false.
test_history¶
Enable or disable the test history view in the operator panel.
When set to true, the operator can view the history of previous test runs.
Default is false.
auto_scroll¶
Enable optional auto-scroll and auto-expand behavior in the operator panel.
When set to true, suites auto-expand when one of their cases starts running,
auto-close when no case in the suite is active or failed, and the viewport
scrolls the currently running case into view. Scroll is debounced and is
suppressed for three seconds after any operator-driven scroll
(wheel / touchmove / Page / Home / End / Arrow keys), so a manual
scroll won't get yanked back by the next state update.
Default is false. See auto-scroll demo.
modal_result¶
Modal result windows settings for test completion display.
[frontend.modal_result]
enable = false
auto_dismiss_pass = true
auto_dismiss_timeout = 5
enable¶
Enable or disable test completion modal result windows.
When set to true, modal windows will display test completion status (PASS/FAIL/STOP) at the end of test execution.
Default is false.
auto_dismiss_pass¶
Automatically dismiss PASS result modals after the timeout period.
When set to true, PASS results will automatically close without requiring user interaction.
FAIL and STOP results always require manual dismissal.
Default is true.
auto_dismiss_timeout¶
Timeout in seconds for auto-dismissing PASS result modals.
Applies only when auto_dismiss_pass = true.
Default is 5 seconds.
reports_storage_menu¶
Reports storage status menu settings for the operator panel. The menu shows the configured cloud storage status and the active local storage backend.
[frontend.reports_storage_menu]
show_standcloud = true
check_standcloud = true
show_standcloud¶
Show or hide the StandCloud section in the reports storage menu.
When set to false, the operator panel does not display the StandCloud block.
Default is true.
check_standcloud¶
Enable or disable StandCloud status checks in the reports storage menu.
When set to false, the menu keeps the StandCloud block visible but does not mark
missing StandCloud configuration as a storage problem.
Default is true.
stand_cloud¶
StandCloud settings.
[stand_cloud]
address = "demo.standcloud.localhost"
connection_only = true
autosync = true
autosync_timeout = 30
api-key = "1234567890"
address¶
StandCloud service address. To obtain one, contact info@everypin.io.
connection_only¶
Boolean variable, if set to true, HardPy will check the connection
to the StandCloud service at each startup before running tests.
The default value is false.
If the connection fails, the tests will not run.
autosync¶
Boolean variable, if set to true, HardPy will automatically send data
to StandCloud upon completion of testing.
The default value is false.
autosync_timeout¶
This is an integer variable greater than 1, representing the time interval in minutes between StandCloud synchronization attempts.
The default value is 30.
api-key¶
StandCloud API key.
test_configs¶
Test configurations describes using the [[test_configs]] table array.
name¶
A user-friendly name for the configuration.
file¶
The path to the pytest.ini file that defines the specific pytest arguments and test selection for this configuration.
description¶
An optional field to provide a more detailed explanation of the configuration.
extra args¶
Users can add their own fields to the hardpy.toml file and use them in test plans. Here is an example of how to use them:
title = "HardPy TOML config"
[database]
user = "dev"
password = "dev"
host = "localhost"
port = 5984
[frontend]
host = "localhost"
port = 8000
[extra_args]
extra_arg_1 = "extra_arg_1"
extra_arg_2 = 2
import hardpy
config = hardpy.get_hardpy_config()
print(config.extra_args.["extra_arg_1"])
print(config.extra_args.["extra_arg_2"])