MCPcopy Index your code
hub / github.com/angular-ui-tree/angular-ui-tree / BasicExamplePageNode

Function BasicExamplePageNode

e2e/basic-example/page.js:3–26  ·  view source on GitHub ↗
(nodeLocation)

Source from the content-addressed store, hash-verified

1var BASIC_EXAMPLE_URL = 'http://localhost:9000/#/basic-example';
2
3var BasicExamplePageNode = function (nodeLocation) {
4 var subnodesXpath = 'ol/li[contains(@class,"angular-ui-tree-node")]';
5 var nodeHandlesLocator = by.css('[ui-tree-handle]');
6
7 var nodeElement = element(by.xpath(xpathStringForNodeAtPosition(nodeLocation)));
8 var handle = nodeElement.all(nodeHandlesLocator).first();
9
10 this.getElement = function() { return nodeElement; }
11 this.getHandle = function() { return handle; };
12 this.getText = function () {
13 return handle.getText();
14 };
15 this.getSubnodes = function() {
16 return nodeElement.all(by.xpath(subnodesXpath));
17 }
18
19 function xpathStringForNodeAtPosition(nodeLocation) {
20 var xpathChunks = ['//*[@id="tree-root"]'];
21 nodeLocation.forEach(function(index) {
22 xpathChunks.push(subnodesXpath + '[' + index + ']')
23 });
24 return xpathChunks.join('/');
25 }
26}
27
28var BasicExamplePage = function () {
29 this.get = function () {

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected