diff options
author | Marcel Klehr <mklehr@gmx.net> | 2012-11-26 21:15:10 +0100 |
---|---|---|
committer | Marcel Klehr <mklehr@gmx.net> | 2012-11-26 21:15:10 +0100 |
commit | 103e0f6747fa5fbf97df9596b86431a806b61aa4 (patch) | |
tree | 8416666c2aa81e03fa4f89723519f1306f9b64d3 /tests | |
parent | 064bafe97345c763e0c73dd39bb76f543ab5d8c0 (diff) | |
download | etherpad-lite-103e0f6747fa5fbf97df9596b86431a806b61aa4.zip |
Add the basic structure of a timeslider test
Diffstat (limited to 'tests')
-rw-r--r-- | tests/frontend/specs/timeslider_revisions.js | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/tests/frontend/specs/timeslider_revisions.js b/tests/frontend/specs/timeslider_revisions.js new file mode 100644 index 00000000..b779935d --- /dev/null +++ b/tests/frontend/specs/timeslider_revisions.js @@ -0,0 +1,49 @@ +describe("timeslider", function(){ + //create a new pad before each test run + beforeEach(function(cb){ + helper.newPad(cb); + this.timeout(6000); + }); + + it("loads adds a hundred revisions", function(done) { + var inner$ = helper.padInner$; + var chrome$ = helper.padChrome$; + + // make some changes to produce 100 revisions + var timePerRev = 900 + , revs = 150; + this.timeout(revs*timePerRev+10000); + for(var i=0; i < revs; i++) { + setTimeout(function() { + // type 'a' in the first text element + inner$("div").first().sendkeys('a'); + }, timePerRev*i); + } + + setTimeout(function() { + $('#iframe-container iframe').attr('src', $('#iframe-container iframe').attr('src')+'/timeslider'); + + var timeslider$ = $('#iframe-container iframe')[0].contentWindow.$; + + var $sliderHandle = timeslider$('#timeslider-slider ui-slider-handle'); + /* + //get the strikethrough button and click it + var $strikethroughButton = chrome$(".buttonicon-strikethrough"); + $strikethroughButton.click(); + + //ace creates a new dom element when you press a button, so just get the first text element again + var $newFirstTextElement = inner$("div").first(); + + // is there a <i> element now? + var isstrikethrough = $newFirstTextElement.find("s").length === 1; + + //expect it to be strikethrough + expect(isstrikethrough).to.be(true); + + //make sure the text hasn't changed + expect($newFirstTextElement.text()).to.eql($firstTextElement.text()); + */ + done(); + }, revs*timePerRev); + }); +}); |