In my tests I fill the input fields (of Ant.Design https://ant.design/components/input/) with app.client.setValue( selector, value )
method. According to https://github.com/electron-userland/spectron it is supposed to be Selenium Webdriver's method. Ans it says here https://webdriver.io/docs/api/element/setValue.html the mehtod overrides the value in input. To me it always acts like addValue
(meaning it sends the keys on top of the current value in the input) and I cannot find a workaround.
Resetting the input on the client just before setValue
by some reason doesn't work...
async type( selector, value ) {
await this.app.client.execute( ( selector ) => {
const el = document.querySelector( selector );
// When it's INPUT_NUMBER reset is 0
el.setAttribute( "value", el.classList.contains( "ant-input-number-input" ) ? 0 : "" );
}, selector );
return await this.app.client.setValue( selector, value );
}