playwright-vscode
playwright-vscode copied to clipboard
Running tests via extension does not recognize custom selector
In playwright.config.js, I've started working on a custom selector for ExtJS:
const { selectors } = require("@playwright/test");
selectors.register("extjs", function() {
return {
query(root, selector) {
if (window.Ext && Ext.ComponentQuery) {
let rs = Ext.ComponentQuery.query(selector)[0];
return (rs && rs.el && rs.el.dom) || null;
}
},
queryAll(root, selector) {
if (window.Ext && Ext.ComponentQuery) {
let rs = Ext.ComponentQuery.query(selector);
if (rs.length)
return rs.map(r => r.el && r.el.dom);
}
return [];
},
};
});
Example usage:
page.locator("extjs=viewport").waitFor();
Running from the command line works as expected, tests pass normally. However, trying to run from the vscode extension errors with the message:
Unknown engine "extjs" while parsing selector extjs=viewport ...