@servicenow/sdk - v4.14.3
    Preparing search index...
    • Creates a reusable Automated Test Framework test (sys_atf_test_callable) — ATF's "Reusable Test" feature. A reusable test declares typed inputs/outputs and can be invoked as a single step from other tests via atf.executeTest, similar to a subflow.

      Type Parameters

      Parameters

      • input: ReusableTestSetup<I, O>

        an object containing the following properties:

        • $id - unique id for the record, typically using Now.ID["value"]
        • name - test name
        • active? - whether the test is enabled
        • description? - test description
        • failOnServerError? - if true, errors detected while performing UI steps on the server fail the test
        • isReusable - true to build this test as a reusable test (sys_atf_test_callable)
        • inputs? - typed input parameters, defined with the same column constructors (StringColumn, ReferenceColumn, etc.) used in a Table()'s schema
        • outputs? - typed output parameters, defined the same way as inputs
      • configurationFunction: (
            atf: ATFTestRun,
            inputs: TypedColumnValues<I>,
            outputs: TypedColumnValues<O>,
        ) => unknown

        arrow function that receives the ATF step builder plus this test's own inputs/outputs, and defines the reusable test's own steps by calling methods on the builder's categories, e.g.:

        • atf.server.log({ log: 'message' })
        • atf.form.openForm({ table: 'incident', ... }) Read declared inputs directly off the second argument, e.g. atf.server.log({ log: inputs.myString }). Populate declared outputs via atf.setReusableTestOutputs(outputs, { $id: ... }, { myOutput: ... }).

      Returns ReusableTest<I, O>

    • Creates a Automated Test Framework test (sys_atf_test).

      Parameters

      • input: TestSetup
      • configurationFunction: (atf: ATFTestRun) => unknown

        arrow function that receives the ATF step builder and defines test steps by calling methods on its categories, e.g.:

        • atf.server.log({ log: 'message' })
        • atf.form.openForm({ table: 'incident', ... })
        • atf.rest.send({ ... })

      Returns TestInstance