Repository navigation
docs: document hide, remove and mask screenshot options - #264
Merged
Merged
Conversation
Add the `hide` and `remove` options of `argosScreenshot` to the Playwright, Puppeteer, Cypress and Vitest references, with examples next to the helper attributes. `hide` works like `data-visual-test="transparent"` and `remove` like `data-visual-test="removed"`. Playwright `mask` and Cypress `blackout` now add to the elements with `data-visual-test="blackout"` instead of replacing them, so drop the workaround from the Playwright page. The helpers page gets a section on applying helpers from the tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
🔵 Needs a closer look
Upstream SDK PR #403 remains unmerged, so a maintainer must confirm the required release before merging these docs.
No open issues 🎉
What changed in this PR
Documents test-side screenshot helpers for hiding dynamic content without changing application markup.
Changes:
- Adds
hideandremoveoptions and examples across SDK references. - Clarifies additive masking and Vitest per-call overrides.
- Maps helper attributes to SDK options in the shared guide.
| File | Description |
|---|---|
| docs/sdks-reference/vitest.md | Documents selectors and plugin-default overrides. |
| docs/sdks-reference/puppeteer.md | Adds helper options and usage example. |
| docs/sdks-reference/playwright.md | Adds helper options and clarifies additive masking. |
| docs/sdks-reference/cypress.md | Documents helper options and additive blackout. |
| docs/learn/reliability-and-flakiness/flaky-tests/argos-helpers.md | Maps attributes to test-side options and SDK references. |
Review effort: Balanced
jsfez
approved these changes
Oct 21, 2026
5 of 6 tasks
argos-javascript#403 now also covers Puppeteer masking, WebdriverIO support and selectors in the Playwright and Vitest `mask` option. - Puppeteer: `mask` and `maskColor`, and the `blackout` helper. - WebdriverIO: `hide`, `remove`, `argosCSS`, selector masks, and the `data-visual-test` helpers, which now apply. Stabilization waits still don't run. Warn that screenshots of pages using the helpers change on upgrade. - Playwright: `mask` accepts string selectors, `maskColor` listed. - Vitest: per-call `mask` and `maskColor`. - Helpers page: every SDK applies the helpers and has the options. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
hide and remove screenshot optionshide, remove and mask screenshot options
In an Appium native app context there is no page to run the Argos script in, so the helpers don't apply, `mask` only accepts rectangles, and `hide`, `remove`, `argosCSS` or selector masks throw an error (argos-javascript#403, 5c5b175). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Documents the
hide,removeandmaskoptions ofargosScreenshotfrom argos-ci/argos-javascript#403 (ARG-520), which now covers every SDK. They let you hide, remove or mask dynamic elements from the test, without addingdata-visual-testattributes to the app.Important
Merge only after the SDK release that includes argos-ci/argos-javascript#403. #403 is merged on
main(4609e4a..5712957) but not released yet: npm still has playwright 7.7.1, puppeteer 6.1.11, cypress 7.2.4, webdriverio 0.9.0, vitest 0.8.0 and storybook 6.4.2.Changes
options.hideandoptions.remove(Locators or string selectors),options.mask(now also string selectors) andoptions.maskColorin theargosScreenshotoptions, plus an example in "Helper Attributes for Visual Testing". "Mask elements" now saysmaskadds to the[data-visual-test="blackout"]elements, so I removed the workaround of re-adding the blackout locator yourself.hide,removeand the newmask(string selectors orElementHandles) andmaskColor.data-visual-test="blackout"is now listed in the helpers.hideandremove(selectors), andblackout, which now extends the[data-visual-test="blackout"]selector (fixed on argos-javascriptmainin f72211e, also unreleased).hide,remove(WebdriverIO selectors),mask(now WebdriverIO selectors as well as rectangles; elements withdata-visual-test="blackout"are always masked) and the newargosCSS. The hint saying the SDK captures as-is is replaced: thedata-visual-testhelpers andargosCSSnow apply, but stabilization waits (loading, fonts, images, GIFs, scrollbars, carets) still don't. A new "Helper Attributes for Visual Testing" section matches the other SDKs, with a warning that screenshots of pages usingdata-visual-testattributes change after upgrading. In an Appium native app context, the screen is still captured as is: no helpers, rectangle masks only, andhide,remove,argosCSSor selector masks throw an error (5c5b175).hide,remove,mask(selectors) andmaskColorin the per-call options. The plugin paragraph notes that a per-call list replaces the plugin's list instead of adding to it ({ ...pluginOptions, ...options }).blackoutis no longer limited to some SDKs. A note says WebdriverIO appliestransparent,removed,blackoutandno-radius, but not the stabilization ones (wait-bg-img, GIF pausing). A new "Apply helpers from your tests" section mapstransparent→hide,removed→remove,blackout→mask(blackoutin Cypress), with a Playwright example and links to every SDK reference.Checked against the merged code on argos-javascript
main(5712957, same tree as the #403 head 5c5b175). Behavior described everywhere:hidekeeps the element's layout space,removetakes it out of the layout, selectors that match nothing are ignored, an element in both lists is removed, and the page is restored after the screenshot. The options are applied again for each viewport in the SDKs that support viewports.Not changed
from-lost-pixel.md,from-vitest-native-screenshots.md) still mapmasktodata-visual-testhelpers orargosCSS. They could point tohide/maskin a follow-up.🤖 Generated with Claude Code