From 9d7d973faa371df771e0243bdf5cefcfb26a2826 Mon Sep 17 00:00:00 2001 From: johnyma22 Date: Fri, 5 Oct 2012 00:14:46 +0100 Subject: [PATCH] This is a superghetto hack fix for testing button_indentation, Peter please make it less horrible, tnx :) --- tests/frontend/specs/button_indentation.js | 45 +++++++++++----------- 1 file changed, 23 insertions(+), 22 deletions(-) diff --git a/tests/frontend/specs/button_indentation.js b/tests/frontend/specs/button_indentation.js index 4f8860dc1..057c08471 100644 --- a/tests/frontend/specs/button_indentation.js +++ b/tests/frontend/specs/button_indentation.js @@ -103,35 +103,36 @@ describe("indentation button", function(){ firstTextElement.sendkeys('line 2'); // simulate writing the second line //get the second text element out of the inner iframe - var secondTextElement = $inner.find("div").first().children(":nth-child(0)"); // I need help wth this! - console.log(secondTextElement); // not working + setTimeout(function(){ // THIS IS REALLY BAD + var secondTextElement = $('iframe').contents().find('iframe').contents().find('iframe').contents().find('body > div').get(1); // THIS IS UGLY - // is there a list-indent class element now? - var firstChild = secondTextElement.children(":first"); - var isUL = firstChild.is('ul'); + // is there a list-indent class element now? + var firstChild = secondTextElement.children(":first"); + var isUL = firstChild.is('ul'); - //expect it to be the beginning of a list - expect(isUL).to.be(true); + //expect it to be the beginning of a list + expect(isUL).to.be(true); - var secondChild = secondChild.children(":first"); - var isLI = secondChild.is('li'); - //expect it to be part of a list - expect(isLI).to.be(true); + var secondChild = secondChild.children(":first"); + var isLI = secondChild.is('li'); + //expect it to be part of a list + expect(isLI).to.be(true); - //get the first text element out of the inner iframe - var thirdTextElement = $inner.find("div").first(); // I also need help with this.. + //get the first text element out of the inner iframe + var thirdTextElement = $('iframe').contents().find('iframe').contents().find('iframe').contents().find('body > div').get(2); // THIS IS UGLY TOO - // is there a list-indent class element now? - var firstChild = thirdTextElement.children(":first"); - var isUL = firstChild.is('ul'); + // is there a list-indent class element now? + var firstChild = thirdTextElement.children(":first"); + var isUL = firstChild.is('ul'); - //expect it to be the beginning of a list - expect(isUL).to.be(true); + //expect it to be the beginning of a list + expect(isUL).to.be(true); - var secondChild = firstChild.children(":first"); - var isLI = secondChild.is('li'); - //expect it to be part of a list - expect(isLI).to.be(true); + var secondChild = firstChild.children(":first"); + var isLI = secondChild.is('li'); + //expect it to be part of a list + expect(isLI).to.be(true); + },1000); }); });