# click

The `click` step.

Clicks an element once it is visible, enabled and not covered; an obstacle in the way is handled by the obstacle layer first.

Type: `target`

## Keys

| Key | Type | Description |
|---|---|---|
| `click.button` | `"left" \| "right" \| "middle"` | The mouse button: `left` (the default), `right` or `middle`. |
| `click.count` | `integer` | The number of clicks, from `1` to `3`, so `2` is a double click. Defaults to `1`. |
| `click.modifiers` | `"Alt" \| "Control" \| "Meta" \| "Shift"[]` | Keys held down during the click: any of `Alt`, `Control`, `Meta` and `Shift`. |

Every step also takes the [common step keys](https://docs.kaab.ist/reference/dsl/steps#common-keys): `expect`, `id`, `if`, `name`, `on_error`, `optional`, `retry`, `side_effect`, `timeout_ms`, `x_kaab`.

## Example

```json
{
  "id": "submit",
  "click": {
    "role": "button",
    "name": "Sign in"
  },
  "side_effect": true,
  "expect": {
    "any": [
      {
        "visible": "#otp"
      },
      {
        "landmark": "logged_in"
      }
    ]
  }
}
```

From the contract fixture `login-2fa-checkpoint-report`, a program the test suite validates.
