pytest_f3ts.fixtures
F3TS Pytest Plugin Fixtures.
Various utility fixtures for accessing test plan configuration and test runner parameters.
auto_logger(test_config, record_property)
Log standard F3TS variables.
backend_api(pytestconfig) -> pytest_f3ts.runner_client.F3TSBackendAPI
F3TS Backend Webservice API.
Object for creating and sending requests to the Test Executer (TE)
f3ts_assert(backend_api, local_api, test_config, record_property, request)
Fixture to manually send assertion result to the Test Executer (TE).
Assert statements made with f3ts_assert will show up as sub results within the test application GUI and stored as a result in the results database.
fixture_config(test_plan_config: pytest_f3ts.schemas.config.PytestTestPlanConfig, request, pytestconfig) -> pytest_f3ts.schemas.config.FixtureSettings
Fixture that provides test fixture configuration information.
Returns the FixtureSettings for the active fixture slot, selected by matching the --slot_id command-line option against the slot_id of each entry under fixture_settings in the configuration. Requires --slot_id (it defaults to 1).
Each FixtureSettings entry exposes slot_id, an optional api_url, and a user_vars dictionary of user-defined values. user_vars is useful for per-fixture data such as hardware serial numbers or MAC IDs that differ from slot to slot but are required by the test program.
Example config.yml fixture_settings section:
fixture_settings:
slot_1:
slot_id: "1"
user_vars:
mac_address: "00:11:22:33:44:55"
slot_2:
slot_id: "2"
user_vars:
mac_address: "00:11:22:33:44:66" def test_fixture_parameter(fixture_config):
mac = fixture_config.user_vars["mac_address"]
assert macStart the test program with the desired slot selected:
pytest --slot_id=1
This grants the test program access to slot_1's user-defined variables.
local_api(pytestconfig) -> pytest_f3ts.runner_client.F3TSASCIIAPI
F3TS Backend Webservice API.
Object for creating and sending requests to the Test Executer (TE)
logfile_storage(backend_api)
Fixture to manually upload log files to the Test Executor (TE).
serial_number(backend_api) -> pytest_f3ts.utils.SerialNumber
Fixture for accessing the serial number of the device under test (DUT).
status_banner(backend_api) -> pytest_f3ts.utils.StatusBanner
Fixture that provides ability to override status banner.
test_config(test_plan_config: pytest_f3ts.schemas.config.PytestTestPlanConfig, request) -> pytest_f3ts.schemas.config.TestCase
Fixture that provides test case configuration information.
Returns the test case configuration information for the current test case. This requires the test case name to match the key within the configuration file, for example, a test named test_5v0_voltage would require the following section in the test configuration file:
test_cases:
test_5v0_voltage:
test_id: 2.1
error_code: 201
error_msg: "Voltage out of spec"
min_limit: 4.9
max_limit: 5.1
user_vars:
user_dict_key1: user_dict_value1
user_dict_key2: user_dict_value2test_plan_config(pytestconfig, backend_api) -> pytest_f3ts.schemas.config.PytestTestPlanConfig
Fixture that provides access to the test plan configuration information.
Returns the test plan configuration information. This is loaded from a YAML file that is titled either config.yaml within the same directory as the current test file, or can be defined by adding the --f3ts_config variable to the pytest command line call. For example:
pytest -p f3ts --f3ts_config=path/to/config.ymlThe test plan must match the schema defined by the TestPlanConfig model.
user_dialog(backend_api) -> pytest_f3ts.utils.UserDialog
Fixture that provides user dialog features.
Sending dialog messages to terminal that requires user input require stdin enabled via:
pytest -s