【发布时间】:2020-10-09 14:51:22
【问题描述】:
我需要访问 getLength 函数的值。它返回未定义的值。如何访问此处的值?
我的代码是:
const verifyValue = () => {
const selector = 'nz-option-container nz-option-item';
const myActualLength = getLength(selector);
console.log('I need to access this value :' + myActualLength);
}
const getLength = (selector: string) => {
let length;
cy.get(selector).then((listItem) => {
length = listItem.length;
})
return length;
}
【问题讨论】:
标签: typescript cypress