Rayrun
← Back to Discord Forum

Has getExtraHTTPHeaders method been considered?

Hi, I'm interested in making multiple setExtraHTTPHeaders within a single test. In this case, I have one fixture that will apply a header and then the test case body should be able to apply additional headers. Right now, making the second call will replace the earlier headers. What's the best way to solve this?

I've tried to add a page.route call within the fixture, but it does not reliably apply because of redirects. I was thinking that adding a new getExtraHTTPHeaders property/method would solve it where down-streams can opt-in to merging existing values. Another idea would be to add a new updateExtraHTTPHeaders method. Is this worth adding to the library?

This thread is trying to answer question "What's the best way to apply multiple 'setExtraHTTPHeaders' within a single test without the second call replacing the earlier headers?"

0 replies

Related Discord Threads

TwitterGitHubLinkedIn
AboutQuestionsDiscord ForumBrowser ExtensionTagsQA Jobs

Rayrun is a community for QA engineers. I am constantly looking for new ways to add value to people learning Playwright and other browser automation frameworks. If you have feedback, email [email protected].