无法从Cypress Integration文件夹路径运行cypress test.spec.js文件

无法从Cypress Integration文件夹路径运行cypress test.spec.js文件

我是cypress的新手,并使用Visual Studio Code作为Cypress的IDE。我已经编写了一个示例测试来启动一个如下所示的网页,并且该网页已经写在Cypress Integration文件夹下。

let appDelegate:AppDelegate = UIApplication.shared.delegate as! AppDelegate

如果尝试使用Visual Studio代码终端运行此脚本,则

/// <reference types="cypress"/> 
it('Page should navigate to todoMVC',() =>{
cy.visit('http://todomvc-app-for-testing.surge.sh/')
})

从Integration文件夹中。赛普拉斯窗口出现后,但新创建的xx.spec.js文件将不会显示,也不会出现错误。任何帮助将不胜感激。

sealguyue 回答:无法从Cypress Integration文件夹路径运行cypress test.spec.js文件

问题是您正在npx cypress open目录中运行cypress/integration。您应该从项目的根目录开始运行它-在您的情况下为C:\VSCode-win32-x64-1.40.0\Code-Work

,

转到项目的package.json文件,在脚本下写入"cypress":"cypress open",然后从终端-npm run cypress。 看这里-https://www.opencodez.com/software-testing/front-end-automation-testing-cypress.htm

本文链接:https://www.f2er.com/3119562.html

大家都在问