sndev.io / docs

ATF

Automated Test Framework tests, steps, and test suites.

The atf skill builds Automated Test Framework tests and suites. Create tests, add step types (server script, record CRUD, user creation, REST-inbound assertions), and assemble them into suites that can be triggered via the CI/CD API. Two higher-level wrap operations (wrap_decision_table_test, wrap_rest_endpoint_test) compose a full test around a declarative case list.

OperationDescription
create_testCreate an ATF test
create_suiteCreate an ATF test suite and add tests
add_server_script_stepAdd a server-side script step
add_record_insert_stepAdd a record insert step
add_record_update_stepAdd a record update step
add_record_query_stepAdd a record query step
add_record_validation_stepAdd a record validation step
add_record_delete_stepAdd a record delete step
add_create_user_stepAdd a create user step
add_impersonate_user_stepAdd an impersonate user step
add_log_stepAdd a log message step
add_rest_stepAdd a REST API call step (outbound)
wrap_decision_table_testBuild a full ATF test for a decision table from a case list (inputs → expected outputs)
wrap_rest_endpoint_testBuild a full ATF test around a REST endpoint — basic-auth profile + status-code + JSON payload + substring assertions per case

Run sn ops atf to see the full list and sn ops atf <op> for the input schema of a specific operation.

REST-inbound testing. wrap_rest_endpoint_test is the recommended way to exercise any REST endpoint (scripted REST APIs, Table API, custom APIs) from ATF. Each cases[] entry emits a Send REST Request - Inbound step plus four assertion types:

  • Status Code — expected HTTP status.
  • JSON Payload Is Valid — the body parses as JSON.
  • JSON Payload Element — per payload[] entry, a slash-path + expected value structural check.
  • Response Payload — per bodyContains[] entry, a substring match against the whole body (for responses whose shape is dynamic).

authProfile is a discriminated union: {sys_id} to reference an existing sys_auth_profile_basic, or {username, password, name?} to create one. Supplied credentials are only used on the create path — if a profile with the given name already exists, the wrap preserves its existing credentials.

ATF REST-inbound steps authenticate via basic auth only. The sys_auth_profile_basic record you reference (or create) must carry a user with roles to hit the endpoints under test.

You

Write ATF tests for my business rule that validates incident priority — test that P1 incidents get auto-assigned.