Angularjs 量角器:如何在元素内使用browser.sleep.all(定位器)。each(eachFunction)

Angularjs 量角器:如何在元素内使用browser.sleep.all(定位器)。each(eachFunction),angularjs,selenium-webdriver,protractor,Angularjs,Selenium Webdriver,Protractor,应为:要打印的元素[0]文本、睡眠、要打印的元素[1]文本、睡眠等 实际:打印每个元素的文本,然后在末尾执行browser.sleep一次 一旦我得到这个工作,我想实际点击每个链接,并断言相应的配置文件页面加载 我还应该提到,我有Seleniu_PROMISE_经理:错,我在用摩卡咖啡 describe.only('clicking each user in the list', () => { it('should display the correct prof

应为:要打印的元素[0]文本、睡眠、要打印的元素[1]文本、睡眠等

实际:打印每个元素的文本,然后在末尾执行browser.sleep一次

一旦我得到这个工作,我想实际点击每个链接,并断言相应的配置文件页面加载

我还应该提到,我有Seleniu_PROMISE_经理:错,我在用摩卡咖啡

    describe.only('clicking each user in the list', () => {
        it('should display the correct profile page', async () => {
            await element.all(by.repeater('user in currentNode.children')).each(async (elem)=> {
                console.log(await elem.getText())
                await browser.sleep(5000)
            });
        })
});

看来这就成功了

    describe.only('clicking each user in the list', () => {
        it('should display the correct profile page', async () => {
            const elements = await element.all(by.repeater('user in currentNode.children'));

            for (const element of elements) {
                const text = await element.getText()
                await browser.sleep(1000)
                console.log(text)
            }