chaijs范围检查
within(low,high)
。
指示每个数字的单个元素,例如
cy.get('.details > .justui_scroll-area li') // select all elements for numbers
.each(num => {
expect(+num).to.be.within(0, 0.4) // "+num" convert text to number
})
or
cy.get('.details > .justui_scroll-area li')
.each(num => {
cy.wrap(+num).should('be.within', 0, 0.4)
})