Set up your CodeBeaver tests using the CodeBeaver YAML file
The codebeaver.yml
configuration file is the central point for defining and managing your CodeBeaver test suite configuration. This file specifies how CodeBeaver executes tests across your codebase, including test environments, frameworks, and execution parameters.
It is broadly divided into test types. A simple example is the following:
If you don’t need Unit Tests or End 2 End tests, you can simply not define them in the codebeaver.yml
and they will not run.
The Unit tests section defines how CodeBeaver will run and iterate on your Unit tests.
A Codebeaver.yml file is divided in workspaces. A workspace represent a separate test environment.
For repositories requiring one test environment, you can define the workspace at the root level like so:
For monorepos or projects requiring multiple test environments, you can define separate workspaces like so:
A workspace can have the following properties:
Services work just like docker-compose services. You can define ports, depends_on, and so on.
If not using a template, you must define the following properties:
services
main_service
test_commands
single_file_test_commands
CodeBeaver provides pre-configured templates to simplify setup. Templates can be referenced using the from
directive. For example, to use the pytest
template without any customization:
You can see a list of the available templates below.
Templates serve as a foundation that you can extend. For example, to add environment variables to a template:
The @merge
directive is a powerful feature that allows you to combine any root-level configuration from a template with your custom configuration. It can be used in two ways:
@merge
):
{"@merge": value}
):
The @merge
directive can be used with any root-level configuration, including:
services
environment
setup_commands
test_commands
single_file_test_commands
Without the @merge
directive, your configuration would completely override the template’s configuration. Including @merge
ensures you’re extending rather than replacing the template’s settings:
CodeBeaver provides official templates for common testing frameworks:
You can all official templates in our template repository.
End-to-End (E2E) testing in CodeBeaver simulates real user interactions within a browser environment, validating the complete functionality of your application from a user’s perspective. CodeBeaver currently supports browser-based E2E testing using natural language test descriptions.
E2E tests are defined in the codebeaver.yml
file using a human-readable format. Each test consists of a unique identifier, a starting URL, and a sequence of test steps. Here’s an example:
Each E2E test requires the following components:
Each test must include at least one validation step that begins with the word “Check”. This validation step is crucial as it’s used by CodeBeaver’s LLM model to determine test success or failure.
To ensure maintainable and reliable E2E tests:
Keep Tests Focused
Write Resilient Tests
Use Clear Descriptions
Coming soon.
CodeBeaver is currently in open beta. We welcome your feedback and suggestions:
Set up your CodeBeaver tests using the CodeBeaver YAML file
The codebeaver.yml
configuration file is the central point for defining and managing your CodeBeaver test suite configuration. This file specifies how CodeBeaver executes tests across your codebase, including test environments, frameworks, and execution parameters.
It is broadly divided into test types. A simple example is the following:
If you don’t need Unit Tests or End 2 End tests, you can simply not define them in the codebeaver.yml
and they will not run.
The Unit tests section defines how CodeBeaver will run and iterate on your Unit tests.
A Codebeaver.yml file is divided in workspaces. A workspace represent a separate test environment.
For repositories requiring one test environment, you can define the workspace at the root level like so:
For monorepos or projects requiring multiple test environments, you can define separate workspaces like so:
A workspace can have the following properties:
Services work just like docker-compose services. You can define ports, depends_on, and so on.
If not using a template, you must define the following properties:
services
main_service
test_commands
single_file_test_commands
CodeBeaver provides pre-configured templates to simplify setup. Templates can be referenced using the from
directive. For example, to use the pytest
template without any customization:
You can see a list of the available templates below.
Templates serve as a foundation that you can extend. For example, to add environment variables to a template:
The @merge
directive is a powerful feature that allows you to combine any root-level configuration from a template with your custom configuration. It can be used in two ways:
@merge
):
{"@merge": value}
):
The @merge
directive can be used with any root-level configuration, including:
services
environment
setup_commands
test_commands
single_file_test_commands
Without the @merge
directive, your configuration would completely override the template’s configuration. Including @merge
ensures you’re extending rather than replacing the template’s settings:
CodeBeaver provides official templates for common testing frameworks:
You can all official templates in our template repository.
End-to-End (E2E) testing in CodeBeaver simulates real user interactions within a browser environment, validating the complete functionality of your application from a user’s perspective. CodeBeaver currently supports browser-based E2E testing using natural language test descriptions.
E2E tests are defined in the codebeaver.yml
file using a human-readable format. Each test consists of a unique identifier, a starting URL, and a sequence of test steps. Here’s an example:
Each E2E test requires the following components:
Each test must include at least one validation step that begins with the word “Check”. This validation step is crucial as it’s used by CodeBeaver’s LLM model to determine test success or failure.
To ensure maintainable and reliable E2E tests:
Keep Tests Focused
Write Resilient Tests
Use Clear Descriptions
Coming soon.
CodeBeaver is currently in open beta. We welcome your feedback and suggestions: