# treat your tests like code

Bring end-to-end testing into your git workflow. Version control, review, and edit your tests locally.

## user-login.yaml

```yaml
1# user-login.yaml
2id: 5fdcdbbd-19d6-5467-9288-191dd7ed3fcc
3description: user-login
4elements:
5  - interaction:
6      action: ENTER_TEXT
7      calledWith: $OCTO_USERNAME
8    selectors:
9      - selectorType: ROLE
10        selector: textbox
11        options:
12          name: Account name or email
13    ignoreFailure: false
14  - interaction:
15      action: ENTER_TEXT
16      calledWith: $OCTO_PASSWORD
17    selectors:
18      - selectorType: ROLE
19        selector: textbox
20        options:
21          name: Password
```

## Terminal

```bash
➜ my-web-app git:(main) octomind pull

✔ Authenticating with Octomind...
ℹ Fetching test configurations...

user-login.yaml [####################] 100%
checkout-flow.yaml [####################] 100%
signup-validation.yaml [####################] 100%

✔ Success! 3 test cases synced to ./.octomind

➜ my-web-app git:(main)
```

## AI-generated, developer controlled

### Initialize

Pull your AI-generated tests into your repo as readable YAML.

### Commit

Check the generated test files into your repository. They are now part of your codebase version history.

### Edit

Need to tweak a selector? The AI does the heavy lifting, but the YAML exports give you full granular control to edit manually when you want.

## user-login.yaml

```yaml
1steps:
2id: 5fdcdbbd-19d6-5467-9288-191dd7ed3fcc
3description: user-login
4elements:
5  - interaction:
6      action: ENTER_TEXT
7      calledWith: $OCTO_USERNAME
8    selectors:
9      - selectorType: ROLE
10        selector: textbox
11        options:
12          name: Account name or email
13    ignoreFailure: false
14  - interaction:
15      action: ENTER_TEXT
16      calledWith: $OCTO_PASSWORD
17    selectors:
18      - selectorType: ROLE
19        selector: textbox
20        options:
21          name: Password
```

### Run Locally

Debug instantly. Run any test case against your local host or staging URL to verify changes before you push.

### Sync

Push to Main. Your CI/CD pipeline syncs the definitions back to Octomind and executes them.

## Terminal

```bash
➜ my-web-app git:(main) git push origin main
```

## build. test. ship. without leaving your IDE

Dev Mode bridges the gap between AI-generated testing and your local development workflow.

### Atomic Commits & Reviews

Test versioning, done right.

### Your Editor, Your Rules

Edit tests with full schema validation, linting, and autocomplete.

### Zero Drift

Pull latest tests or push local changes in seconds.

## automated sync & execution

Keep your platform tests in lockstep with your repository. This workflow pushes your latest YAML definitions to Octomind and triggers a regression suite every time you merge to main.

### Post-Merge Synchronization

```yaml
1name: Octomind Dev Mode Sync
2on:
3  push:
4    branches:
5      - main # or your default branch
6
7jobs:
8  sync-tests:
9    runs-on: ubuntu-latest
10    steps:
11      - name: Checkout code
12        uses: actions/checkout@v4
13
14      - name: Execute tests on Octomind
15        uses: OctoMind-dev/automagically-action-execute@v2
16        with:
17          url: <your-production-or-staging-url>
18          token: ${{ secrets.OCTOMIND_API_KEY }}
19          testTargetId: <your-testTargetId>
```

## frequently asked questions

### Can I manually edit the selectors in the YAML?

Yes. The YAML files are standard and readable. You can tweak selectors, add assertions, or modify interactions using your IDE, and version control those changes just like application code.

### Can I run tests on my machine before pushing?

Yes. You can use the command octomind execute-local to run any YAML test case directly against your localhost or staging URL. This allows you to debug and verify changes instantly without waiting for the CI pipeline.

### Do I need to change my existing Pull Request workflow?

No. Your existing PR checks can stay the same (validating builds). DEV mode adds a new step: a "Post-Merge" workflow that runs only after code lands in main to keep the platform synchronized.

### What happens if I edit the YAML file locally?

Once you commit and push your changes to the main branch, your CI/CD pipeline (via the post-merge workflow) will automatically push the updated definitions to Octomind and execute them.

### I updated a test in the Octomind UI. Is it automatically in my repo?

No. In DEV mode, your Git repository is the single source of truth. If you create or edit tests in the UI, you must run octomind pull to fetch those changes into your local environment.
