TestCafe setNativeDialogHandler 用于位置访问

TestCafe setNativeDialogHandler for Location access

我无法使用函数 setNativeDialogHandler 关闭 chrome 的 "Know Your Location" 对话框。我是这样称呼它的:

await t
  .typeText(this.rallyPostUpdateField, message, { paste: true, replace: true })
  .setNativeDialogHandler(() => true)
  .click(this.rallyPostUpdateSubmitButton);

用户在输入框中输入一些文本,然后在单击提交按钮时,会出现 "Know your location" 弹出窗口。我什至尝试在点击后调用 setNativeDialogHandler

await t
  .typeText(this.rallyPostUpdateField, message, { paste: true, replace: true })
  .click(this.rallyPostUpdateSubmitButton)
  .setNativeDialogHandler(() => true)

运气不好。我是不是做错了什么?

目前,TestCafe 不允许您立即处理 'Know your location' 对话框。
跟踪此 issue 以了解何时实施此功能。
同时,您可以考虑使用 https://github.com/DevExpress/testcafe/issues/1991#issuecomment-350284141.

中的解决方法