.testcaferc.json应该放在哪里的混乱

时间:2019-05-22 16:35:01

标签: automated-tests e2e-testing web-testing testcafe

根据TestCafe文档(https://devexpress.github.io/testcafe/documentation/using-testcafe/configuration-file.html),. testcaferc.json文件应位于“运行TestCafe的目录中”。我想我不知道那到底是什么意思。

我已经创建了一个.testcaferc.json文件,并在其中放置了一些值,以查看在运行测试时是否可以成功读取该文件,但是到目前为止,无论我将它放在哪里,都无法识别它。 / p>

我已将其放置在node-modules / testcafe文件夹中。 我已将其放置在项目位置文件夹中。

(我不知道该怎么办)。

{
    "browsers": "chrome",
    "src": ["Desktop", "Mobile"],

    "reporter": { 
        "name": "testcafe-reporter-html",
        "output": "Artifacts/Reports/report.html"
    },

    "screenshotPath": "Artifacts/FailedTestsScreenshots",
    "takeScreenshotsOnFails": true,
    "videoPath": "Artifacts/FailedTestsVideos",

    "videoOptions": {
        "failedOnly":true
    },

    "videoEncodingOptions": {
        "r": 20,
        "aspect": "16:9"
    },

    "stopOnFirstFail": true,
    "skipJsErrors": true,
    "skipUncaughtErrors": true,
    "appCommand": "node server.js",
    "appInitDelay": 3000
}

一旦文件放置在正确的位置,我希望能够在命令行中键入“ testcafe”,它将运行我的项目。然后,它应该制作有关测试失败的屏幕截图和视频,跳过js错误等。这不是这么做的。

为了确保命令没有问题,我可以使用“ testcafe chrome Desktop”运行项目。

2 个答案:

答案 0 :(得分:3)

我的问题是本地没有最新版本的TestCafe。更新到最新版本后,我正在做饭!

答案 1 :(得分:0)

为了弄清楚任何人落在这里的问题,它放在项目的根文件夹中。