Skip to content

optional: true skips a step's actions too (not just its assertion) — skipping a login/setup step silently breaks downstream #102

@komal-lt

Description

@komal-lt

Summary

optional: true makes the entire step soft-fail/skippable — including its actions, not just its final assertion. For a step that performs setup side-effects (e.g. login), this is dangerous: on replay the step can be skipped, so the side-effects never happen and every downstream step then fails.

Context / why we hit it

We use a shared self-login step imported into every test:

## Log in
```yaml
optional: true

@import helpers/login.md


It must be `optional: true` to tolerate the non-deterministic terminal analyze+assert that kane appends to a multi-action step (see #85). But the side effect of `optional` is that the **login actions** (navigate, fill email/password, click) also become skippable. When the step is skipped on replay (`steps: {skipped:1}`), the fresh isolated browser is never authenticated → the next step opens an app page, gets redirected to login, and fails. So `optional` is simultaneously *required* (to tolerate #85) and *harmful* (it can skip the auth actions).

## The gap
There's no way to express "the **actions** in this step are mandatory, but its **assertion** is optional." `optional: true` is all-or-nothing at the step level.

## Ask
Separate the two concerns, e.g.:
- a step-level flag that makes only the **checkpoint/assertion** optional while keeping actions mandatory, or
- the ability to mark an individual checkpoint optional, or
- a way to suppress the auto-appended terminal assert on a multi-action step.

## Env
kane-cli 0.4.1, `testmd run`, `@import` helper marked `optional: true`. Related: #85 (the appended-assert flake that forces us to use `optional` here).

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions