why mouseover and mouseout event does not work in qunit?
s("a.flyoutlink:eq(0)").mouseover(function(){ //this is not working???? s("span.contexthelpcontent").exists function(){ ok(true,"floater exists"); }) })
After my test passes do I relocate the successful code?
0 down vote favorite I'm developing a Javascript app with Wordpad [forced to]. When my test passes within the browser that houses qunit code, do I move the successful code to an alternate location?
Err "QUnit.equals has been deprecated since 2009 (e88049a0), use QUnit.equal instead"
Hi, In the file myTests.js I have the code below: test('assertions', function() { equals( 1, 1, 'one equals one'); }) when I run it I got the err "QUnit.equals has been deprecated since 2009 (e88049a0), use QUnit.equal " instead if I run : test('assertions', function() { ok( 1 == 1, 'one equals one'); }) everything are ok. what shell I do to fox this problem err ? Thanks
Dynamic tests
Hi, I'd like to run test from a JSON configuration that contains the input and the expected values. Is there an elegant way to create the tests dynamically? I tried to call the test method within module.setup, but that does not work. I can call test from a global loop. That works, but is not very elegant as I have to fiddle around with closure issues. Is there a goodoption I missed? Thanks, Kris
Simulating keypress events?
I know that I can use jQueryObj.trigger('keypress') to simulate a key press event, but how can I populate the keypress event attributes? I am testing an autocomplete plugin which of course requires simulating keystrokes.
WebKit QT4.7 browser failed at http://www.intel.in to create megamenu on menu button?
What can be the cause? What are the possible ways to make changes inside browserapplication and Api's which can remove this bug? Website name is www.intel.in and bug is "menu failed to expand on mouse hovering"? $(".directory").live("click mouseenter", function (event) { if (event.type == "click" && $(this).attr("hasmouse") == "true") { $(this).attr("hasmouse", ""); closeNavMenu(1); } else { $(this).attr("hasmouse", "true"); if (!$(this).find("a").hasClass("selected")) { $(".directory a, .sites a,
QUnit and Automated Testing
Just wondering...Has anyone setup or have any ideas on an ideal usage of QUnit with automated testing tools? Currently at my company we are using Hudson as our build server. We would like to: 1. Automatically startup a browser and run QUnit tests 2. Save the QUnit tests to an easily parsable file format (JUnit xml seems to be the standard) Once that is done, it should be trivial to report the results in the CI server. Currently we're doing this by firing up Selenium and then loading the page with
Automating qUnit tests for use in continuous integration (e.g. Jenkins-CI)
Hi all A few weeks ago I started looking at getting qUnit tests to run in an automated testing environment (Jenkins CI) - it was a business requirement that wasn't going to go away. This proved more than a little bit complicated - and seems to be something discussed on various blogs at great length - the only viable option being to use WebDriver to execute the tests and extract the results, hardly a clean solution. Enter RhUnit - a (nearly complete) qUnit compatible implementation which runs in Rhino.
Is it possible to test for no exception thrown?
JsTestDriver provides the ability to test if a function has not thrown an error e.g. function myfunc() { return; } assertNoException(function () { myfunc(); }); The test should fail as no exception was thrown. How would I achieve this with qunit? Cheers
Why this fails? equal($("<h1/>"), $("<h1/>"))
Or even equal($("<h1/>")[0], $("<h1/>")[0]) http://jsfiddle.net/kdEtk/24/ Thanks
How to get around issues running a single test with RequireJS and QUnit 1.9?
I recently upgraded from QUnit 1.2pre to 1.9, and have found that rerunning individual tests no longer works reliably for me - often an entirely different test will be run. My tests are in RequireJS modules that get bootstrapped as follows: <body> <script src="vendor/qunit.js"></script> <script src="../../assets/js/libs/require.js"></script> <script> require({ deps: ['util/test-helper.js', ... ], paths: { t: "../test/qunit/t" } }, [
Organizing tests in groups
When you have lots of tests, there are situations when you want to run only a subset of tests, e.g. when TDD'ing, or when you are fixing something in a restricted part of your project. To help with organizing and running subsets of tests, I developed QUnit Test Groups. The idea of this addon is to provide a way to organize the tests files in an hierarchy, and automatically render an outline where clicking a node will run all tests from that node to the bottom in the hierarchy. Please take a look
QUnit is rejected in IE9 because of MIME type mismatch
In my test page, the qunit.js is referenced by a online url, like: <script type="text/javascript" src="http://github.com/jquery/qunit/raw/master/qunit/qunit.js"></script> Then in IE9, a warning occurred: SEC7112: Script from https://github.com/jquery/qunit/raw/master/qunit/qunit.js was blocked due to mime type mismatch I've checked the MSDN, and according to this page: http://msdn.microsoft.com/en-us/library/gg622941(v=vs.85).aspx, it seems that this is supposed to be fixed on server side to provide
<ol id="qunit-tests"> not populated
Using IE8, Chrome7.0, FF3.6 and code from the example on http://docs.jquery.com/Qunit. After running tests, as described, a <p id="qunit-testresult"> is visible, but the <ol id="qunit-tests"></ol> element below is empty in the DOM <h1 id="qunit-header">Header text</h1> <h2 id="qunit-banner"></h2> <div id="qunit-testrunner-toolbar"></div> <h2 id="qunit-userAgent"></h2> <ol id="qunit-tests"></ol> <div id="qunit-fixture">test markup, will be hidden</div> I'm stepping through QUnit.js to find where the
Populate Drop Down List using jquery mobile from textbox
I have a textbox whose id is other and I want to populate this textbox value into drop down list This is javascript I am using to populate... but this is not working.. Any suggestion will be appreciated...!! I want to do like this:- http://viralpatel.net/blogs/demo/dynamic-combobox-listbox-dropdown-in-javascript.html <SCRIPT language="javascript"> function addCombo() { var textb = $('#other').attr('id'); var combo = $('#category').attr('id'); alert(combo); var
Change to QUnit.log requires doc/blog updates
FYI, The Overhaul of QUnit.callbacks change changed QUnit.log in a way that makes it inconsistent with the documentation at http://docs.jquery.com/Qunit. QUnit.log now takes an single properties object rather than individual arguments. d
Is fireunit still active?
Just a quick question, is fireunit still active? I don't see much chatter on it in the last year, I wanted to know before I lost too many cycles trying to get it working.
line break in message?
Is it possible to have line break in messages? If it is not supported, isn't it nice to add it in case some users need more customized messages.
How can I compare two HTML strings, disregarding the order of attributes
I have got a test that parses XML and appends an element to another on a page. How can I compare this actual element to an expected string or object, so that the order of attributes does not matter to prevent false positives because of differences caused by cross browser processing Tom
asynchronous tests sometimes call start() after timeout
Imagine a test script with two tests that looks like this: test("some test description", function(){ stop(3000); // set test timeout at 3 seconds async_call(parameter, function(){ ok(true, "This assertion passes"); start(); }); }); test("some other test description", function(){ ok(true, "another assertion that returns true"); }); If the first test times out during async_call but it comes back later, its assertion (ok) gets run during the second test ("some other test description").
Code coverage results
It would be a good idea to include a summary of code coverage within any files or script tags that have had tests run against them, that are reported with the test results summary. Tom
Can you use QUnit to test event triggering?
Hi, I'm new to QUnit and I'm doing a quick look through whether QUnit is the right unit testing API for me. I want something to test JavaScript code by triggering an event, i.e. a mouse click or a key stroke. Can somebody be kind enough to let me know if this is possible via QUnit? I've tried to follow the jQuery QUnit documentation, but there are a lot of broken links and I'm lost. If possible please let me know where can I read more about it. Many thanks. Warmest Regards, Alexander
[Request for review] perf.js Initial Thoughts
I am looking to for feedback on the initial design/concept of a framework to test and standardize JavaScript framework performance. In a nutshell, it takes functions which are common in all of the various frameworks, which are non-standard, and attempts to get a comparison of the same functionaltity and how that performs across the various frameworks. The way results are recorded is by leveraging the BrowserScope.org project. So far we have only started with fairly standard calls, and begun to trend
A definitive list of recommended jQuery testing tools?
Hey guys, One thing that I notice quite a lot on jQuery news/tutorial blogs is that they tend to focus on just recommending QUnit and Firebug for testing purposes without necessarily going into more detail on other great tools and services developers can use such as Selenium, TestSwarm etc. I would like to hear your thoughts on what the best tools for testing jQuery/JavaScript code are. I've already compiled an initial list here with a little assistance from Elijah Manor, Paul Irish and one or two
Mocking and Stubbing
Hi, I mean when writing tests in some time you will need some mocking and stubbing for tests. I searched for a mock and stub things for QUnit and can't found it, so, I developed one: http://github.com/bitzesty/qunit-mock It supports simple mocking (expect a number of calls in a function) and stubbing. It automatic removes all mocking and stubbing after current tests (to archive this I need to make some around functions on window.test and window.asyncTest methods), it supports mocking async. For future
QUnit: "polluted" config.fixture -> window.load versus domready
Hi, I'm testing several modules, wich need to use QUnit.reset. Some of the modules are modifying the DOM on domready. My Problem is, that the config.fixture is set on window.onload and therefore saves the wrong HTML-Structure. Currently, I'm delaying the tests DOM-Manipulation, if I detect a window.Qunit is there a better workaround/solution for this problem? regards alex
Documentation for additional asserts?
I noticed the asserts 'deepEqual', 'notEqual', etc. aren't documented in the QUnit docs. Is this an oversight or am I missing something? Can I safely use these asserts, or are they subject to change?
Kopfloss for headless JavaScript testing
Not being content with browser-based testing - it disrupts my workflow and complicates automated testing - I've written a set of small scripts to run QUnit tests from the command line (using Spidermonkey or Node.js - or potentially any other JavaScript engine): http://github.com/FND/kopfloss Some background is explained here: http://fnd.lewcid.org/blog/archive/157 I figured this was worth sharing here, and would appreciate feedback - constructive criticism included!
Icon to run individual test
Currently, if I want to run a specific test I have to double-click on the title of the test. While this works, there have been a number of occasions where I double-click, but the test closes and then I end up opening one the wrong one. I small icon to click on would be much simpler and prevent this from happening. Essentially, what I tend to do is if I see a failure in one of my tests, I open the test to view the results, either fix or add some debugging to figure out what is going on, and then
failing test: diff: basics (1, 0, 1)
undefined, expected: "<em>the</em> quick <del>brown </del> fox <del>jumped </del><del><strong>over</strong> </del><ins>jumps </ins><ins><strong>o</strong>ver </ins>" result:"<em>the</em> quick <del>brown </del> fox <del>jumped </del><del><strong>over</strong> </del><ins>jumps </ins><ins><strong>o</strong>ver </ins>", diff: "<em>the</em> quick <del>brown </del> fox <del>jumped </del><del><strong>over</strong> </del><ins>jumps </ins><ins><strong>o</strong>ver </ins>" On chrome, Fx, IE and Safari. Doesn't
how to resolve timeout testing
hi, I wonder that how to resolve to timeout in Qunit code,and best to show me the code in details,thanks!
selenium and dialog
Hello everybody, I'm working on the test writinh with selenium. On my window I have a jquery dilaog and I want to simulate a click on a button from my dialog. Is it possible? or maybe can I put an id on the button of dialog jquery? Thanks in advance for your answer J
Async setup and teardown
Guys, I've had to run some async code on my setup and teardown methods but it was not working properly. Here's a simple patch to make it run and the corresponding test cases: http://github.com/fgrehm/qunit/compare/2dbf6037778266fa01a1...master What do you guys think, is this really needed? Cheers, Fábio Rehm
How can I fix the date used by the jQuery datepicker?
I'm using a testing stack including cucumber, capybara, and selenium webdriver. On of the scenarios is date sensitive and fails if it is run on the first day of a month which is at least as long as the preceding month. On the server side, I'd just use something like the Ruby timecop plugin to make Date.today return a fixed date for the duration of the test, but in this case it's the jQuery datepicker plugin picking the date and it's just using new Date. I'm open to suggestions about how to stub things
Should QUnit work with JQuery Validate plugin?
I'm a long-time developer, but a relative JS noob. I'm used to test-driving all my development, and I'd like to bring that habit with me. I'm trying to do some simple form validation using the JQuery Validate plugin. But I can't get it to work. I started out with a simple test of the equal(1+1,2) variety, and that was fine. Then I put in some a basic form, and added simple validation. It wouldn't work, no matter what I tried. Then I removed the test method, and the form validation started working.
Opera and QUnit globals check
Sorry to bring this up in a new thread, but it seems impossible to move the thread at forum.jquery.com/topic/qunit-to-check-for-globals So, as reported there (and I can reproduce this), checking for leaked globals using QUnit will have all tests fail that add DOM nodes using an id. Is there a workaround or fix in sight?
Load qunit asyncronously
Hi guys, I am trying to integrate qUnit in my web application from javascript, when I enable qunit every files and HTML needed are added dynamically, However it seems qunit use window.load, and it does not currently load what is inside, I tried to recall qunit using QUnit.init() but it always says 0 test cases when In fact there are severals loaded.. Any ideas?
Rerun tests in qUnit
I'm trying to make an extension to qunit that enables it to power selenium to run other browsers. For this to work, I need qunit to be able to rerun the same tests over again. I was able to get this to work by using my own version of qunit.js with a custom synchronize function that stores all callbacks. But I'd like to avoid that. Is there a way to do this? Would you consider making synchronize a public method in future releases? Thanks, Justin
Testing Submit Event
Hi, I'm very new to jquery and have just started looking at qunit for testing and I have a bit of existing code that I would like to add a test to but I can't figure out how to write the test from the qunit examples. Can someone help, below is the code I would like to write a test for: $(document).ready(function(){ $("#ajax-contact-form").submit(function(){ var str = $(this).serialize(); $.ajax({ type: "POST", url: "sendmail.php", data: str, success: function(msg){
Conditionally Skip Tests
In the project I'm working on, there is a bunch of code specifically to test IE. We want to be able to unit test this code and have those tests run on IE, but they would fail if run on other browsers. I wanted to get people's thoughts on how this could be better supported by QUnit. Right now I believe the only real option is to add an if statement within the test (or split the IE tests into a separate HTML file and just know to not run that particular file, but that doesn't work easily with continuous
Next Page