@luminati-io/webdriverio8
Version:
Next-gen browser and mobile automation test framework for Node.js
30 lines (28 loc) • 1.19 kB
JavaScript
/**
*
* Clear the value of an input or textarea element. Make sure you can interact with the
* element before using this command. You can't clear an input element that is disabled or in
* readonly mode.
*
* <example>
:clearValue.js
it('should demonstrate the clearValue command', async () => {
const elem = await $('.input')
await elem.setValue('test123')
const value = await elem.getValue()
console.log(value) // returns 'test123'
await elem.clearValue()
value = await elem.getValue()
assert(value === ''); // true
})
* </example>
*
* @alias element.clearValue
* @uses protocol/elements, protocol/elementIdClear
* @type action
*
*/
export function clearValue() {
return this.elementClear(this.elementId);
}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2xlYXJWYWx1ZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9jb21tYW5kcy9lbGVtZW50L2NsZWFyVmFsdWUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7R0F5Qkc7QUFDSCxNQUFNLFVBQVUsVUFBVTtJQUN0QixPQUFPLElBQUksQ0FBQyxZQUFZLENBQUMsSUFBSSxDQUFDLFNBQVMsQ0FBQyxDQUFBO0FBQzVDLENBQUMifQ==