Ir al contenido principal
Versión: 5.6.x

Extensiones avanzadas

[Traducción Beta No Oficial]

Esta página fue traducida por PageTurner AI (beta). No está respaldada oficialmente por el proyecto. ¿Encontraste un error? Reportar problema →

Esta tabla enumera extensiones más avanzadas que permiten integrarse directamente con el motor para:

  • interceptar pruebas, omitirlas y modificar resultados

  • interceptar especificaciones, omitiéndolas si es necesario

  • procesar instancias de especificaciones tras su creación

  • modificar el contexto de corrutinas usado en especificaciones y pruebas

  • aplicar lógica personalizada de creación de instancias

  • filtrar especificaciones y pruebas

  • ajustar la salida de pruebas

ExtensionDescription
ConstructorExtensionProvides custom logic to instantiate spec classes. An example is the Spring extension constructor extension which autowire's spring beans.
TestCaseExtensionIntercepts calls to a test, can skip a test, override the test result, and modify the coroutine context.
SpecExtensionIntercepts calls to a spec, can skip a spec, and modify the coroutine context.
SpecRefExtensionIntercepts calls to a spec before it is instantiated. Can skip instantiation.
DisplayNameFormatterExtensionCan customize the display names of tests used in test output.
EnabledExtensionCan provide custom logic to determine if a test is enabled or disabled.
ProjectExtensionIntercepts calls to the test engine before a project starts.
SpecExecutionOrderExtensionCan sort specs before execution begins to provide a custom spec execution order.
TagExtensionCan provide active tags from arbitrary sources.
InstantiationErrorListenerIs notified when a spec fails to be instantiated due to some exception.
InstantiationListenerIs notified when a spec is successfully instantiated.
PostInstantiationExtensionIntercepts specs when they are instantiated, can replace the spec instance and modify coroutine context.
IgnoredSpecListenerIs notified when a spec is skipped.
SpecFilterCan provide custom logic to skip a spec.
TestFilterCan provide custom logic to skip a test.