有没有人能帮我解决这个Cypress错误? Cypress Error: Timed out retrying: expected '<div.sub-categories-list>' to be '0 visible'
This element '<div.sub-categories-list>' is not visible because it has CSS property: 'position: fixed' and its being covered by another elemen
我用柏树做了一些end-2-end。本地测试运行良好,但是当这些测试在CircleCI上运行时,它会显示来自cypress的错误 CypressError: Timed out retrying: You attempted to make a chai-jQuery assertion on an object that is neither a DOM object or a jQuery object.
The chai-jQuery assertion you used was:
> css
The invalid subject you asserted on wa
背景:
我正在为一个使用Cypress的React应用程序编写测试自动化。在应用程序中,我有一个对话框,其中有需要单击的元素。正常情况下,当我尝试单击这些元素时,Cypress会给出一个错误,即不可见的because its content is being clipped by one of its parent elements, which has a CSS property of overflow: 'hidden', 'scroll' or 'auto'中的元素。因为这些DOM元素是由一些第三方反应组件生成的,所以我不能改变这一点,而
在Cypress.io中,有没有一种方法可以在满足特定条件的情况下强制测试失败?
示例:
在我的网页上,如果字符串“对不起,出了点问题”。出现在页面上,我希望测试失败。目前,这是我正在做的事情。
/// <reference types="Cypress" />
describe("These tests are designed to fail if certain criteria are met.", () => {
beforeEach(() => {
cy.visit("");
});
s
我正在使用Cypress来测试web应用程序,并且我想在检查元素是否未退出后执行一些cypress命令。
我已经尝试过了,但Cypress会显示一条错误消息,指出该元素不存在,并且会停止测试。
// The user is not logged, so the "logout" button is not displayed
if (!cy.get("a").contains("Logout")) { // <--Cypress will stop here
// If "logout" bu
目标:我想使用带柏树的可访问性选择器单击页面上的特定元素
码
cy.findAllByRole('rowheader').eq(2).click();
误差
Timed out retrying: cy.click() failed because this element is detached from the DOM.
<th scope="row" data-automation-id="taskItem" aria-invalid="false" tabindex="-1" class="
当我尝试使用react-phone-number-input运行cypress测试时,出现了一个webpack错误,这个错误只出现在cypress中,我的react项目没有显示这个错误,并且运行良好,有没有一个解决方案可以在webpack或cypress中删除这个错误? Error: Webpack Compilation Error
./node_modules/react-phone-number-input/style.css 2:0
Module parse failed: Unexpected token (2:0)
You may need an appropriate load
我正在尝试截取POST请求,但收到以下错误: enter image description here 这是我的测试文件代码: enter image description here 我发现了一个类似的问题: cy.intercept is not a function Cypress test 这个问题通过升级cypress v5.3以上的版本得到了解决。但是我已经有了cypress版本6.14.15。该错误似乎只在.Then()部件上重复出现,这很奇怪,因为cy.intercept函数是在前一行代码中调用的,而不是在.Then()部件中调用的。问题到底出在哪里? 编辑:这是packag
我和我的同事在我们的机器上运行相同的Cypress测试套件,但得到了不同的结果。 我们使用的Cypress版本是3.8.3。 当他们运行.\node_modules\.bin\cypress run时,所有测试都通过了。 但是当我尝试在我的机器上运行相同的命令时,其中一个测试失败了。 我得到以下错误消息: <failure message="cy.type() can only be called on a single element.
Your subject contained 8 elements." type="CypressError"&g
在测试中,我想使用Mail::assertSent()对邮件进行一些断言,如下所示:
Mail::assertSent(MyMailable::class, function ($mail) use ($user) {
return $mail->hasTo($user->email);
});
到目前为止,我发现hasTo()、hasFrom()、hasBcc()和所有其他has*()方法工作得很好。但是,当在Mailable上断言特定属性时,例如,subject属性显示为null,断言失败:
Mail::assertSent(MyMailable::class, fun