我正在尝试使用 Protractor 和 Cucumber 对 Angular 项目进行 E2E 测试。我安装了量角器 v5.4.4。我第一次运行ng e2e
测试运行成功,第二次出现此错误:
EPERM: operation not permitted, rename 'C:\Users\dmdum\Projects\angular-project\node_modules\protractor\node_modules\webdriver-manager\selenium\chromedriver.exe' -> 'C:\Users\dmdum\Projects\angular-project\node_modules\protractor\node_modules\webdriver-manager\selenium\chromedriver_96.0.4664.45.exe'
Error: EPERM: operation not permitted, rename 'C:\Users\dmdum\Projects\angular-project\node_modules\protractor\node_modules\webdriver-manager\selenium\chromedriver.exe' -> 'C:\Users\dmdum\Projects\angular-project\node_modules\protractor\node_modules\webdriver-manager\selenium\chromedriver_96.0.4664.45.exe'
at Object.renameSync (fs.js:741:3)
at unzip (C:\Users\dmdum\Projects\angular-project\node_modules\protractor\node_modules\webdriver-manager\built\lib\cmds\update.js:240:8)
at C:\Users\dmdum\Projects\angular-project\node_modules\protractor\node_modules\webdriver-manager\built\lib\cmds\update.js:205:13
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at async Promise.all (index 0)
chromedriver_96.0.4664.45.exe
已存在于指定路径
为了让我再次成功运行测试,我需要删除selenium
路径中指定的文件夹,然后npx webdriver-manager update
再次运行,然后ng e2e
但这不是处理问题的好方法。任何帮助/建议将不胜感激。谢谢!