Skip to content

Feature request: Network response mocking / interception #233

Description

@rakeshkarkare

Problem or motivation

Thanks for building Mobilewright — the accessibility-tree-based approach is a great fit for our test suite.

One capability we're missing compared to Playwright is network mocking. Playwright lets you intercept and mock HTTP requests/responses (e.g. page.route()), which is essential for testing edge cases like error states, slow networks, empty states, and third-party API failures without depending on a real backend.

Proposed solution

The roadmap mentions HAR recording and traffic inspection, which is great for observability, but it sounds like that's read-only. Would it be possible to also support:

  • Intercepting outgoing HTTP/HTTPS requests from the app under test
  • Returning a mocked/stubbed response (status code, headers, body) instead of hitting the real network
  • Optionally matching by URL pattern, method, or headers (similar to Playwright's page.route())

This would let us reliably test error handling, loading states, and edge cases on both iOS and Android without needing a staging backend or flaky real network calls.

Target platform

Both

Alternatives considered

No response

Additional context

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions