Skip to content
This repository was archived by the owner on Sep 11, 2025. It is now read-only.
This repository was archived by the owner on Sep 11, 2025. It is now read-only.

Unable to register new selector engines #60

@thernstig

Description

@thernstig
const {
  selectorEngine,
} = require('query-selector-shadow-dom/plugins/playwright');
const playwright = require('playwright');

describe('Test', () => {
  it('tests', async () => {
    await page.goto('http://google.com/');
    console.log(playwright.selectors);
    await playwright.selectors.register(selectorEngine, { name: 'shadow' });
    console.log(playwright.selectors);
    await page.waitForSelector('shadow=body');
  });
});

I am using https://github.com/Georgegriff/query-selector-shadow-dom, as per above, to register a new selector engine. However, when invoking the waitForSelector it returns Evaluation failed: Error: Unknown engine shadow while parsing selector shadow=body.

I think this might be due to that I import playwright in the suite, when jest-playwright itself already imported it somewhere else. So how would I register a selector engine with jest-playwright?

cc @Georgegriff in case he has some input

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions