Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[Bug]: Protocol error (Browser.grantPermissions): Unknown permission type: accessibilityEvents #33678

Closed
dgsayer1 opened this issue Nov 19, 2024 · 2 comments

Comments

@dgsayer1
Copy link

dgsayer1 commented Nov 19, 2024

Version

1.49.0

Steps to reproduce

  1. Upgraded playwright to version 1.49.0 from 1.48.2
  2. Ran our set of tests (playwright test --workers=1 --project=smoke)

All tests failed with the error Error: browser.newContext: Protocol error (Browser.grantPermissions): Unknown permission type: accessibilityEvents

  1. Disabled the following by commenting out the code:
   /* contextOptions: {
      permissions: ['clipboard-read', 'clipboard-write', 'accessibility-events'],
    }, */
  1. Re-ran the tests

All tests passed

  1. Downgraded playwright version to 1.48.2
  2. Rerun tests

All tests passed

I've attached out playwright.config.ts code in the Additional Context section. Unfortunately I am unable to provide further test code.

Additionally, I've checked the Playwright readme document for granting permissions and it looks like the playwright.config.ts is correctly setup.

Expected behavior

All tests should run.

Actual behavior

All tests failed

Additional context

import { devices } from '@playwright/test';
import type { PlaywrightTestConfig } from '@playwright/test';
import '@support/custom-assertions';

const config: PlaywrightTestConfig = {
  testDir: './tests/ui',
  timeout: 60 * 1_000, 
  expect: { timeout: 10 * 1_000 }, 
  maxFailures: process.env.CI ? 20 : undefined, 
  fullyParallel: false, 
  forbidOnly: !!process.env.CI, 
  globalSetup: require.resolve('./global-setup'),
  retries: process.env.CI ? 2 : 0, 
  workers: process.env.CI ? 6 : undefined,
  reporter: process.env.CI ? [
    ['github'],
    ['playwright-tesults-reporter', {
      'tesults-target': process.env.TESULTS_TOKEN,
      'tesults-build-name': process.env.TESULTS_BUILD_NAME,
    }],
  ] : 'html',

  use: {
    locale: 'en-GB',
    actionTimeout: 0,
    trace: 'on-first-retry', 
    ignoreHTTPSErrors: true,
    screenshot: process.env.CI ? 'only-on-failure' : 'off',
    contextOptions: {
      permissions: ['clipboard-read', 'clipboard-write', 'accessibility-events'],
    },
  },
  projects: [
    {
      name: 'smoke',
      testDir: './tests/smoke-tests',
      timeout: 30 * 60 * 1_000,
      use: {
        ...devices['Desktop Chrome'],
        channel: 'chromium',
        baseURL: process.env.appBaseUrl,
        viewport: { width: 1280, height: 720 },
        trace: 'on-first-retry',
        video: 'retain-on-failure',
        screenshot: 'only-on-failure',
      },
      retries: 0,
    },
  ],
};

export default config;

Environment

System:
    OS: Windows 11 10.0.26100
    CPU: (20) x64 12th Gen Intel(R) Core(TM) i7-12700H
    Memory: 7.39 GB / 31.68 GB
  Binaries:
    Node: 20.1.0 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.19 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
    npm: 9.6.4 - C:\Program Files\nodejs\npm.CMD
    pnpm: 8.15.6 - ~\AppData\Local\pnpm\pnpm.EXE
  IDEs:
    VSCode: 1.95.3 - C:\Users\DGS\AppData\Local\Programs\Microsoft VS Code\bin\code.CMD
  npmPackages:
    @playwright/test: ^1.49.0 => 1.49.0 
    playwright: ^1.49.0 => 1.49.0 
    playwright-lighthouse: ^2.2.2 => 2.2.2 
    playwright-tesults-reporter: ^1.1.0 => 1.1.0
@dgozman
Copy link
Contributor

dgozman commented Nov 20, 2024

@dgsayer1 Thank you for the issue! Indeed, this permission has been removed from Chromium by this change.

Overall, permissions are not stable and change between browsers and versions. I've updated the docs to mention this in #33690. Let me know what you think.

@dgsayer1
Copy link
Author

Perfect @dgozman, thank you for investigating and resolving so quickly.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants