2

Html ビデオが現在再生されているかどうかをテストしようとしていますが、currentTime. 私は次のようなことを試してきました:

async videoIsPlaying(indexOfVideo = 0) {
    return ClientFunction(() => {
        const video = document.getElementsByTagName('video')[indexOfVideo];
        return video.currentTime > 0;
    });
}

しかし、私の期待:

await t.expect(await playerPage.videoIsPlaying()).eql(true);

戻ります:

AssertionError: expected [Function: __$$clientFunction$$] to deeply equal true

私は何を間違っていますか?また、どの結果に対しても true を返す.eql()ので、使用しています。.ok()

4

1 に答える 1