量角器点击嵌套转发器和div内的链接

时间:2016-05-16 11:52:11

标签: angularjs-ng-repeat protractor

我正在尝试点击内部嵌套div中的“输入电子邮件”链接,并且tr和td也有相同的转发器。以下是示例标记:

<div class="table-responsive >
    <table id="vertical-view" class="main-table" ng-table="main-ng-table" >
        <tbody ng-repeat="tbody-ng-repeat" > 

            <tr ng-repeat="main-row-ng-repeat-data">
                <td ng-repeat="main-col-ng-repeat-data" > 
                    <span class="main-span-title">UserName</span>
                </td>
                <td ng-repeat="main-col-ng-repeat-data" > 
                    <div class="item-outer-wrapper>
                        <div class="item-inner-wrapper>
                            <a href="" id="deal" class="editable editable-click ng-binding">Enter UserName</a>
                        </div>
                    </div>
                </td>
            </tr>

            <tr ng-repeat="main-row-ng-repeat-data">
                <td ng-repeat="main-col-ng-repeat-data" > 
                    <span class="main-span-title">Email</span>
                </td>
                <td ng-repeat="main-col-ng-repeat-data" > 
                    <div class="item-outer-wrapper>
                        <div class="item-inner-wrapper>
                        <a href="" id="deal" class="editable editable-click ng-binding">Enter Email</a>
                        </div>
                    </div>
                </td>
            </tr>

            <tr ng-repeat="main-row-ng-repeat-data">
            </tr>

            <tr ng-repeat="main-row-ng-repeat-data">
            </tr>
        </tbody>

        <tbody ng-repeat="tbody-ng-repeat" > 

        </tbody>

        <tbody ng-repeat="tbody-ng-repeat" > 

        </tbody>

    </table>
</div>

我用来访问link元素并点击Enter Email的代码看起来像这样

var text = element(by.repeater('tbody-ng-repeat').row(0)).all(by.repeater('main-row-ng-repeat-data').row(1)).all(by.repeater('main-col-ng-repeat-data').row(1)).all(by.linkText('Enter Email'));

text.click();

不知怎的,它没有点击右侧链接。有没有办法在嵌套转发器中正确定位链接?

此外,我在点击链接时收到警告

Error: Timeout - Async callback was not invoked within timeout specified by jasmine.DEFAULT_TIMEOUT_INTERVAL.

0 个答案:

没有答案