adventurer

package
v0.9.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 20, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Executor

type Executor struct {
	// contains filtered or unexported fields
}

Executor drives a headless browser through quest steps.

func New

func New(timeout time.Duration, logger *slog.Logger) *Executor

New creates an Executor with the given default timeout and logger. If logger is nil, slog.Default() is used so that executeStep is always safe to call.

func (*Executor) Execute

func (e *Executor) Execute(ctx context.Context, quest *questgiver.Quest) *Result

Execute runs all steps of a quest in a headless Chrome browser and returns the result. On the first step failure, execution stops immediately.

type Result

type Result struct {
	QuestName    string
	Passed       bool
	Duration     time.Duration
	FailedStep   int // -1 if all passed
	ErrorMessage string
	Screenshots  []string // file paths to captured screenshots
	StepResults  []StepResult
}

Result holds the outcome of executing a quest.

type StepResult

type StepResult struct {
	Index    int
	Action   string
	Passed   bool
	Duration time.Duration
	Error    string
}

StepResult holds the outcome of a single quest step.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL