【发布时间】:2019-12-10 12:16:07
【问题描述】:
我使用 testcafe 编写了一些测试。我认为它们的内容不值一提。
其中一些依赖于浏览器自动播放音频的能力。
当我使用 Chrome 运行测试时:testcafe "chrome --autoplay-policy=no-user-gesture-required" testfile.js
一切正常,页面上的音频开始自动播放。
但是,当我使用 Firefox 时:testcafe "firefox" test_widget.js
自动播放被禁用并且没有音频正在播放。如果我添加 --autoplay-policy=no-user-gesture-required 并没有真正改变。
检查来自firefox -h 的可用参数没有得到有价值的结果。
问题:
我应该怎么做才能在 Firefox 中允许自动播放,使用它作为浏览器通过 testcafe 运行测试?
可能的猜测:
- 命令中有一些标志
- 测试文件中的一些代码
软件版本:testcafe 1.7.0; Mozilla Firefox 71.0
提前致谢!
【问题讨论】:
标签: javascript firefox automated-tests testcafe autoplay