title: How to expand the tree view in protractor tests. Below is the code snippet
body: <p>Below is the code snippet. The code represents one item and I have multiple of these. All these are distinguished by <strong>ng-reflect-index</strong>. I want to write a test case by expanding these nodes one by one but could not expand the node by using protractor. I am able to go till <strong>ng-reflect-index</strong> by using css function (<strong>element(by.css('[ng-reflect-index="1"]'))</strong>). Now i would like to click on the span class <code>&lt;span class="toggle-children-wrapper ng-star-inserted toggle-children-wrapper-collapsed"&gt;</code> would be really thankful if anyone can help me in fixing this. </p>
  
  <pre><code>&lt;tree-node ng-reflect-node="[object Object]" ng-reflect-index="0" ng-reflect-templates="[object Object]" class="ng-star-inserted"&gt;
      &lt;!--bindings={
    "ng-reflect-mobx-autorun": null
  }--&gt;&lt;!----&gt;
        &lt;!--bindings={
    "ng-reflect-ng-if": "true"
  }--&gt;&lt;div class="tree-node-level-1 tree-node ng-star-inserted tree-node-active tree-node-focused tree-node-collapsed"&gt;
  
          &lt;!--bindings={
    "ng-reflect-ng-if": "true"
  }--&gt;&lt;tree-node-drop-slot ng-reflect-node="[object Object]" ng-reflect-drop-index="0" class="ng-star-inserted"&gt;
      &lt;div class="node-drop-slot" ng-reflect-tree-allow-drop="function () { [native code] }"&gt;
      &lt;/div&gt;
    &lt;/tree-node-drop-slot&gt;
  
          &lt;tree-node-wrapper ng-reflect-node="[object Object]" ng-reflect-index="0" ng-reflect-templates="[object Object]"&gt;
        &lt;!--bindings={
    "ng-reflect-ng-if": "true"
  }--&gt;&lt;div class="node-wrapper ng-star-inserted" style="padding-left: 0px;"&gt;
          &lt;tree-node-expander ng-reflect-node="[object Object]"&gt;
      &lt;!--bindings={
    "ng-reflect-mobx-autorun": null
  }--&gt;&lt;!----&gt;
        &lt;!--bindings={
    "ng-reflect-ng-if": "true"
  }--&gt;
  &lt;span class="toggle-children-wrapper ng-star-inserted toggle-children-wrapper-collapsed"&gt;
  
          &lt;span class="toggle-children"&gt;&lt;/span&gt;
        &lt;/span&gt;
        &lt;!--bindings={
    "ng-reflect-ng-if": "false"
  }--&gt;
  
    &lt;/tree-node-expander&gt;
          &lt;div class="node-content-wrapper node-content-wrapper-active node-content-wrapper-focused" ng-reflect-tree-allow-drop="function (element, $event) {
   " draggable="true" ng-reflect-dragged-element="[object Object]" ng-reflect-tree-drag-enabled="true"&gt;
  
            &lt;tree-node-content ng-reflect-node="[object Object]" ng-reflect-index="0" ng-reflect-template="[object Object]"&gt;
    &lt;!--bindings={
    "ng-reflect-ng-if": "false"
  }--&gt;
    &lt;!--bindings={
    "ng-reflect-ng-template-outlet-context": "[object Object]",
    "ng-reflect-ng-template-outlet": "[object Object]"
  }--&gt;
        &lt;span _ngcontent-c5="" class="ui-treenode-parent ng-star-inserted"&gt;&lt;/span&gt;
        &lt;span _ngcontent-c5="" title="Title" class="ng-star-inserted"&gt;Assets&lt;/span&gt;
        &lt;span _ngcontent-c5="" class="pull-right ng-star-inserted"&gt;(7)&lt;/span&gt;
  
    &lt;/tree-node-content&gt;
          &lt;/div&gt;
        &lt;/div&gt;
        &lt;!--bindings={
    "ng-reflect-ng-template-outlet-context": "[object Object]"
  }--&gt;
  
      &lt;/tree-node-wrapper&gt;
  
          &lt;tree-node-children ng-reflect-node="[object Object]" ng-reflect-templates="[object Object]"&gt;
      &lt;!--bindings={
    "ng-reflect-mobx-autorun": null
  }--&gt;&lt;!----&gt;
        &lt;!--bindings={
    "ng-reflect-animate-speed": "true",
    "ng-reflect-animate-acceleration": "1.2",
    "ng-reflect-is-enabled": "true",
    "ng-reflect-is-open": "false"
  }--&gt;
  
    &lt;/tree-node-children&gt;
          &lt;tree-node-drop-slot ng-reflect-node="[object Object]" ng-reflect-drop-index="1"&gt;
      &lt;div class="node-drop-slot" ng-reflect-tree-allow-drop="function () { [native code] }"&gt;
      &lt;/div&gt;
    &lt;/tree-node-drop-slot&gt;
        &lt;/div&gt;
        &lt;!--bindings={
    "ng-reflect-ng-template-outlet-context": "[object Object]"
  }--&gt;
  
      &lt;/tree-node&gt;
  </code></pre>