(nodeLocation)
| 1 | var BASIC_EXAMPLE_URL = 'http://localhost:9000/#/basic-example'; |
| 2 | |
| 3 | var 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 | |
| 28 | var BasicExamplePage = function () { |
| 29 | this.get = function () { |
nothing calls this directly
no test coverage detected