lundi 23 décembre 2019

Protractor - Which elements are "interactable"?

The element I am trying to interact with is using ng-sortable and holds a couple of divs that can be dragged and sorted.

await viewTransaction.getEl('div#dragdrop-boundary').sendKeys(protractor.Key.ARROW_DOWN);

Failed: element not interactable

The element is visible in this case. I am wondering if there are only certain elements such as dropdowns that can "interact" with sendKeys in this way?

Here is the Documentation that only specifies a WebElement.

My main question is "Are there only certain WebElements that can be interacted with in specific ways such as protractor.Key.ARROW_DOWN?

Here is part of the markup

Names of classes and vars have been changed to protect the innocent

<div ng-show="sortMode.sorting" id="dragdrop-boundary" class="sortMode-high">
    <div ng-if="Transaction &amp;&amp; Transaction.TransactionId" ng-repeat="Section in Sections" class="ng-scope">
        <div ng-hide="'PICKLIST' === Section.SectionId" class="lineItem-title ng-binding">Rental</div>
            <div data-ng-model="SortableLineItems[Section.SectionId]" data-as-sortable="sortableOptions" class="ng-pristine ng-untouched ng-valid ng-scope ng-not-empty">
                <div data-as-sortable-item="" data-ng-repeat="LineItem in SortableLineItems[Section.SectionId]" class="ng-scope as-sortable-item">
                    <div as-sortable-item-handle="" class="sortMode-existing-lineitems sortMode-row sortMode-outerRow sortMode-item-enable                                             sortMode-selected" ng-class="arbitrary:LineItem.TransactionType=='SALEFEE','kit-component':LineItem.IsKitComponent,'damage-waiver':LineItem.TransactionType=='DAMAGEWAIVER',discount:!LineItem.ItemId &amp;&amp; LineItem.ItemKey.includes('Discount')}">
                        <div class="sortMode-icon-container">
                            <button class="btn-default btn btn-xs action-btn-delete ng-scope" ng-if="LineItem.ItemId &amp;&amp; LineItem.LineItemId" disabled="">
                                <span class="roro-icon roro-icon-cancel"></span>
                            </button>
                        </div>
                        <div class="sortMode-cell sortMode-item-name ng-binding">Wagon</div>
                        <div class="sortMode-cell sortMode-item-key ng-binding ng-scope" ng-if="LineItem.HasItemKey">ITEM-3</div>
                        <div class="sortMode-cell sortMode-amount-per-item ng-binding">$30.00</div>
                        <div class="sortMode-cell sortMode-quantity ng-binding">1</div>
                        <div class="sortMode-cell sortMode-amount-text ng-binding">$30.00</div>
                        <div class="sortMode-cell sortMode-tax-free-text ng-binding">T</div>
                        <div class="clearfix line-item-instances ng-scope" ng-if="LineItem.ItemSerialized &amp;&amp; !RemovingItem[LineItem.LineItemId]">
                        <div ng-class="{'padding-none' : !subItemPopup[$index].active}" class="padding-none">
                            <div class="line-item-cards">
                                <div class="line-item-card tbd-card ng-scope" ng-if="LineItem.CountUnassigned"><div>
                                                        <span translate="TBD" class="ng-scope">TBD</span> x <span class="ng-binding">1</span>
                                                    </div>
                                                </div>

                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div ng-if="Transaction &amp;&amp; Transaction.TransactionId" ng-repeat="Section in Sections" class="ng-scope">
                        <div ng-hide="'PICKLIST' === Section.SectionId" class="lineItem-title ng-binding">Damage Waiver</div>
                            <div data-ng-model="SortableLineItems[Section.SectionId]" data-as-sortable="sortableOptions" class="ng-pristine ng-untouched ng-valid ng-scope ng-not-empty">
                                <div data-as-sortable-item="" data-ng-repeat="LineItem in SortableLineItems[Section.SectionId]" class="ng-scope as-sortable-item">
                                    <div as-sortable-item-handle="" class="sortMode-existing-lineitems sortMode-row sortMode-outerRow
                                        sortMode-item-enable
                                        sortMode-unselected" ng-class="{arbitrary:LineItem.TransactionType=='SALEFEE','kit-component':LineItem.IsKitComponent,'damage-waiver':LineItem.TransactionType=='DAMAGEWAIVER',discount:!LineItem.ItemId &amp;&amp; LineItem.ItemKey.includes('Discount')}">

                                        <div class="sortMode-icon-container">

                                            <button class="btn-default btn btn-xs action-btn-edit ng-scope" ng-if="LineItem.TransactionType == 'DAMAGEWAIVER'" disabled="">
                                                <span class="roro-icon roro-icon-edit"></span>
                                            </button>

                                        </div>
                                        <div class="sortMode-cell sortMode-item-name ng-binding">Damage Waiver (10%)</div>
                                       <div class="sortMode-cell sortMode-item-key ng-binding ng-scope" ng-if="LineItem.HasItemKey">N/A<div>

                                       <div class="sortMode-cell sortMode-amount-per-item ng-binding">$3.00</div>
                                           <div class="sortMode-cell sortMode-quantity ng-binding">1</div>
                                               <div class="sortMode-cell sortMode-amount-text ng-binding">$3.00</div>
                                                   <div class="sortMode-cell sortMode-tax-free-text ng-binding">T</div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>

Aucun commentaire:

Enregistrer un commentaire