Open TomasHubelbauer opened 1 year ago
This would be indeed a great feature to add. Our team manages a push service and being able to test the web push part of the flow.
My usecase is a bit different though, since playwright launches in incognito mode only and there's no way to change that behavior, I'm stuck with the following issue :
Chrome currently does not support the Push API in incognito mode (https://crbug.com/401439). There is deliberately no way to feature-detect this, since incognito mode needs to be undetectable by websites.
But maybe working on this ticket/feature would have the side effect of somehow fixing this ? in either case, there's definite interest.
@kenanAlhindi97 I am not 100 % sure but I think using launchPersistentContext
might help you some - AFAIK that type of context is not incognito. Thought you'll still end up where I ended up even if this removes the incognito problem for you, so it is not a full solution.
This is a follow-up to an existing but closed ticket #3301. I was asked to open a new ticket. I specifically care about handling web push notifications. It seems that is somewhat possible in Playwright now (I would love a clarification on what is expected to work and supported and what is explicitly not expected to work [yet]), however there are some issues:
My page's script:
When running headless, this gets stuck waiting for the notification's
show
event. It eventually times out. The notification is never shown. The test fails.When running headed (or as I prefer, headful), the
show
event gets invoked but no actual notifications appears. Even when I tack on a timeout at the end of the test to give the notification time to appear, it never does. The test passes.The notification doesn't trigger the
dialog
event in any case so I cannot be asserted that way.Also
Notification.permission
always evaluates todenied
regardless ofawait page.context().grantPermissions(['notifications']);
.