MarketSquare / MarketSquare/robotframework-browser

Intercepting and modifying responses (playwright page.route)

Open
#524 5 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement priority: medium
Dominant language
Python
Stars
655
Forks
147
Avg merge
5h 27m
Merged PRs (30d)
59

Description

**Modifying responses**
As a tester I need to _intercept and modify response to a request_,
so that I can _mock various error states_ handling on UI.

(eg.: How will application frontend handle error state 500? - it should show specific message to user, but in fully working application it is not easy to cause backend to fail)

**Solution: New `Page Route` keyword**
Based on playwright [documentation](https://playwright.dev/#version=v1.4.2&path=docs%2Fnetwork.md&q=network) it should be possible to intercept and modify HTTP and HTTPS requests/responses.

Playwright-python: page.route : [Documentation](https://github.com/microsoft/playwright-python#intercept-network-requests)

Playwright [page.route](https://playwright.dev/#version=v1.4.2&path=docs%2Fapi.md&q=pagerouteurl-handler) for this.

This would be of great value for testing.

Thanks a lot for considering this,
regards,
Jan.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the existing Robot Framework Browser keyword entry points and the Playwright page.route documentation linked in the issue. Trace how browser actions are exposed and tested, then verify that a routed response can be modified to produce a mocked HTTP 500 error and that the resulting UI behavior is covered.

Written by the indexing model from the issue text.

Assessment

Tech stack
playwright, python
Domain
testing-qa
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.