我想使用testcafe创建我的第一个测试但是得到如下错误

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

我正在使用visualcafe在visual studio代码中编写我的第一个测试但是得到这个错误“import:术语'import'不被识别为cmdlet,函数,脚本文件或可操作程序的名称。检查名称的拼写,或者如果包含路径,请验证路径是否正确,然后重试。

At line:1 char:1
+ import { Selector } from 'testcafe';
+ ~~~~~~
    + CategoryInfo          : ObjectNotFound: (import:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException"
powershell automated-tests e2e-testing web-testing testcafe
1个回答
3
投票

看起来你的测试运行不正确。您提供的错误是Powershell错误,它与TestCafe无关。

命令应该是testcafe chrome test.js

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

另请参阅以下文章:https://devexpress.github.io/testcafe/documentation/getting-started/

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