js-test-driver

How to test jquery and ajax calls using JsTestDriver?

故事扮演 提交于 2019-12-06 02:07:51
问题 I have a dynamic page built with jQuery. Html pieces are loaded from mustache templates. These templates are downloaded from a url, and I would like to unit test the overall html construction : The JsTestDriver test is : AppTest = TestCase("AppTest") AppTest.prototype.test = function() { var actualHtml = ""; getHtml({ "title": "title", "header": "header", "text": "text", "authors": [ {"firstname": "firstname", "lastname": "lastname"} ] }, function(html) { actualHtml = html; }); assertEquals(

How to run browsers(chrome, IE and firefox) in headless mode?

我的未来我决定 提交于 2019-12-05 20:52:03
问题 I want to integrate JSTestDriver with jenkins-CI. problem is that the build server does not have display. is there a way to run browsers headlessly? Thanks 回答1: If your server is Linux, as mentioned, you can't run IE. But you can run other browsers like Firefox. The trick is to install XVFB on your Jenkins server which allows Firefox to run headless. I've used this setup and it works well. http://www.alittlemadness.com/2008/03/05/running-selenium-headless/ 回答2: Google Chrome now (Chrome 59

Run Headless JsTestDriver?

你离开我真会死。 提交于 2019-12-05 15:17:01
Is there a way to use jsTestDriver in a headless state where it loads the browsers but does so headlessly (you can't see the browser) or it loads them minimized? There is no way to configure JsTestDriver to open the browser minimized. And you have to open the browsers because they run the JavaScript code. You can try to create a virtual monitor and open the browser there. Under linux you can use xvfb for this, for example xvfb-run java -jar JsTestDriver-1.3.3d.jar --tests all --port 4224 --browser firefox chromium-browser --testOutput jsTests should open the browser in a virtual window. You

How to test jquery and ajax calls using JsTestDriver?

这一生的挚爱 提交于 2019-12-04 07:12:01
I have a dynamic page built with jQuery. Html pieces are loaded from mustache templates. These templates are downloaded from a url, and I would like to unit test the overall html construction : The JsTestDriver test is : AppTest = TestCase("AppTest") AppTest.prototype.test = function() { var actualHtml = ""; getHtml({ "title": "title", "header": "header", "text": "text", "authors": [ {"firstname": "firstname", "lastname": "lastname"} ] }, function(html) { actualHtml = html; }); assertEquals("expected html", actualHtml); }; And the code : function getHtml(json, resultFunc) { jQuery.ajax({ url:

How to run browsers(chrome, IE and firefox) in headless mode?

落花浮王杯 提交于 2019-12-04 03:39:50
I want to integrate JSTestDriver with jenkins-CI. problem is that the build server does not have display. is there a way to run browsers headlessly? Thanks If your server is Linux, as mentioned, you can't run IE. But you can run other browsers like Firefox. The trick is to install XVFB on your Jenkins server which allows Firefox to run headless. I've used this setup and it works well. http://www.alittlemadness.com/2008/03/05/running-selenium-headless/ Google Chrome now ( Chrome 59 for Mac and Linux, Chrome 60 for Windows ) has a headless mode built-in. It works cross-platform, and doesn't

Javascript JsTestDriver Jasmine & Jasmine-jquery

笑着哭i 提交于 2019-12-03 14:48:59
问题 I have lots of Jasmine unit tests, that are running unit tests for Javascripts code. They are using Jasmine-jquery plugin to do DOM manipulation. they use loadFixture, to load fixtures of HTML I tried to automate those unit tests, using JsTestDriver, with JasmineAdapter But all tests involve DOM-jquery manipulation are not passing? Is there something wrong with that? Is there a way to use Jasmine-jquery with JsTestDriver? 回答1: I will answer myself because I found a solution for this problem.

Javascript JsTestDriver Jasmine & Jasmine-jquery

爱⌒轻易说出口 提交于 2019-12-03 03:38:47
I have lots of Jasmine unit tests, that are running unit tests for Javascripts code. They are using Jasmine-jquery plugin to do DOM manipulation. they use loadFixture, to load fixtures of HTML I tried to automate those unit tests, using JsTestDriver, with JasmineAdapter But all tests involve DOM-jquery manipulation are not passing? Is there something wrong with that? Is there a way to use Jasmine-jquery with JsTestDriver? I will answer myself because I found a solution for this problem. The problem was Jasmine-Jquery is using ajax to load the html fixture, and it uses a relative path, assuming