Reputation: 103
Is there a better way to evaluate selectors? Currently, when TestCafe does not find a selector the error message is not helpful every time. Is there a way to evaluate/assess valid selectors or debug selectors. This will help expedite the test writing process
Upvotes: 2
Views: 550
Reputation: 5227
At present, the best way to debug TestCafe's Selectors includes two steps:
import { Selector } from 'testcafe';
fixture `Fixture`
.page('https://devexpress.github.io/testcafe/example/');
test('test', async t => {
const selector = Selector('fieldset').addCustomDOMProperties({
outerHTML: el => el.outerHTML
});
console.log(await selector.outerHTML);
});
Upvotes: 2