【问题标题】:I want to create my first test using testcafe but getting error as below我想使用 testcafe 创建我的第一个测试,但出现如下错误
【发布时间】:2019-04-04 08:17:56
【问题描述】:

我正在 Visual Studio 代码中使用 testcafe 编写我的第一个测试,但收到此错误“导入:术语 'import' 未被识别为 cmdlet、函数、脚本文件或可运行程序的名称。检查名称的拼写,或者如果包含路径,请验证路径是否正确,然后重试。

At line:1 char:1
+ import { Selector } from 'testcafe';
+ ~~~~~~
    + CategoryInfo          : ObjectNotFound: (import:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException"

【问题讨论】:

  • Bravo535,如果您可以在您的工作文件夹中附加文件package.json 中的“node:”、“testcafe:”和“npm:”版本会有所帮助吗?

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


【解决方案1】:

您的测试运行似乎不正确。您提供的错误是 Powershell 错误,与 TestCafe 无关。

命令应该是testcafe chrome test.js。

请分享您的测试代码并指定您开始测试的方式。

还请看以下文章:https://devexpress.github.io/testcafe/documentation/getting-started/

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-05-23
    • 2021-08-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多