> For the complete documentation index, see [llms.txt](https://argos-ci.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://argos-ci.com/docs/learn/reliability-and-flakiness/flaky-tests/argos-helpers.md).

# Argos helpers

Use data-visual-test attributes or SDK options to hide, remove, or mask dynamic elements for consistent, flake-free screenshots.

Every Argos SDK recognizes `data-visual-test` attributes on your elements, giving you control over how dynamic content appears in screenshots. Use them for anything you can't stabilize at the source — dates, avatars, ads, or third-party widgets.

### Helpers

* `data-visual-test="transparent"`: Makes the element invisible with `opacity: 0` and transparent text, and switches its font to monospace. Unlike `removed`, the element keeps a place in the layout.
* `data-visual-test="removed"`: Removes the element from view (`display: none`).
* `data-visual-test="blackout"`: Masks the element with a blackout effect.
* `data-visual-test-no-radius`: Strips the border radius from the element. See [Browser glitches](/docs/learn/reliability-and-flakiness/flaky-tests/browser-glitches.md).
* `data-visual-test-wait-bg-img`: Waits for the element's (and its descendants') CSS background images to load before capturing. See [Wait for background images](/docs/learn/reliability-and-flakiness/flaky-tests/wait-for-background-images.md).
* `data-image-type="gif"`: Flags an image as a GIF so it's paused even when its URL has no `.gif` extension. See [Pause animated GIFs](/docs/learn/reliability-and-flakiness/flaky-tests/pause-gifs.md).

For example, to hide a clock from the captured screenshot:

```html
<div id="clock" data-visual-test="transparent">...</div>
```

The WebdriverIO SDK applies the `transparent`, `removed`, `blackout`, and `no-radius` helpers, but not the rest of Argos stabilization, so `data-visual-test-wait-bg-img` and `data-image-type="gif"` have no effect there. In an Appium native app context, no helper applies.

### Apply helpers from your tests

When you can't or don't want to change the markup, pass the elements to `argosScreenshot` instead. They get the same treatment as with the attribute, for that screenshot only: Argos restores the page afterwards.

| Helper        | `argosScreenshot` option       |
| ------------- | ------------------------------ |
| `transparent` | `hide`                         |
| `removed`     | `remove`                       |
| `blackout`    | `mask` (`blackout` in Cypress) |

For example, with Playwright:

```ts
await argosScreenshot(page, "dashboard", {
  hide: ["#clock", page.getByTestId("avatar")],
  remove: [".cookie-banner"],
  mask: ["#map"],
});
```

Selectors that match nothing are ignored, and an element in both `hide` and `remove` is removed. With [viewports](/docs/learn/how-to-guides/visual-coverage/responsive-viewports.md), the options apply to each viewport.

These options are available in every SDK: [Playwright](/docs/reference/playwright.md#helper-attributes-for-visual-testing), [Puppeteer](/docs/reference/puppeteer.md#helper-attributes-for-visual-testing), [Cypress](/docs/reference/cypress.md#helper-attributes-for-visual-testing), [WebdriverIO](/docs/reference/webdriverio.md#helper-attributes-for-visual-testing), [Vitest](/docs/reference/vitest.md), and [Storybook](/docs/reference/storybook.md). See each SDK reference for what the options accept.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://argos-ci.com/docs/learn/reliability-and-flakiness/flaky-tests/argos-helpers.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
