我试图通过柏树、和运行一个非常简单的测试。我不想通过它们的启动程序运行测试,而是从节点运行,因为我将通过mocha框架启动测试。测试至少可以从电子开始,但是找不到我想点击的元素。它与铬通过发射器工作-与npx cypress run --browser chrome。尽管当我使用模块-api时,我得到了以下错误:
Can't run because you've entered an invalid browser name.
Browser: electron was not found on your system or is not supported by Cypre
我正在尝试使用Docker运行Cypress测试head(无人)。从我遵循的教程中,我得到了这个命令: docker run -it -v ~/tdd/services/cypress:/cypress -w /cypress --entrypoint=cypress cypress/included:4.9.0 run 这会抛出: Can't run because no spec files were found.
We searched for any files inside of this folder:
/cypress/cypress/integration 我将C
我们在Team City中运行Cypress测试,测试的输出非常冗长。当我直接在代理机器上运行测试时,我没有看到如此详细的日志记录,所以这可能是由于Team City的原因。
小样本(有数千个这样的例子):
cypress:https-proxy Making intercepted connection to 60378
cypress:server:server Got UPGRADE request from /__socket.io/?EIO=3&transport=websocket
cypress:server:timers queuing timer id 5 after
我在Cypress中使用custom commands,当我直接运行我的测试时,它工作得很好。问题是如何从cy.login()转到实现。CTRL + left click不执行任何操作。
我的command.js文件如下所示:
Cypress.Commands.add('login', (email,password) =>{
login.email().type(email);
login.password().type(password);
});
我的login.js文件如下所示:
When("I type in email and pass
我真的很想扩展这个话题,,因为我已经把头撞在墙上好几个星期了,我不能是唯一有这个问题的人。所有有关通过POST登录或使用CSRF登录的主题都不可避免地回到了上面的链接。
然而,在这个链接中描述的食谱似乎不适用于我。它们都假定,一旦您访问登录页面,就会创建CSRF令牌。但是在我们的站点上,CSRF令牌只创建一次登录。
我用Postman进行了测试,在您登录之前,HTML或头中没有CSRF令牌。
我还用以下代码在Cypress中测试了它:
describe('gimme dat csrf token', () => {
it('try to get the
当我尝试使用cypress open或cypress run时,会得到以下错误:
✖ Verifying Cypress can run /*/*/.cache/Cypress/3.1.5/Cypress
→ Cypress Version: 3.1.5
Cypress failed to start.
This is usually caused by a missing library or dependency.
The error below should indicate which dependency is missing.
https://on.cypress.
当测试用例失败时,我想记录额外的数据。在哪里可以最好地插入自定义错误处理程序?
例如:
cy.get('something')
.should('have.property', 'blah')
当这在Cypress仪表板中失败时,我得到:
CypressError: Timed out retrying: expected 'something' to have a property 'blah'
at Object.cypressErr (https://my.website.com/__cypress/
我遇到一个问题,在柏树中返回一个错误:You must set the CYPRESS_MAILOSAUR_API_KEY environment variable to use the Mailosaur plugin.
我尝试将MAILOSAUR_API_KEY放到cypress.json文件和cypress.env.json中。我认为CYPRESS_MAILOSAUR_API_KEY应该用于系统环境变量,在这种情况下需要吗?还是我在cypress.json和env.json中的变量没有被读取?(我的cypress.env.json文件与cypress.json文件一起位于根级文件夹中)