Skip to Content

Context

The .bytesalt/context directory is an important part of your Bytesalt test setup. It provides the AI agent with the necessary information to understand your application and test it effectively.

      • app-description.md
      • user-flows.md
      • api-spec.json

Purpose of the Context Directory

The primary purpose of the context directory is to give the AI agent a frame of reference for what it needs to test. You can include various types of information in this directory to guide the testing process.

What to Include

You can include any files or documents that you think would be helpful for the AI agent. Here are some examples of what you can put in your context directory:

  • App Description: A brief overview of your application, its purpose and its URL.
  • User Flows: Descriptions of common user journeys or critical paths.
  • Key Features: A list of the main features supported by your application.
  • Important notes: Specific instructions or scenarios you want the AI to follow.
  • API Specifications: If you’re testing an API, you can include your OpenAPI or Swagger specs.
  • Browsers supported: List of browsers supported by your application.
  • Devices supported: List of devices supported by your application.
  • User credentials: User credentials or instructions to create a new user for testing purposes

Dynamic Context via CLI

While the context directory is great for static information, you often need to provide dynamic context, such as a Git diff or a Pull Request description.

You can use the --context flag with the start command to provide dynamic context:

bytesalt start "Test the changes introduced in this pull request" \ --context "pr-description.md=$(gh pr view --json body -q .body)" \ --context "changes.diff=@<(git diff main)"

See the start command documentation for more details on the --context flag syntax.

Supported File Types

Bytesalt supports textual files in the context directory or via the CLI flag. This includes file types like .md, .txt, .json, .yaml, and source code files.

While various textual formats are supported, we recommend using Markdown (.md) files for providing descriptive context, as they are easy to read and structure.

Last updated on