UNPKG

grunt-html-dom-snapshot

Version:

Takes snapshots of the HTML markup on web pages - their immediate DOM content - and screenshots of their viewport - how they look like.

20 lines (16 loc) 554 B
'use strict' const { findElement, checkSingleElement } = require('./utils/elements') module.exports = { detect: function (command) { return !!command.clearValue }, perform: async function (grunt, target, client, command, options) { const clearValue = command.clearValue grunt.output.writeln('Clear value of "' + clearValue + '".') if (options.singleElementSelections) { await checkSingleElement(client, clearValue) } return findElement(client, clearValue) .then(element => client.elementClear(element)) } }