我试图在手机上测试网页,其点击视频上的播放按钮,但不播放视频。在桌面浏览器上运行正常。我已经尝试了以下命令 testcafe remote test/testCafe/was_test.js -e --autoplay-policy=no-user-gesture-required
下面是我的代码,用于点击播放按钮。
test('see if video plays', async t => {
await t.wait(10000) //this is to wait for the page to load
data = await getdata()
const playButton = await Selector('.plyr__control--overlaid')
await t.click(playButton)
})