我是新来的柏树公司,我有个问题。
我的应用程序,我有一个“保存按钮”。单击该按钮时,将触发JS window.prompt()。在提示符中,您可以写出保存的名称(比如“从John中保存”),然后单击"OK“--在提示符中。
我需要通过E2E测试在Cypress.io中报道这个用户故事。
问题是,当我单击"Save按钮“时,当显示提示时,单击Click()事件中的柏树冻结。
it('Make a new save with JS prompt', () => {
cy.get('#save-changes-button')
.sh
我使用柏树进行测试自动化,当从终端运行测试规范时,结果输出中会出现奇怪的字符:
cypress规范运行在Git for Windows bash -
如果我从Windows命令提示符运行柏树,输出字符是正确的:
在Windows命令提示符下运行cypress规范-
我使用Windows 7、cypress 5.1.0和Git for Windows 2.28.0和mintty 3.2.0
对如何纠正这个问题有什么想法吗?
我正在使用Cypress和Cypress Testing Library来测试我的React应用程序。 我有一个以名字('Steve')作为值的输入,我正在尝试使用cypress查找它,如下所示: // In the component:
<input defaultValue="steve" />
// In the spec file:
cy.getByText(/steve/i).should('exist'); 但是Cypress找不到这个元素,测试失败。如果我将输入更改为div: <div>Steve<
问题
我正在为Cypress运行一个集成测试,它在本地工作良好,但在Gitlab中运行时却失败了。我正在接收的错误是在使用cy.visit()命令时收到的,该命令导致以下错误:
CypressError: `cy.visit()` failed trying to load:
http://localhost:3000/ The response we received from your web server
was:
404: Not Found
配置
我使用以下命令启动测试:
tests:
image: cypress/base:10
stage: tests
scrip
当我试图在Windows 10计算机上安装带有Zscaler连接器的Cypress时,我会得到以下错误:
911 error
911 error Platform: win32-x64 (10.0.19044)
911 error Cypress Version: 10.7.0
912 error [FAILED] The Cypress App could not be downloaded.
912 error [FAILED]
912 error [FAILED] Does your workplace require a proxy to be used to access the
当在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
我在本地运行我的柏树,它们总是通过的,但是当我在jenkins运行它们时,我总是会收到这样的错误:
> Blocked a frame with origin "http://localhost:3000" from accessing a cross-origin frame.
Before the page load, you were bound to the origin policy:
> http://localhost:3000
A cross origin error happens when your application navig
当我尝试在Cypress中运行测试时,我得到了这个错误。有人能帮我解决这个问题吗? 这是我的index.js // Import commands.js using ES2015 syntax:
import './commands'
// Alternatively you can use CommonJS syntax:
// require('./commands')
Cypress.on('uncaught:exception', (err, runnable) => {
// returning false here p
假设我得到了以下带有两个输入元素的表单。
Title:
<input type="text" ng-model="detail.message.title">
Description:
<input type="text" ng-model="detail.message.description">
要让Cypress.io填写文本输入,我应该使用如下代码
cy.get('<selector>').type('Here the data for the title'