【问题标题】:TestCafe runner.video is not a function at createTestCafe.then.then.remoteConnectionTestCafe runner.video 不是 createTestCafe.then.then.remoteConnection 中的函数
【发布时间】:2019-04-11 14:36:56
【问题描述】:

已编辑

我在尝试使用 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】:

    您正在使用旧的 TestCafe 版本。 'Recording Video' 功能出现在早于0.22.0 的版本中。 最新的 TestCafe 版本 (1.1.2) 正是包含此功能。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-08-25
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多