赛普拉斯在没有任何桌子的情况下排成一排的长度

发布于 2025-02-06 13:43:24 字数 163 浏览 2 评论 0原文

我从图片和网站上有以下代码,我如何断言该行有4个长度? 我在titter中说的不是桌子的身体:(

谢谢!!!

   https://i.sstatic.net/vqbfA.png
   https://i.sstatic.net/vLL74.jpg

I have the following code from the picture and the website, how can I make an assertion that the row has a 4 length?
And how i say in the tittle , it is not a table body :(

Thank you!!!

   https://i.sstatic.net/vqbfA.png
   https://i.sstatic.net/vLL74.jpg

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

剪不断理还乱 2025-02-13 13:43:24

由于它是一个列表,因此您将一口气获得所有li元素的长度。我能做的最好的事情是,获取所有列表元素,然后断言总长度%4 == 0。这将意味着不管有多少行都将有4个元素。类似

cy.get('li[id*="screenshot"]')
  .its('length')
  .then((len) => {
    cy.wrap(len % 4).should('eq', 0)
  })

Since it's a list, you will get the length of all li elements in one go. The best I could think of, that you can do is, get all the list elements and then make assert that that the total length %4 == 0. Which will mean no matter how many rows are there all the rows will have 4 elements. Something like

cy.get('li[id*="screenshot"]')
  .its('length')
  .then((len) => {
    cy.wrap(len % 4).should('eq', 0)
  })
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文