Skip to content

Version Packages #918

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 12, 2025
Merged

Version Packages #918

merged 1 commit into from
May 12, 2025

Conversation

github-actions[bot]
Copy link
Contributor

This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.

Releases

@wdio/visual-service@8.0.0

Major Changes

  • bfe6aca: ## 💥 BREAKING CHANGES

    🧪 Web Screenshot Strategy Now Uses BiDi by Default

    What was the problem?

    Screenshots taken via WebDriver's traditional protocol often lacked precision:

    • Emulated devices didn't reflect true resolutions
    • Device Pixel Ratio (DPR) was often lost
    • Images were cropped or downscaled

    What changed?

    All screenshot-related methods now use the WebDriver BiDi protocol by default (if supported by the browser), enabling:

    ✅ Native support for emulated and high-DPR devices
    ✅ Better fidelity in screenshot size and clarity
    ✅ Faster, browser-native screenshots via browsingContext.captureScreenshot

    The following methods now use BiDi:

    • saveScreen / checkScreen
    • saveElement / checkElement
    • saveFullPageScreen / checkFullPageScreen

    What’s the impact?

    ⚠️ Existing baselines may no longer match.
    Because BiDi screenshots are sharper and match device settings more accurately, even a small difference in resolution or DPR can cause mismatches.

    If you rely on existing baseline images, you'll need to regenerate them to avoid false positives.

    Want to keep using the legacy method?

    You can disable BiDi screenshots globally or per test using the enableLegacyScreenshotMethod flag:

    Globally in wdio.conf.ts:

    import { join } from "node:path";
    
    export const config = {
      services: [
        [
          "visual",
          {
            baselineFolder: join(process.cwd(), "./localBaseline/"),
            debug: true,
            formatImageName: "{tag}-{logName}-{width}x{height}",
            screenshotPath: join(process.cwd(), ".tmp/"),
            enableLegacyScreenshotMethod: true, // 👈 fallback to W3C-based screenshots
          },
        ],
      ],
    };

    Or per test:

    it("should compare an element successfully using legacy screenshots", async function () {
      await expect($(".hero__title-logo")).toMatchElementSnapshot(
        "legacyScreenshotLogo",
        { enableLegacyScreenshotMethod: true } // 👈 fallback to W3C-based screenshots
      );
    });

    🐛 Bug Fixes

    • #916: Visual Testing Screenshot Behavior Changed in Emulated Devices

    Committers: 1

Patch Changes

  • Updated dependencies [bfe6aca]
    • webdriver-image-comparison@9.0.0

webdriver-image-comparison@9.0.0

Major Changes

  • bfe6aca: ## 💥 BREAKING CHANGES

    🧪 Web Screenshot Strategy Now Uses BiDi by Default

    What was the problem?

    Screenshots taken via WebDriver's traditional protocol often lacked precision:

    • Emulated devices didn't reflect true resolutions
    • Device Pixel Ratio (DPR) was often lost
    • Images were cropped or downscaled

    What changed?

    All screenshot-related methods now use the WebDriver BiDi protocol by default (if supported by the browser), enabling:

    ✅ Native support for emulated and high-DPR devices
    ✅ Better fidelity in screenshot size and clarity
    ✅ Faster, browser-native screenshots via browsingContext.captureScreenshot

    The following methods now use BiDi:

    • saveScreen / checkScreen
    • saveElement / checkElement
    • saveFullPageScreen / checkFullPageScreen

    What’s the impact?

    ⚠️ Existing baselines may no longer match.
    Because BiDi screenshots are sharper and match device settings more accurately, even a small difference in resolution or DPR can cause mismatches.

    If you rely on existing baseline images, you'll need to regenerate them to avoid false positives.

    Want to keep using the legacy method?

    You can disable BiDi screenshots globally or per test using the enableLegacyScreenshotMethod flag:

    Globally in wdio.conf.ts:

    import { join } from "node:path";
    
    export const config = {
      services: [
        [
          "visual",
          {
            baselineFolder: join(process.cwd(), "./localBaseline/"),
            debug: true,
            formatImageName: "{tag}-{logName}-{width}x{height}",
            screenshotPath: join(process.cwd(), ".tmp/"),
            enableLegacyScreenshotMethod: true, // 👈 fallback to W3C-based screenshots
          },
        ],
      ],
    };

    Or per test:

    it("should compare an element successfully using legacy screenshots", async function () {
      await expect($(".hero__title-logo")).toMatchElementSnapshot(
        "legacyScreenshotLogo",
        { enableLegacyScreenshotMethod: true } // 👈 fallback to W3C-based screenshots
      );
    });

    🐛 Bug Fixes

    • #916: Visual Testing Screenshot Behavior Changed in Emulated Devices

    Committers: 1

@wswebcreation wswebcreation merged commit b74b398 into main May 12, 2025
2 checks passed
@wswebcreation wswebcreation deleted the changeset-release/main branch May 12, 2025 08:41
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.

2 participants