Search code examples
playwright

Where to register selectors in playwright?


You can register a custom selector in Playwright via a selector.register call. But it doesn't work if you put it in the global setup function. Where should I put it so it would work in every test?


Solution

  • The Playwright config file is a good place for it, since it gets loaded before every test and before globalSetup as well.