Skip to content
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

feat(route): rename method, add response option #8386

Merged
merged 4 commits into from Aug 24, 2021

Conversation

yury-s
Copy link
Member

@yury-s yury-s commented Aug 24, 2021

Two changes to the response interception API:

  • Renamed intercepting method to Route._continueToRequest
  • Take intercepted response as an option in Route.fulfill()

#1774

res.end('Woo-hoo');
});
const page2 = await page.context().newPage();
const sampleResponse = await page2.goto(`${server.PREFIX}/sample`);
Copy link
Member Author

@yury-s yury-s Aug 24, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We cannot use page.goto() here (need to create page2) to create sampleResponse as in that case sampleResponse.body() would throw because page would already have started navigating to another URL. Perhaps we should bail out if we cannot retrieve response body of the response which is passed or only accept intercepted response.

@yury-s yury-s added CQ1 and removed CQ1 labels Aug 24, 2021
@yury-s yury-s added CQ1 and removed CQ1 labels Aug 24, 2021
@yury-s yury-s merged commit 59422a0 into microsoft:master Aug 24, 2021
@yury-s yury-s deleted the continue-to-response branch August 24, 2021 18:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants