waft.utilities.pytest_plugin module

waft.utilities.pytest_plugin.agent(waft: Waft) AgentActions

Return an AgentActions instance for the deployed waft-agent.

Ensures the waft-agent is deployed and running at the expected version. This is idempotent - if the agent is already running at the correct version, no deployment occurs. Leaves the agent installed after tests complete.

Session-scoped because agent deployment is system-wide and expensive. The same AgentActions instance is shared across all tests in the session.

Note

SSL verification is enabled by default. For test environments with self-signed certificates, create your own AgentActions instance with verify_ssl=False instead of using this fixture.

Raises:

RuntimeError – If deployment fails or version mismatch after deployment

waft.utilities.pytest_plugin.dashboard(request: FixtureRequest, waft: Waft, trm: Trm, test_cleanup: CleanupQueue) DashboardActions

Return a DashboardActions class instance to facilitate interacting with the Cloudflare Dashboard API.

waft.utilities.pytest_plugin.pytest_addoption(parser: Parser)

Add custom params to the pytest CLI.

waft.utilities.pytest_plugin.pytest_configure(config: Config)

Initialize pytest configuration and settings.

waft.utilities.pytest_plugin.pytest_runtest_makereport(item: Item, call: CallInfo[None])

Stash test results to facilitate access in fixtures.

waft.utilities.pytest_plugin.single_device_profile(_warp_installation: WarpActions, dashboard: DashboardActions, request: FixtureRequest, test_cleanup: CleanupQueue) DeviceProfileModel

Return a DeviceProfileModel class instance representing a Cloudflare Zero Trust device profile, uniquely identified by registered email address.

This fixture will enroll the test system in the proper org that is used for single device profile testing using the email auth flow, then create and return a device profile targeting the email used for enrollment.

waft.utilities.pytest_plugin.system(waft: Waft) SystemActions

Return a SystemActions class instance to facilitate interacting with the test node’s operating system.

waft.utilities.pytest_plugin.test_cleanup() CleanupQueue

Return a CleanupQueue class instance to facilitate test cleanup.

waft.utilities.pytest_plugin.trm() Trm

Return a Trm class instance representing the framework’s Test Resource Manager API.

waft.utilities.pytest_plugin.waft() Waft

Return a Waft class instance representing the framework API, executed with a privileged system account (default).

waft.utilities.pytest_plugin.waft_restricted_user(waft: Waft) Waft

Return a Waft class instance representing the framework API, executed with a non-privileged system account.

waft.utilities.pytest_plugin.warp(waft: Waft, _warp_registration) WarpActions

Return a WarpActions class instance to facilitate installing, registering, and interacting with the Cloudflare WARP client.