Context:
- Playwright Version: 1.14.1
- Operating System: Mac
- Node.js version: 16.14.0
- Browser: Chromium
Code Snippet
Help us help you! Put down a short code snippet that illustrates your bug and that we can run and debug locally. For example:
const cookieObj = {
name: "Bearer",
value: token,
url: "http://localhost:4000",
}
test.beforeAll(async ({ browser }) => {
const page = await browser.newPage()
const context = await browser.newContext()
await context.addCookies([cookieObj])
await page.goto(`/#/`, { waitUntil: "networkidle", timeout: 60 * 1000 })
})
Describe the bug
I try to set a cookie but it does not show up in dev tools I have tried this: console.log(await context.cookies()) and it logs the cookie
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Bug Definition & Meaning - Merriam-Webster
The meaning of BUG is any of an order (Hemiptera and especially its suborder Heteroptera) of insects (such as an assassin bug or...
Read more >Bug (2006) - IMDb
An unhinged war veteran holes up with a lonely woman in a spooky Oklahoma motel room. The line between reality and delusion is...
Read more >bug - Wiktionary
(entomology) An insect of the order Hemiptera (the “true bugs”). Any of various species of marine or freshwater crustaceans; e.g. a Moreton Bay...
Read more >Bug - Wikipedia
A terrestrial arthropod animal (with at least six legs). Insect, a six-legged arthropod · Covert listening device, used in surveillance, espionage and policing ......
Read more >BUG | definition in the Cambridge English Dictionary
bug noun (INSECT) ... an insect: Some tiny white bugs had eaten the leaves of my house plants. ... A bug is also...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Oh, it makes sense, I missed the fact that you create the page using browser.newPage, that method is a shortcut for creating a new page in a new context, so the code before was equivalent to:
i.e. the cookies were added to a different context.
@yury-s do you mind renaming the issue for future references, ‘how to add cookie in playwright’ ?