{"issue":{"state":"closed","created_at":"2011-12-06T22:17:07Z","updated_at":"2011-12-07T15:02:53Z","user":{"gravatar_id":"2a1de4108269622593a20e6fb6157be7","id":1056957,"url":"https://api.github.com/users/kevinrobinson","login":"kevinrobinson","avatar_url":"https://secure.gravatar.com/avatar/2a1de4108269622593a20e6fb6157be7?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"comments":4,"body":"I'm trying to use Jasmine to do full integration testing.  So in the beforeEach() we add an IFRAME to the page, set its src to my full app and then the Jasmine specs can work as integration tests in this way.  In this case it just checks that there is an element #email on the page.  This works great in the browser (Chrome).  Here's an example spec:\r\n\r\n```javascript\r\ndescribe(\"UI\", function() {\r\n  it('mooooooooo', function() {\r\n    //since the Jasmine server and the full app are running on different ports\r\n    document.domain = document.domain;\r\n\r\n    var sandboxWindow = null;\r\n    var sandboxDocument = null;\r\n    var sandboxLoaded = false;\r\n    var $iframe = $('<IFRAME id=\"sandbox\" />');\r\n    var testPageURL = 'http://domain.com:7080/signin';    \r\n\r\n    runs(function() {\r\n      $iframe.attr('src', testPageURL);\r\n      $iframe.load(function() {\r\n        sandboxWindow = $iframe[0].contentWindow;\r\n        sandboxDocument = $iframe[0].contentDocument;\r\n        sandboxLoaded = true;\r\n      });\r\n      $('body').append($iframe);\r\n    });\r\n\r\n    waitsFor(function() {\r\n      return sandboxLoaded;\r\n    }, \"iframe did not load\", 10000);\r\n\r\n    runs(function() {\r\n      expect(sandboxWindow.$(sandboxDocument).find('#email').length).toEqual(1);\r\n    })\r\n  });\r\n});\r\n```\r\n\r\nAnd this works great in Chrome.  The problem is that this throws an error when running the same spec through jasmine-headless-webkit (on Red Hat).  It says:\r\n\r\n    $ jasmine-headless-webkit\r\n\r\n    Running Jasmine specs...\r\n    ........................Can't load file:///home/username/project/jhw.13792.html, the file may be broken.\r\n    Out of curiosity, did your tests try to submit a form and you haven't prevented that?\r\n    Try running your tests in your browser with the Jasmine server and see what happens.\r\n\r\n    Test ordering seed: --seed 596\r\n\r\nI figure this is because of differences between QtWebkit and Chrome and I know what I'm doing is stretching the bounds a little.  But it would be great if we can write integration tests this way because then they can be written in Javascript and Jasmine and be debugged in Web Inspector.  It just seems like a better solution than using something like Capybara where there's a DSL and Ruby layer on top of what I really want to do, which is write my tests in Javascript, Jasmine-style.\r\n\r\nI found this post http://distillations.2rye.com/2011/11/jasmine-headless-vs-in-browser/! which mentions the same problem and concludes they just can't run these kinds of tests headlessly.  And while this is helpful and a decent workaround, it means this approach won't really work for CI.  I don't know enough about how this works under the hood or the internals of QtWebkit so not really sure where to even start looking into this.\r\n\r\nAny thoughts?\r\n\r\nThanks,\r\nKevin","assignee":null,"id":2468202,"number":92,"labels":[],"pull_request":{"patch_url":null,"html_url":null,"diff_url":null},"title":"IFRAME src can't be set when running through jasmine-headless-webkit","html_url":"https://github.com/johnbintz/jasmine-headless-webkit/issues/92","closed_at":"2011-12-06T22:56:33Z","url":"https://api.github.com/repos/johnbintz/jasmine-headless-webkit/issues/92","milestone":null},"action":"created","comment":{"created_at":"2011-12-07T15:02:52Z","updated_at":"2011-12-07T15:02:52Z","user":{"gravatar_id":"2a1de4108269622593a20e6fb6157be7","id":1056957,"url":"https://api.github.com/users/kevinrobinson","login":"kevinrobinson","avatar_url":"https://secure.gravatar.com/avatar/2a1de4108269622593a20e6fb6157be7?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"body":"Hi John,\r\n\r\nThat's the other approach I was thinking about, so good to know I'm not talking crazy.  Thanks a lot for your information and keep up the good work!\r\n\r\nThanks,\r\nKevin","id":3048130,"url":"https://api.github.com/repos/johnbintz/jasmine-headless-webkit/issues/comments/3048130"}}