wix-incubator / unidriver

UniDriver - Universal Component Drivers 🚀
MIT License
53 stars 15 forks source link

Enter value e2e vs unit #111

Closed gendeld closed 4 years ago

gendeld commented 4 years ago

It seems that the enterValue method will have different effects in unit tests than in e2e tests.

Given input value of Hello after doing enterValue("World!") unit tests will produce input value of "World!" while e2e test will produce "Hello World!"

In jsdom-react we receive value and use Simulate.change to replace the input’s value to value

In puppeteer we use type and in protractor/selenium we use sendKeys , all of which will append value to the current input’s value

GabiGrin commented 4 years ago

hey @gendeld interesting catch I think that the best thing to do here is reset pupetter and not append to JSdom I guess enterValue is ambiguous on this behaviour and maybe setValue is better here