简体   繁体   English

TestCafe问题,onChange事件未在模态对话框中触发输入框

[英]TestCafe issue, onChange event not triggred for input box in a modal dialog box

I am trying to update a number on the screen. 我正在尝试更新屏幕上的数字。 I click on the update menu that lets me update a number. 我点击更新菜单,让我更新一个数字。 When I click on the update button it will open a modal dialog box with an empty text box for the new number and a save button. 当我点击更新按钮时,它将打开一个模态对话框,其中包含新数字的空文本框和保存按钮。 The save button is initially disabled. 保存按钮最初被禁用。 If the user manually types in a number in the text box, the onChange event will trigger and the save button is enabled. 如果用户在文本框中手动输入数字,则会触发onChange事件并启用保存按钮。 However, if I let the testcafe script to put a number in the number text box, the save button remains disabled. 但是,如果我让testcafe脚本在数字文本框中输入数字,则保存按钮将保持禁用状态。 My guess is that when I use the testcafe .typeText(inputbox,'123') it does not fire the onChange event on the text box. 我的猜测是,当我使用testcafe .typeText(inputbox,'123')它不会在文本框中触发onChange事件。 Any help on this is greatly appreciated. 非常感谢任何帮助。


[1]

Have you tried to put "alert" or "print" to see if onChange method is triggered? 您是否尝试过“警告”或“打印”以查看是否触发了onChange方法? Furthermore, can you post your code? 此外,你可以发布你的代码吗?

TestCafe have fixed the problem with the onChange event for react-dom since the 15.6.0 version. 自15.6.0版本以来,TestCafe已经修复 react-dom on的onChange事件的问题 Please try to use TestCafe 0.16.2. 请尝试使用TestCafe 0.16.2。 If the problem persists, please provide your page's URL. 如果问题仍然存在,请提供您网页的网址。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM