我正在使用cypress来测试我们的web应用程序。
在某些页面中,存在多次执行的不同端点请求。例如GET /A GET /B GET /A。
在cypress中最好的做法是等待所有请求完成,并保证页面已完全加载。
我不想使用大量的cy.wait()命令来等待所有请求被处理。(每个页面中有许多不同的请求集)
我已经安装了Cypress 5.0和所有的浏览器- Chrome,Edge和FF。当我跑的时候
> npx cypress open
无法在右上角看到所有浏览器。只有Electron在展示
我试过了
> npx cypress open --browser chrome
我得到以下错误
Can't run because you've entered an invalid browser name.
我使用cypress cy.task()方法/函数将csv文件从一个目录复制到另一个目录。下面是我的cy.task('copycsvFile')和用support/index.js文件编写的相关代码。在运行时,它会抛出以下错误;CypressError: cy.task('copycsvFile')因以下错误而失败:The 'task' event has not been registered in the plugins file. You must register it before using cy.task(),知道这是为什么没有识别
我目前有三个码头集装箱在运行:
前端web应用程序的Docker容器(在端口8080上公开)
后端服务器的Docker容器(在端口5000上公开)
我的MongoDB数据库的Docker容器。
这三个容器都工作得很好,当我访问时,我可以与我的web应用程序进行交互,没有任何问题。
我正在尝试设置第四个Cypress容器,它将为我的应用程序运行我的端到端测试。不幸的是,当这个Cypress容器尝试运行我的Cypress测试时,它会抛出以下错误:
cypress | Cypress could not verify that this server is running:
cy
当在commands.js中输入自定义命令时,WebStorm的linter表示,Cypress和cy都是未定义的,并且不提供任何IntelliSense。这两者在任何integration文件中都是完美定义的。
commands.js
Cypress.Commands.add('command', () => {
cy.get('div');
});
// ESLint: 'Cypress' is not defined.(no-undef)
// ESLint: 'cy' is not defined.(no-un
在Cucumber中导入一些依赖项时遇到问题。错误如下: Running: features\my_feature.feature... (1 of 1)
Browserslist: caniuse-lite is outdated. Please run next command `npm update`
Oops...we found an error preparing this test file:
cypress\integration\features\my_feature.feature
在我的Azure DevOps构建任务中,我运行了一个Cypress测试。如果测试失败,构建将被取消。但是我想在Cypress发布测试结果之后运行另一个任务。
我在我的pipeline.yml文件中尝试过这个任务:
- task: PowerShell@2
inputs:
targetType: "inline"
script: "yarn test:cypress"
errorActionPreference: "continue"
displayName: "start server and run c