Updated: Feb 17, 2020
When working with selenium, write in elements that are not fully loaded sometimes end up with the text cut.
Ensuring that elements end with the expected text with a retry method that checks the element final text value.
The code above ensures the input is clear before trying to type, and then retry the sendKeys method until the element has the expected text.
Also the same code for puppeteer