Playwright: [Feature] Permission (Notification, Geolocation, etc.) Event

Created on 5 Aug 2020  路  1Comment  路  Source: microsoft/playwright

I'd like to test that a site requests for user's geolocation and notification permissions at the appropriate time. Can you please add an API that could be used like the following:

context.on('permissions', async (permission) => {
    const name == permission.name();
    if (name === 'geolocation') {
        await permission.allow();
    } else if (name === 'notification'){
         await permission.deny();      
    }
    // ignore others
})
P3-collecting-feedback

Most helpful comment

Setting expectations: great request, I wanted the same thing, but requires substantial amount of work in all browsers.

>All comments

Setting expectations: great request, I wanted the same thing, but requires substantial amount of work in all browsers.

Was this page helpful?
0 / 5 - 0 ratings