Raxol.Plugins.Testing.PluginTestFramework (Raxol v2.0.1)

View Source

Plugin Testing Framework for Raxol

Provides comprehensive testing utilities for plugin development including:

  • Plugin manifest validation
  • Mock terminal environments
  • UI rendering tests
  • Keyboard event simulation
  • Integration testing helpers
  • Performance benchmarking

Summary

Functions

Creates a mock terminal environment for testing

Gets the current terminal buffer content

Loads a plugin in the test environment

Simulates a keypress event

Simulates multiple keypress events

Validates a plugin manifest against the required schema

Waits for a plugin to reach a specific state

Functions

create_mock_terminal(opts \\ [])

Creates a mock terminal environment for testing

get_terminal_buffer(terminal)

Gets the current terminal buffer content

load_plugin(terminal, plugin_module, config \\ %{})

Loads a plugin in the test environment

send_keypress(terminal, key)

Simulates a keypress event

send_keypresses(terminal, keys)

Simulates multiple keypress events

validate_manifest(plugin_module)

Validates a plugin manifest against the required schema

wait_for_state(plugin_pid, expected_state, timeout \\ 5000)

Waits for a plugin to reach a specific state