Skip to content

[BUG] Now work mocking with route.fulfill json #1693

Closed
@zimaev

Description

@zimaev

Context:

  • Playwright Version: [Version 1.29]
  • Operating System: [Windows, Mac]
  • Python version: [3.10]
  • Browser: [Chromium,]

Code Snippet

def test_mock_tags(page):

    def handle_route(route: Route):

        response = route.fetch()
        json = response.json()
        json["tags"] = ["implementations", "deserunt"]
        route.fulfill(json=json, response=response)


    page.route("**/api/tags", handle_route)
    page.goto('https://demo.realworld.io/')

Describe the bug
There is no mocking of json data.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions