我正在使用 Visual Studio Code。我正在尝试从它的控制台运行
npx playwright test
但是这个错误是向我抛出的
error: unknown command 'test'. See 'npx playwright --help'.
我还使用 Playwright 扩展,它在您的代码中显示一个特殊的“播放”图标。这个“播放”图标可以工作,即代码运行,浏览器打开等。但是 npx playwright 测试命令由于某种原因不起作用。
我检查了目录,我在正确的目录中:seva on MacBook-Air-Vsevolod.local in ~/Playwright
我的包文件:
{
"name": "playwright",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"@playwright/test": "^1.27.1"
}
}
有什么想法可能出了问题吗?
npm init playwright@latest
这也对我有帮助。