TestCafe runner.video不是createTestCafe.then.then.remoteConnection的函数

问题描述 投票:2回答:1

EDITED

我在尝试使用TestCase Javascript API创建测试视频时遇到此问题。

我正在使用testcafe版本0.22.0,我已经在他们的文档中具有请求的先决条件。

基本上,问题是我的跑步者对象中不存在视频功能。

https://devexpress.github.io/testcafe/documentation/using-testcafe/common-concepts/screenshots-and-videos.html#record-videos

createTestCafe('localhost', 1337, 1338)
    .then(testcafe => {
        runner = testcafe.createRunner();
        return testcafe.createBrowserConnection();
    })
    .then(remoteConnection => {
        // Outputs remoteConnection.url so that it can be visited from the remote browser.
            runner
                .video(artifactsPath, true)
                .src(specsPath + '/run-animation.spec.ts')
                .browsers(['chrome'])
                .reporter('json')
                .run()
                .then(failedCount => {
                    console.log('Error: ', failedCount);
                })
                .catch(error => {
                    console.log('Error: ', error);
                });
    });
javascript automated-tests e2e-testing video-recording testcafe
1个回答
4
投票

您正在使用旧的TestCafe版本。 “录制视频”功能出现在比0.22.0更早的版本中。最新的TestCafe版本(1.1.2)完全包含此功能。

© www.soinside.com 2019 - 2024. All rights reserved.