我想将 cypress 消息转换为较小的字符串,例如:
柏木
转换为:
-assert expected #buy-price-field to have value 17,169.00
.
我该怎么做呢?
我看了文件,但我找不到能解决我问题的东西.
我想将 cypress 消息转换为较小的字符串,例如:
柏木
转换为:
-assert expected #buy-price-field to have value 17,169.00
.
我该怎么做呢?
我看了文件,但我找不到能解决我问题的东西.
使用回调表单而不是缩写表单cy.get('input').should('have.value', '17,169.00')
.
像这样的东西
cy.get('input')
.should($el => {
const price = "17,169.00";
const message = `expected #buy-price-field to have value ${price}`;
expect($el.val(), message).to.eq(price);
})