async getElementsByTagAndPartialId(
tag: string,
id: string
): Promise<BrowserElement[]> {
cy.get('body').find(tag).filter(`[id^=${id}]`).as('files');
const elementsList: CypressBrowserElement[] = [];
cy.get('@files').each($el => {
const currElem: CypressBrowserElement = new CypressBrowserElement();
currElem._selector = $el.prop('id');
elementsList.push(currElem);
});
cy.log(elementsList.length.toString());
cy.log(elementsList.length.toString())
returns 0
.
I need the getElementsByTagAndPartialId
method to return the elementsList
array.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…