Skip to content

fix(percy): restore Percy capture on WebdriverIO (v8) (SDK-7756) - #231

Open
rounak610 wants to merge 2 commits into
v8from
fix/sdk-7756-percy-v8
Open

rounak610 wants to merge 2 commits into
v8from
fix/sdk-7756-percy-v8

Conversation

@rounak610

@rounak610 rounak610 commented Sep 24, 2026 •

Copy link
Copy Markdown
Collaborator

What is this about?

Ports the v9 Percy fixes (#210 + #228) to the v8 line. Percy captured nothing on WebdriverIO — both the screenshot and the snapshot paths were dead — and this restores both, matching v9.

Two silent bugs (same as v9):

  1. Screenshot / Automate path (percyScreenshot). @percy/selenium-webdriver 2.2.6 added an unguarded top-level require('selenium-webdriver'), which it ships only as a devDependency — so in a WebdriverIO project it throws MODULE_NOT_FOUND, our tryRequire swallowed it, and every Percy call became a no-op logging Unsupported driver for percy. v8's floating ^2.0.3 had locked to the broken 2.2.6 in the lockfile. Bumped to ^2.2.8 (Percy's fix) so it resolves to the loadable 2.2.8.
  2. Web snapshot path. snapshot was wired to @percy/selenium-webdriver, which drives the browser with Selenium-only APIs (executeScript(script), By, switchTo()) a WebdriverIO browser does not have — it never worked at any version. Rerouted to @percy/webdriverio (the WebdriverIO-native port), added as ^3.3.4. (3.3.3 shipped without its _iframe_shim.js file and failed to load; Percy fixed it in 3.3.4.)

Also: all Percy entry points now run through a runPercy wrapper that logs Percy's errors instead of throwing them into the user's test; PERCY_RAISE_ERROR=true restores throwing. README documents the percy / percyCaptureMode options.

PercySDK.ts is the same implementation shipped in v9 #210. No proto/gRPC changes.

Related Jira task/s

Release (mandatory for every PR — required for the ready-for-review label)

Version bump: (required — tick exactly one)

  • minor (backwards-compatible feature)
  • patch (bug fix or other small change)

Release notes type: (optional)

  • New Feature
  • Bug Fix
  • Other Improvement

Release notes (customer-facing): (optional but encouraged)

  • Fixed Percy visual testing on WebdriverIO: screenshots (Percy on Automate) and web snapshots are captured again. No config or code changes needed.

Release notes (internal): (required — engineer-facing; what actually changed / why)

Checklist

  • Ready to review
  • Has it been tested locally?

PR Validations

Run Tests: Comment RUN_TESTS to trigger sanity tests.

Ports the v9 Percy fixes (#210, #228) to the v8 line:

- Route web `snapshot` to @percy/webdriverio instead of
  @percy/selenium-webdriver (whose Selenium-only APIs a WebdriverIO
  browser does not provide), and add @percy/webdriverio ^3.3.4 (3.3.3
  shipped without _iframe_shim.js and failed to load; fixed in 3.3.4).
- Bump @percy/selenium-webdriver to ^2.2.8 so the Automate
  percyScreenshot path stops resolving to the broken 2.2.6/2.2.7, which
  added an unguarded top-level require('selenium-webdriver') and
  silently disabled Percy on WebdriverIO.
- Wrap all Percy entry points so their errors are logged rather than
  thrown into the user's test; PERCY_RAISE_ERROR=true restores throwing.
- Document the percy / percyCaptureMode options in the README.

SDK-7756

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@rounak610
rounak610 requested a review from a team as a code owner September 24, 2026 13:41
@rounak610
rounak610 requested review from 07souravkunda and pranay-v29 and removed request for a team September 24, 2026 13:41
@coderabbitai

coderabbitai Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Central YAML (base), Organization UI (inherited), Workspace UI (inherited)

Review profile: ASSERTIVE

Plan: Enterprise

Run ID: 7c1c6b5e-b5e8-4694-8d6b-6a3db28dcad1

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Comment @coderabbitai help to get the list of available commands.

@rounak610
rounak610 requested review from harshit-browserstack and removed request for 07souravkunda September 24, 2026 14:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant