nightwatch
Version:
Easy to use Node.js based end-to-end testing solution for web applications using the W3C WebDriver API.
15 lines (10 loc) • 434 B
JavaScript
describe('Chrome DevTools Example', function() {
this.disabled = this.argv.env !== 'chrome';
it ('using CDP DOM Snapshot', async function(browser) {
await browser.navigateTo('https://nightwatchjs.org');
const dom = await browser.chrome.sendAndGetDevToolsCommand('DOMSnapshot.captureSnapshot', {
computedStyles: []
});
browser.assert.deepStrictEqual(Object.keys(dom), ['documents', 'strings']);
});
});