Cypress 与 Quasar 虚拟滚动表和粘性标头的不正确行为:无法通过 {scrollBehavior: false } 解决

发布于 2025-01-15 01:02:08 字数 773 浏览 4 评论 0原文

我正在使用 Quasar 2 创建一个带有粘性标题的虚拟滚动表。该表动态加载结果,初始加载结果的默认数量为 100。

表标题是粘性的,包含列名称以及某些列的搜索输入。赛普拉斯已成功测试这些标头输入上的用户输入和结果输出。

我的问题在于我想与某些表格单元格中包含的按钮进行交互。

该表本质上是一个包含多个小部件的容器,用户可以在其中进行交互以调整数据。这意味着对于其中一列,每个单元格都有基于该行中包含的信息的某些按钮。 Cypress 能够找到这些按钮,甚至可以在集合中的任何给定按钮索引上成功执行单击操作。示例:

cy.dataCy('edit-info-button').eq(3).click()

但是,我的问题是,cypress 会滚动它点击的任何按钮,在我的虚拟滚动表的粘性标题下方。 我必须指出,我已经全局禁用了 scrollBehavior(在 cypress.json 中),当这不起作用时,我还在我的函数中本地禁用了它。但是,我认为虚拟滚动表的行为不同,并且不能受此配置参数控制。

我在 Quasar Cypress 测试文档

I am using Quasar 2 to create a virtual-scroll table with a sticky header. The table loads results dynamically and the default number of initially loaded results is 100.

The table header is sticky and contains the column names, and a search input for some of the columns. Cypress has successfully tested user input and result output on these header inputs.

My problem comes in where I want to interact with buttons contained in certain table cells.

The table is essentially a container with several widgets where the user can interact to adjust data. This means that for one of the columns, each cell has certain buttons based on the information contained in that row. Cypress is able to find those buttons, and even succesfully executes a click action on any given button index in the set. Example:

cy.dataCy('edit-info-button').eq(3).click()

However, my problem is that cypress scrolls whatever button it clicks on, way up underneath the sticky header of my virtual-scroll table. I must point out that I have already disabled scrollBehavior globally (in cypress.json) and when that didn't work, I also disabled it locally in my function. However, I think that the virtual-scroll table behaves differently and cannot be governed by this config parameter.

I don't spot this under the caveats section of the Quasar Cypress testing documentation.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文