赛普拉斯,一体化测试框架和断言库,包括自动等待,请求模拟和请求存根
我正在拦截请求URL:https://api-stg.geneplanet.com/api/nipt-exporters/tasks/407ff05afdec42caa17a660d2c855117/status 请求的 URL 的响应是 { “姓名”:“
我按照这篇文章进行操作,并达到了我的赛普拉斯日志如文章最后一张图片所示的状态。 所提出的方法基于记录函数名称。 不过我还有2个
无法从 Material-UI 选择组件中选择选项 - 4000 毫秒后重试超时 [已关闭]
我在使用 Cypress 为 React 组件编写集成测试时遇到问题。具体来说,我在从
Cypress 中是否有相当于“containsExact”函数的函数?
我有一个 Cypress E2E 测试套件,我想在其中通过表格单元格中显示的文本搜索表格中的行。 我在以下方面取得了一些成功: cy.get('.p-datatable-tbody').should(...
我正在尝试使用 Cypress 为 React 组件编写集成测试。我可以登录并打开一个表单对话框。但是我无法选择一个选项,如下所示。总的来说,我已经运行了这个
Cypress -(未捕获的异常)NotSupportedError:用户代理不支持公钥凭据
通常我们可以使用自签名证书从指向不同服务器的本地主机登录。 但在 cypress 端到端测试期间,这失败了 (未捕获的异常)
我在 Cypress.io 中遇到一个问题,当我加载本地 URL 时,每次都会出错。我什至在 cypress.json 文件中添加了 { "baseUrl": "http://localhost:4200" } 作为注释...
在Cypress中,我想根据其文本内容从一组按钮中选择一个按钮。我该怎么做?这是我的方法: 导出 const getCustomerButton = () => getNavigationSidenav() .f...
使用 Cypress,如何测试尝试关闭选项卡会导致显示确认框?
我想测试关闭选项卡(或重新加载选项卡)是否会显示确认框。如果用户单击“取消”,确认框应该消失并且页面不会重新加载...
是否可以在 Cypress (VSCode) 中从功能文件导航到步骤定义,反之亦然
我正在使用cypress cucumber测试框架和IDE VSCode 我找不到从功能到步骤定义导航的方法,反之亦然。我已经安装了 Cucumber (Gherkin) Full Support 扩展...
我目前正在研究柏树,当我阅读教程时,我的脑海中突然出现了一件事。如果我编写一个小测试用例,例如,打开一个网站,单击登录并输入
如何将 cypress 与 React 图像映射器一起使用?
当我尝试使用 Cypress 自动单击图像时,出现错误。 我正在使用图像映射器来记录我的点击。这是代码: ``\ 当我尝试使用 Cypress 自动单击图像时,出现错误。 我正在使用图像映射器来记录我的点击。这是代码: `\<ImageMapper src={RighthandBatsmanPitchDefault} width={300} onLoad={() =\> load()} onMouseDown={(area) =\> clicked(area)} onMouseEnter={(area) =\> enterArea(area)} onMouseLeave={(area) =\> leaveArea(area)} onMouseMove={(area, \_, evt) =\> moveOnArea(area, evt)} onImageClick={(evt) =\> clicked(evt)} onImageMouseMove={(evt) =\> moveOnImage(evt)} /\> const enterArea = (area) =\> { setHoveredArea(area); }; const leaveArea = (area) =\> { setHoveredArea(null); }; const moveOnArea = (area, evt) =\> { const coords = { x: evt.nativeEvent.layerX, y: evt.nativeEvent.layerY }; setCords(coords); }; const clicked = (area) =\> { props.parentWagonMsgData.parent = false; if ((props.positionBatTypeBatInput.waghoon_wheel_position_bat_type == "Right")) { if ((isInsideRectangle(Right_Hand_New_ShortFineLegFirst, cords) || isInsideRectangle(Right_Hand_New_ShortFineLegSecond, cords)) && (props.positionBatTypeBatInput.waghoon_wheel_position_bat_type == "Right")) { setMsgClick(`Short Fine Leg`); setRighthandBatsmanPitchDefault(RightHandBatsmanShortFineLeg); } else if ((isInsideRectangle(Right_Hand_New_DeepFineLegFirst, cords) || isInsideRectangle(Right_Hand_New_DeepFineLegSecond, cords)) && (props.positionBatTypeBatInput.waghoon_wheel_position_bat_type == "Right")) { setMsgClick(`Deep Fine Leg`); setRighthandBatsmanPitchDefault(RighthandBatsmanDeepFine); } else if ((isInsideRectangle(Right_Hand_New_SquareLegFirst, cords) || isInsideRectangle(Right_Hand_New_SquareLegSecond, cords)) && (props.positionBatTypeBatInput.waghoon_wheel_position_bat_type == "Right")) { setMsgClick(`Square Leg`); setRighthandBatsmanPitchDefault(RightHandBatsmanSqaureLeg);` 等等... isInsideRectangle 的定义是: export function isInsideRectangle({ x1, y1, x2, y2, x3, y3, x4, y4 }, { x, y }) { let A = area(x1, y1, x2, y2, x3, y3) + area(x1, y1, x4, y4, x3, y3); let A1 = area(x, y, x1, y1, x2, y2); let A2 = area(x, y, x2, y2, x3, y3); let A3 = area(x, y, x3, y3, x4, y4); let A4 = area(x, y, x1, y1, x4, y4); return A == A1 + A2 + A3 + A4; } 我在 Cypress 上尝试了多种方法,包括最简单的: cy.get(element).click() 我总是收到与此类似的错误: Error: TypeError: Cannot read properties of undefined (reading 'x') 这是因为 x 未定义,因为与物理鼠标移动不同,cypress 直接单击某个位置。 我也尝试过以某种间接的方式 - cy.get(this.wagon_wheel_locator) .trigger("mouseenter", 120, 100) .trigger("mousemove", 110, 100) .trigger("mouseover", 110, 100) .trigger("mousedown", 110, 100) .wait(100) .trigger("mouseup", 110, 100) .trigger("mousemove", 130, 100) .trigger("mouseleave", 130, 100); 此代码不会给出错误,但也不会单击。 如何通过 Cypress 单击图像而不出现错误? 通常使用插件 cypress-real-events 结果会更好,尤其是在存在需要坐标的图形元素的情况下。 cy.get(wagon_wheel_locator) .realHover() // for hovering .realClick() // for clicking 我也同意 Akiva,错误说 无法读取未定义的属性(读取“x”) 但是代码显示您没有设置 cords,这解释了为什么它是未定义的 - 它符合错误消息并且您有 const coords = ...。 因此,可能只是变量名称的拼写错误导致了您的问题。
如何在javascript中访问函数外部的then((title))值
我正在编写 cypress javascript 代码,并尝试从标题中访问标题属性值并将值存储到标题中。 当我打印 cy.log("标题属性: ", title);有用。但我想要...
我正在寻找一个标签选择器,即基于 id="dropdown- Sex-health" 的 href="/chlamydia-treatment"。 所以基本上是想为我父母的兄弟姐妹的孩子找到一个选择器......
我正在尝试在 cypress 测试中检查 API 调用是否只进行一次。 然后我尝试继续进行更改,并且我想验证这些调用实际上并未进行。 它(“更新统计数据...
我希望 Gmail api 使用 postman api 读取和写入电子邮件。无需浏览器和 UI 交互
我在使用 gmail api 进行 cypress 测试用例来使用 api 读取和写入电子邮件时遇到问题。但是通过阅读不同的博客和观看视频尝试了很多,但没有任何帮助我打赌......
如何在 cy.intercept() 之前强制 cy.writeFile()
我想在每次运行测试之前将固定装置中的时间更新为当前时间,并在 cy.intercept() 中将更新的时间作为响应提供给固定装置文件。但每次 cy.int...
当我在本地浏览器(cypress open)中进行测试时,我在窗口 - cypress(chrome)、webstoms 之间切换,并且我的测试自动启动。如何关闭自动运行,只使用 CMD + R...
在 Cypress 中,我可以使用拦截命令拦截 HTTP 调用并返回任意 HttpResponse: cy.intercept("POST", '一些/url', { 状态代码:200, // ETC。 }); 可以吗...
我在尝试将登录过程自动化到页面对象时遇到以下错误。 this.signIn 不是一个函数 这是我的页面对象: 导出类 OktaLoginPage { oktaServer = 塞浦路斯...