weixin_39605326
weixin_39605326
2020-11-22 12:17

Input clearText not working with puppeteer

🐛 Bug Report

🏗 Relevant Components

Input ...

😯 Current Behavior

clearText isn't working in Testkit from import { inputTestkitFactory } from 'wix-style-react/dist/testkit/puppeteer-testkit-bundle' text just stays as is. ...

🤔 Expected Behavior

clearing the text.

...

👀 Severity

Major. It can be done with 3 clicks to mark all text, and clicking Backspace. I'm worried it will be flaky...

该提问来源于开源项目:wix/wix-style-react

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

5条回答

  • weixin_39983350 weixin_39983350 5月前

    This is due to the fact that clearText uses enterText behind the scenes which doesnt clear the current value, just appends it.

    https://github.com/wix/wix-style-react/blob/c9dccb55973082db4eff5edb8de371de33f68a47/src/Input/Input.uni.driver.js#L120

    点赞 评论 复制链接分享
  • weixin_39604092 weixin_39604092 5月前

    This is due to the fact that clearText uses enterText behind the scenes which doesnt clear the current value, just appends it.

    https://github.com/wix/wix-style-react/blob/c9dccb55973082db4eff5edb8de371de33f68a47/src/Input/Input.uni.driver.js#L120

    This is not the case here If you look carefully you can see that this code is using ReactBase, which only works for jsdom platform and not puppeteer. https://github.com/wix/wix-style-react/blob/6a57af5bbae51406dacd700789d6e298ef7253f1/test/utils/unidriver/ReactBase.js#L11

    Anyways, i just issued a PR Yesterday that fixes it but it is also dependent on another PR in uniDriver that i wait for the guys to approve first https://github.com/wix/wix-style-react/pull/4184 https://github.com/wix-incubator/unidriver/pull/92

    点赞 评论 复制链接分享
  • weixin_39781550 weixin_39781550 5月前

    The issue is stale for a while now and the changes Moshe mentioned are merged. Let's reopen if it's still an issue.

    点赞 评论 复制链接分享
  • weixin_39794385 weixin_39794385 5月前

    Hey, Pretty sure that is still happening. I'm running v7.57.0 and getting the same issue.

    Interesting thing is that the text does not append. working with enterText directly, putting a new string overrides the existing one, but sending in an empty string does nothing.

    点赞 评论 复制链接分享
  • weixin_39676633 weixin_39676633 5月前

    Hey this is still happens on focus() function in v8.39.0

    点赞 评论 复制链接分享

相关推荐