Logotipo de Atf Testing

Atf Testing

Organización
serac-labs
atf-testing

Build ServiceNow Automated Test Framework tests and suites — impersonation, form steps, assertions, server-side script steps, test parameters, and execution via snow_create_atf_test / snow_execute_atf_test.

Add to TypingMind

Descripción general

Editorserac-labs
Repositorioserac
Nombre de la habilidadatf-testing
Estrellas
78
Forks
26
Archivos incluidos
Solo instrucciones
LicenciaApache-2.0
Enlaces
  • Instrucciones en Markdown

    Un archivo SKILL.md que el modelo carga cuando lo necesita, de modo que solo consume tokens cuando la petición encaja con la habilidad.

  • Funciona con cualquier LLM

    Las habilidades de IA están en Markdown, no en código específico de un proveedor, por lo que funcionan con GPT, Claude, Gemini, Grok o un modelo local.

  • Todo en las instrucciones

    Todo lo que necesita el modelo está en las instrucciones: no hay archivos adicionales que sincronizar.

  • Código abierto

    Publicada por serac-labs en GitHub. Revisa el contenido original antes de instalarla.

Instalación

Instala la habilidad de IA Atf Testing en TypingMind para usarla con cualquier LLM, o añádela a otro agente que lea SKILL.md.

1

Instalar en TypingMind

TypingMind instala una habilidad directamente desde su carpeta de GitHub: lee SKILL.md, empaqueta los archivos de recursos y guarda el resultado localmente.

  1. Abre la aplicación y ve a Plugins → Habilidades.
  2. Elige «Instalar desde GitHub».
  3. Pega la URL de la carpeta de la habilidad que se muestra a continuación y confirma.
    https://github.com/serac-labs/serac/tree/main/packages/skills/atf-testing
  4. Activa la habilidad en cada chat en el que quieras tenerla disponible.
Plugins → Habilidades → Añadir habilidad → URL de GitHub; después, pega la URL de la carpeta y pulsa Continuar.
2

Instalar en otro agente

Cualquier agente que lea el formato Agent Skills puede usar esta habilidad: copia la carpeta en el directorio de habilidades de ese agente.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/serac-labs/serac.git /tmp/serac
mkdir -p .claude/skills
cp -r /tmp/serac/packages/skills/atf-testing .claude/skills/atf-testing
Reinicia Claude Code después de copiarla para que detecte la nueva habilidad.

Úsala en TypingMind

Activa Atf Testing en cualquier chat de TypingMind y el modelo se encargará del resto. Su nombre y descripción se incluyen en el prompt del sistema y, en cuanto una petición encaja con la habilidad, el modelo carga las instrucciones completas por sí solo. No tienes que invocarla manualmente y no consume tokens hasta que se utiliza.

El modelo carga Atf Testing automáticamente en cuanto una petición es relevante para esa habilidad.

Funciona con cualquier modelo de IA

Las habilidades de IA son instrucciones en Markdown, no código específico de un proveedor, por lo que Atf Testing no está vinculada al modelo para el que se creó. Instálala una sola vez en TypingMind y úsala con GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama o un modelo local que ejecutes tú, todo con tus propias claves API.

  • Se carga solo cuando se necesita

    El prompt del sistema solo incluye el nombre y la descripción. Las instrucciones se cargan con la primera petición que encaja con la habilidad, por lo que una habilidad que no se usa no supone ningún coste.

  • Cambia de modelo durante el chat

    Como la habilidad contiene instrucciones y no código, cambiar de modelo no impide que funcione: el nuevo modelo lee el mismo archivo SKILL.md.

Instrucciones de la habilidad

Este es el contenido de SKILL.md que carga el modelo. Léelo antes de instalar la habilidad: contiene instrucciones que tu modelo seguirá.

Automated Test Framework (ATF) for ServiceNow

ATF provides automated testing capabilities for ServiceNow applications, enabling regression testing and continuous integration.

ATF Architecture

Test Hierarchy

Test Suite: Incident Management Tests
├── Test: Create Incident
│   ├── Step 1: Impersonate User
│   ├── Step 2: Open New Record
│   ├── Step 3: Set Field Values
│   ├── Step 4: Submit Form
│   └── Step 5: Assert Values
├── Test: Assign Incident
│   └── Steps...
└── Test: Resolve Incident
    └── Steps...

Key Tables

TablePurpose
sys_atf_testTest definitions
sys_atf_stepIndividual test steps
sys_atf_test_suiteTest suite groupings
sys_atf_test_suite_testSuite-test relationships
sys_atf_test_resultTest execution results

Test Step Types

Common Step Types

Step TypePurposeExample
ImpersonateRun as specific userTest as ITIL user
Open a New FormCreate new recordNew incident form
Open an Existing FormEdit recordOpen INC0010001
Set Field ValuesPopulate fieldsSet priority, description
Click a UI ActionTrigger buttonClick "Save"
Assert Field ValuesValidate valuesPriority = 1
Run Server Side ScriptExecute scriptCustom validation
WaitPause executionWait for async

Creating Tests

Basic Test Structure (ES5)

javascript
// Create a new ATF test
var test = new GlideRecord("sys_atf_test")
test.initialize()
test.setValue("name", "Test: Create High Priority Incident")
test.setValue("description", "Verify high priority incident creation workflow")
test.setValue("active", true)
test.setValue("application", "global") // or scoped app sys_id
var testSysId = test.insert()

// Add test steps
function addTestStep(testId, order, stepType, config) {
  var step = new GlideRecord("sys_atf_step")
  step.initialize()
  step.setValue("test", testId)
  step.setValue("order", order)
  step.setValue("step_config", stepType)

  // Set step-specific configuration
  for (var key in config) {
    if (config.hasOwnProperty(key)) {
      step.setValue(key, config[key])
    }
  }

  return step.insert()
}

Impersonate Step

javascript
// Step 1: Impersonate ITIL user
addTestStep(testSysId, 100, "sys_atf_step_config_impersonate", {
  description: "Impersonate ITIL user",
  inputs: JSON.stringify({
    user: "itil", // or sys_id
  }),
})

Open New Form Step

javascript
// Step 2: Open new incident form
addTestStep(testSysId, 200, "sys_atf_step_config_open_new_form", {
  description: "Open new incident form",
  inputs: JSON.stringify({
    table: "incident",
  }),
})

Set Field Values Step

javascript
// Step 3: Set field values
addTestStep(testSysId, 300, "sys_atf_step_config_set_field_values", {
  description: "Set incident fields",
  inputs: JSON.stringify({
    table: "incident",
    values: [
      { field: "short_description", value: "ATF Test Incident" },
      { field: "priority", value: "1" },
      { field: "category", value: "network" },
      { field: "caller_id", value: "admin" },
    ],
  }),
})

Submit Form Step

javascript
// Step 4: Submit form (click Save)
addTestStep(testSysId, 400, "sys_atf_step_config_click_ui_action", {
  description: "Save the incident",
  inputs: JSON.stringify({
    ui_action: "sysverb_insert", // Submit/Insert action
  }),
})

Assert Field Values Step

javascript
// Step 5: Assert values
addTestStep(testSysId, 500, "sys_atf_step_config_assert_field_values", {
  description: "Verify incident was created correctly",
  inputs: JSON.stringify({
    table: "incident",
    assertions: [
      {
        field: "priority",
        operator: "equals",
        value: "1",
      },
      {
        field: "state",
        operator: "equals",
        value: "1", // New
      },
      {
        field: "number",
        operator: "is not empty",
      },
    ],
  }),
})

Server-Side Script Steps

Custom Validation Script (ES5)

javascript
// Step: Run Server Side Script
// Script (ES5 only!):

;(function (outputs, steps, params, stepResult) {
  // Access outputs from previous steps
  var incidentSysId = steps["step_sys_id"].record_id

  // Perform custom validation
  var gr = new GlideRecord("incident")
  if (gr.get(incidentSysId)) {
    // Check business rule fired
    if (gr.getValue("assignment_group") === "") {
      stepResult.setOutputMessage("Assignment group not set by business rule")
      stepResult.setFailed()
      return
    }

    // Check SLA attached
    var sla = new GlideRecord("task_sla")
    sla.addQuery("task", incidentSysId)
    sla.query()

    if (!sla.hasNext()) {
      stepResult.setOutputMessage("No SLA attached to incident")
      stepResult.setFailed()
      return
    }

    // All validations passed
    outputs.incident_number = gr.getValue("number")
    outputs.sla_count = sla.getRowCount()
    stepResult.setOutputMessage("All validations passed")
  } else {
    stepResult.setOutputMessage("Incident not found")
    stepResult.setFailed()
  }
})(outputs, steps, params, stepResult)

Data Setup Script (ES5)

javascript
// Step: Setup test data
;(function (outputs, steps, params, stepResult) {
  // Create test user if needed
  var user = new GlideRecord("sys_user")
  user.addQuery("user_name", "atf_test_user")
  user.query()

  if (!user.next()) {
    user.initialize()
    user.setValue("user_name", "atf_test_user")
    user.setValue("first_name", "ATF")
    user.setValue("last_name", "Test User")
    user.setValue("email", "atf@test.com")
    user.setValue("active", true)
    outputs.user_sys_id = user.insert()
  } else {
    outputs.user_sys_id = user.getUniqueValue()
  }

  stepResult.setOutputMessage("Test user ready: " + outputs.user_sys_id)
})(outputs, steps, params, stepResult)

Cleanup Script (ES5)

javascript
// Step: Cleanup test data (always runs)
;(function (outputs, steps, params, stepResult) {
  var testRecordId = steps["create_incident_step"].record_id

  if (testRecordId) {
    var gr = new GlideRecord("incident")
    if (gr.get(testRecordId)) {
      gr.deleteRecord()
      stepResult.setOutputMessage("Cleaned up test incident: " + testRecordId)
    }
  }
})(outputs, steps, params, stepResult)

Test Suites

Creating Test Suite

javascript
// Create test suite
var suite = new GlideRecord("sys_atf_test_suite")
suite.initialize()
suite.setValue("name", "Incident Management Regression Suite")
suite.setValue("description", "Full regression tests for incident management")
suite.setValue("active", true)
var suiteSysId = suite.insert()

// Add tests to suite
function addTestToSuite(suiteId, testId, order) {
  var link = new GlideRecord("sys_atf_test_suite_test")
  link.initialize()
  link.setValue("test_suite", suiteId)
  link.setValue("test", testId)
  link.setValue("order", order)
  return link.insert()
}

addTestToSuite(suiteSysId, createTestId, 100)
addTestToSuite(suiteSysId, assignTestId, 200)
addTestToSuite(suiteSysId, resolveTestId, 300)

Parameterized Tests

Using Test Parameters

javascript
// Test with parameters
var test = new GlideRecord('sys_atf_test');
test.initialize();
test.setValue('name', 'Test: Create Incident with Priority');
test.setValue('parameters', JSON.stringify({
    priority: '2',
    category: 'software'
}));
test.insert();

// In step, reference parameter
{
    "values": [
        { "field": "priority", "value": "${priority}" },
        { "field": "category", "value": "${category}" }
    ]
}

MCP Tool Integration

Available ATF Tools

ToolPurpose
snow_create_atf_testCreate test
snow_create_atf_test_stepAdd step to test
snow_create_atf_test_suiteCreate suite
snow_execute_atf_testRun test
snow_get_atf_resultsGet results
snow_discover_atf_testsFind existing tests

Example Workflow

javascript
// 1. Create test
var testId = await snow_create_atf_test({
  name: "Test: Incident Priority Escalation",
  description: "Verify priority changes trigger notifications",
})

// 2. Add steps
await snow_create_atf_test_step({
  test_id: testId,
  order: 100,
  type: "impersonate",
  user: "itil",
})

await snow_create_atf_test_step({
  test_id: testId,
  order: 200,
  type: "server_script",
  script: createIncidentScript,
})

// 3. Execute test
var resultId = await snow_execute_atf_test({
  test_id: testId,
})

// 4. Get results
var results = await snow_get_atf_results({
  result_id: resultId,
})

Best Practices

  1. Isolate Test Data - Create and cleanup test data in each test
  2. Use Impersonation - Test as actual user roles
  3. Atomic Tests - Each test validates one scenario
  4. Descriptive Names - Clear test and step descriptions
  5. Order Steps - Use 100, 200, 300 for easy insertion
  6. Handle Async - Add wait steps for async operations
  7. Cleanup Always - Use finally steps for cleanup
  8. Parameterize - Use parameters for reusable tests

Common Assertions

AssertionUse Case
equalsExact value match
not equalsValue exclusion
is emptyField should be empty
is not emptyField must have value
containsSubstring match
starts withPrefix match
greater thanNumeric comparison
less thanNumeric comparison

Preguntas frecuentes

¿Qué hace la habilidad de IA Atf Testing?

Build ServiceNow Automated Test Framework tests and suites — impersonation, form steps, assertions, server-side script steps, test parameters, and execution via snow_create_atf_test / snow_execute_atf_test.

¿Por qué usar Atf Testing en TypingMind?

Porque la instalas una vez y la usas con cualquier modelo. Atf Testing está escrita en Markdown, no en código específico de un proveedor, por lo que la misma habilidad funciona con GPT-5, Claude, Gemini, Grok o un modelo local, y puedes cambiar de modelo en mitad del chat sin que deje de funcionar. TypingMind utiliza tus propias claves API, de modo que pagas directamente a los proveedores en lugar de pagar una suscripción por puesto, y tus habilidades y chats permanecen en tu propio almacenamiento.

¿Cómo instalo Atf Testing en TypingMind?

Abre Plugins → Habilidades → Instalar desde GitHub en TypingMind y pega https://github.com/serac-labs/serac/tree/main/packages/skills/atf-testing. TypingMind lee el archivo SKILL.md de esa carpeta e instala su contenido como una habilidad que puedes activar en cada chat.

¿Qué modelos de IA pueden usar Atf Testing?

Cualquier modelo que conectes en TypingMind. Las habilidades de IA son instrucciones en Markdown, no código específico de un proveedor, por lo que GPT, Claude, Gemini, Grok y los modelos locales pueden cargar esta habilidad cuando una solicitud se corresponda con ella.

¿Con cuántos modelos de IA puedo usar Atf Testing?

Con tantos como quieras. Siempre que un modelo admita habilidades, puedes usar Atf Testing con él: GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama y muchos más, todos en TypingMind con tus propias claves API.

¿Es gratuita la habilidad de IA Atf Testing?

Sí. serac-labs la ha publicado en GitHub bajo la licencia Apache-2.0. Solo pagas a tu proveedor de IA por los tokens que utilizas.

¿Qué son las habilidades de IA?

Una habilidad de IA es un conjunto de instrucciones reutilizables que enseña a un modelo de IA a realizar una tarea concreta. Sigue el formato abierto Agent Skills: un archivo SKILL.md con un nombre y una descripción, además de los scripts, plantillas o archivos de referencia que pueda necesitar el modelo. El modelo solo lee las instrucciones cuando tu solicitud se corresponde con la habilidad, por lo que una habilidad instalada no supone ningún coste hasta que se utiliza.

¿En qué se diferencian las habilidades de IA de los plugins o los servidores MCP?

Un plugin o un servidor MCP proporciona al modelo nuevas herramientas que puede invocar: código que se ejecuta en algún lugar y devuelve un resultado. En cambio, una habilidad de IA aporta conocimientos y procedimientos al modelo: cómo abordar una tarea, qué pasos seguir y qué se considera un buen resultado. Las habilidades son instrucciones en Markdown, por lo que no necesitan servidor, clave API ni entorno de ejecución, y funcionan con cualquier modelo.

Ver el directorio

Crea ya tu propio espacio de trabajo con IA

Suscríbete a nuestro boletín para recibir avisos sobre nuevas funciones y próximos sorteos 👇