柏树中的停止循环

时间:2019-11-13 12:24:53

标签: cypress

请帮助我,我是新手,并且在遇到错误时遇到代码相同的问题

CypressError: cy.then() failed because you are mixing up async and sync code.

我的代码看起来像这样...

cy.xpath(LOGOS).then(($ele) => {
        cy.eachSeries($ele.get(), (index) => {
              return cy.xpath(LOGOS).eq(index)enter code here
                .invoke('text')
                .then((text) => {
                  if (text === 'Market') {
                    cy.xpath(LOGOS).eq(index).click();
                    cy.xpath(MKT).invoke('text').then(val=> {if (val>0)
                    return false;
                    }
                  }
                });
            });
        }

0 个答案:

没有答案
相关问题