Skip to content

Commit

Permalink
Fix head change test and deactivate first tree test
Browse files Browse the repository at this point in the history
  • Loading branch information
Christof committed Jun 4, 2014
1 parent 1a1eedd commit 2582991
Showing 1 changed file with 23 additions and 18 deletions.
41 changes: 23 additions & 18 deletions spec-e2e/treebanking/editing_tree_spec.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
"use strict";

describe('Dependency tree', function(){
beforeEach(function() {
browser.get('/app/#/e2e?doc=caesar2&s=21');
});

var eratNode;
var inNode;
beforeEach(function() {
var nodes = element.all(by.css("div.node"));
nodes.map(function(elm, index) {

function searchForNodes() {
var nodes = element.all(by.css("div.node span[token]"));
return nodes.map(function(elm, index) {
return {
index: index,
text: elm.findElement(by.css("span[token] span")).getInnerHtml(),
text: elm.findElement(by.css("span")).getInnerHtml(),
location: elm.getLocation(),
element: elm
};
Expand All @@ -27,24 +24,32 @@ describe('Dependency tree', function(){
}
}
});
}

beforeEach(function() {
browser.get('/app/#/e2e?doc=caesar2&s=21');
searchForNodes();
});

it('displays a dependency tree (erat is above in)', function() {
xit('displays a dependency tree (erat is above in)', function() {
expect(eratNode).toBeDefined();
expect(inNode).toBeDefined();
expect(inNode.location.y).toBeGreaterThan(eratNode.location.y);
});

describe('head change', function() {
xit('displays a dependency tree (in is above erat)', function() {
expect(eratNode).toBeDefined();
expect(inNode).toBeDefined();


eratNode.element.click();
inNode.element.click();

expect(inNode.location.y).toBeLessThan(eratNode.location.y);
it('displays a dependency tree (in is above erat)', function() {
expect(eratNode.element.getInnerHtml()).toBeDefined();
expect(inNode.element.getInnerHtml()).toBeDefined();
expect(inNode.location.y).toBeGreaterThan(eratNode.location.y);

var execute = "arguments[0].click()";
browser.executeScript(execute, eratNode.element);
browser.executeScript(execute, inNode.element);

searchForNodes().then(function () {
expect(inNode.location.y).toBeLessThan(eratNode.location.y);
});
});
});
});
Expand Down

0 comments on commit 2582991

Please sign in to comment.