Git Product home page Git Product logo

js-test-driver's People

Contributors

alexeagle avatar skytreader avatar

Watchers

James Cloos avatar  avatar

js-test-driver's Issues

Implement means to test asyncronous calls

Currently It seems to me it is impossible to test asyncronous calls. (ie.
do something and execute a certain callback once it is done)

QUnit for example allows tests to do this by using functions called
"start()" and "stop()". Using this functions test handling can be stopped,
until the callback executes and restarted in the callback for further
processing.

Implementing this feature would not only allow the full adaption of QUnit
tests, furthermore it would provide the necessary means to have a fully
working js test framework. As a lot of operations in js are done
asynchronously testing of this kind of functionality needs to be possible.

The possibility to provide a timeout to the "stop()" function would be
great as well. If the timeout runs out, the test is assumed to have failed.

Original issue reported on code.google.com by [email protected] on 29 Aug 2009 at 2:03

assertEquals does not work as expected with arrays

What steps will reproduce the problem?
1. Create two arrays with same content, for example ['foo', 'bar']
2. use an assertEquals to compare the arrays

What is the expected output? What do you see instead?
It would make sense if this would compare the contents of the array, and 
if their contents are equal, the arrays should be equal too.

Currently this will always fail. An alterantive to this would be to 
provide a special assert that works with arrays.

What version of the product are you using? On what operating system?
1.0b Windows XP

Original issue reported on code.google.com by jani.hartikainen on 13 Aug 2009 at 9:34

IE 7/8 and Safari not captured by server

What steps will reproduce the problem?
1.Start JsTestDriver server and begin to capture browsers.
2.Try to capture Safari 3.2.3 or IE 8 in either 7 or 8 mode by manually
pointing them to the server url (example: http://testserver:9876)

What is the expected output? What do you see instead?
Expected is that the browsers will display the capture page with the list
of already captured browsers and that clicking the "capture browser" link
will capture the browsers.

Actual is just a blank page. Firefox, Opera, IE 6, and Chrome all can be
captured. 

Does not work either when adding "capture" to the url:
http://testserver:9876/capture



What version of the product are you using? On what operating system?

Using JsTestDriver-1.0b.jar running on CentOS. All the browsers are on two
different Windows XP computers.


Please provide any additional information below.

One of the Windows computers is a laptop connecting to the domain via VPN.
IE 8 and Safari are not captured on this machine.

The other Windows computer is running on the same domain. IE 6 works fine
from this computer but Safari does not.

Original issue reported on code.google.com by [email protected] on 17 Jul 2009 at 7:51

expectAsserts when called with no arguments should just assert that >0 asserts occurred

I have a method which asynchronously processes a string and returns an array 
via a callback.  I have 
written an assertEq method which will compare arrays and objects element-wise, 
however the 
number of assertions that it will perform is unpredictable.  I'd like to be 
able to say that I expect 
some number of assertions to happen asynchronously, but I don't care how many.

Original issue reported on code.google.com by [email protected] on 15 Jul 2009 at 12:52

Dojo integration

Just like the YUI JsTestDriver should be able to run Dojo tests.

Original issue reported on code.google.com by [email protected] on 11 Jun 2009 at 8:47

assertEquals does not compare recursive structures nor "associative arrays"

The "assertEquals" function does not compare recursive array structures.
For example [['foo', 'bar'], 'baz].

Neither does it compare flat objects simply used as "associative
arrays".(eg. {'foo': 'bar'})

As these structures are commonly used I would suggest to add support for them.

Because I needed this in a currently ongoing project I implemented a new
"assertEquals" function taking care of it. It is attached to the report.

greetings Jakob

Original issue reported on code.google.com by [email protected] on 1 Sep 2009 at 4:56

Attachments:

assertUndefined and assertNotUndefined needed

As a developer I want to be able to check that a function is not returning
undefined objects that can potentially through TypeErrors if properties or
sub-functions are called.


I have added assertNotUndefined for my needs and have also created an
assert for Undefined. 

This patch also has a patch for issue 47 that I attached earlier. it will
only work if the entire patch is applied.

Original issue reported on code.google.com by [email protected] on 12 Oct 2009 at 10:10

Attachments:

Maven plugin

As a continuous build owner for a project that uses Maven, I would like to 
configure JsTestDriver as a Maven build target, so that it's easy to add to my 
project.

Original issue reported on code.google.com by aeagle22206 on 8 Jun 2009 at 3:48

Logging output is displayed for passing tests and makes results unreadable

What steps will reproduce the problem?
1. Write a test that passes which calls jstestdriver.console().
2. Run that tests. 
3. The logging output is displayed.

What is the expected output? What do you see instead?

Logging should be displayed only for failing tests. When it is displayed
for all tests, the console output is unreadable. I have to look for
"passed" and "failed" word in the output for each test.

What version of the product are you using? On what operating system?

SVN Trunk

Please provide any additional information below.

Original issue reported on code.google.com by [email protected] on 1 Oct 2009 at 3:34

Can't register browsers from the command liine

On Win XP:

java -jar JsTestDriver.jar --port 9876 --browser  "C:\Program Files\Mozilla 
Firefox\firefox.exe"

Expected: A started server with the browser as slave.

Actual: The output shows "WARNING: Process refused 
toexitjava.lang.BrowserShutDownAction

The tests do not execute afterwards.

What version of the product are you using? On what operating system?
1.1



Original issue reported on code.google.com by [email protected] on 30 Sep 2009 at 3:18

Need test count to be available upfront

As a Python developer, I would like to integrate JsTestDriver with my
existing test runner based on PyUnit. However, it expects the number of
tests that are going to be run to be available before the tests start to be
able to report progress, so I cannot rely solely on --testOutput.

Optimally, both the count of tests and their names would be output before
the actual run starts (even a --dry-run mode would be fine).

Original issue reported on code.google.com by [email protected] on 9 Jun 2009 at 2:05

Eclipse plugin does not notice already running server

What steps will reproduce the problem?
1. Start the JsTestDriver server from command line
2. Open eclipsen and notice the server line says NOT RUNNING
3. Click the green arrow to try to start the server

What is the expected output? What do you see instead?

The plugin would connect to the existing server instance, or prompt and say
that "service already running on port xxxx, please stop it and try again".
Currently nothing happens.  

What version of the product are you using? On what operating system?

JsTestDriver: 1.0b
OS: Mac OSX 10.5.8
Java: 1.6

Please provide any additional information below.

Original issue reported on code.google.com by [email protected] on 13 Aug 2009 at 12:25

Opera 9.64 won't run newly added tests

What steps will reproduce the problem?
1. Run server
2. Capture Opera 9.64 (I'm running it on Ubuntu/Jaunty, don't have a
windows box handy to try it on win)
3. Add a new test to a javascript TestCase that you created before running
the server
4. Run with --tests all

What is the expected output? What do you see instead?
Opera doesn't run the new tests that you added - i.e. lets say I have 1
TestCase myTestCase, and myTestCase has 5 tests. If I add a 6th after
capturing Opera, running with --tests all only runs the first 5 tests on
Opera, even if it runs all 6 on other browsers.

What version of the product are you using? On what operating system?
Opera 9.64 on Ubuntu/Jaunty

Please provide any additional information below.

Original issue reported on code.google.com by [email protected] on 10 Sep 2009 at 1:07

Prototype JS library causes error

What steps will reproduce the problem?
1. Add Prototype JS library to com.google.jstestdriver.javascript package
from http://prototypejs.org/assets/2008/9/29/prototype-1.6.0.3.js
2. Run "ant jstestdriver"
3. Observe error

What is the expected output? What do you see instead?

As Prototype is not used in anything, I would expect the output to be the
same as without the library. Instead the test fails with:

     [java] com.google.gson.JsonParseException: The JsonDeserializer
com.google.gson.DefaultTypeAdapters$CollectionTypeAdapter@21d9bf04 failed
to deserialized json object "[{"file": {"fileSrc": __lots_of_json__},
"success": true, "message": ""}]" given the type
com.google.gson.ParameterizedTypeImpl@5138c5fa
     [java]     at
com.google.gson.JsonDeserializerExceptionWrapper.deserialize(JsonDeserializerExc
eptionWrapper.java:63)
     [java]     at
com.google.gson.JsonObjectDeserializationVisitor.visitFieldUsingCustomHandler(Js
onObjectDeserializationVisitor.java:106)
     [java]     at
com.google.gson.ObjectNavigator.navigateClassFields(ObjectNavigator.java:135)
     [java]     at
com.google.gson.ObjectNavigator.accept(ObjectNavigator.java:116)
     [java]     at
com.google.gson.JsonDeserializationContextDefault.fromJsonObject(JsonDeserializa
tionContextDefault.java:75)
     [java]     at
com.google.gson.JsonDeserializationContextDefault.deserialize(JsonDeserializatio
nContextDefault.java:49)
     [java]     at com.google.gson.Gson.fromJson(Gson.java:373)
     [java]     at com.google.gson.Gson.fromJson(Gson.java:321)
     [java]     at com.google.gson.Gson.fromJson(Gson.java:297)
     [java]     at
com.google.jstestdriver.BrowserQueryResponseServlet.service(Unknown Source)
     [java]     at
com.google.jstestdriver.BrowserQueryResponseServlet.doPost(Unknown Source)
     [java]     at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
     [java]     at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
     [java]     at
org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:502)
     [java]     at
org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:389)
     [java]     at
org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
     [java]     at org.mortbay.jetty.Server.handle(Server.java:326)
     [java]     at
org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:534)
     [java]     at
org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:879)
     [java]     at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:747)
     [java]     at
org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)
     [java]     at
org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
     [java]     at
org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:228)
     [java]     at
org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:520)
     [java] Caused by: java.lang.ClassCastException:
com.google.gson.JsonPrimitive cannot be cast to com.google.gson.JsonArray
     [java]     at com.google.gson.JsonElement.getAsJsonArray(JsonElement.java:91)
     [java]     at
com.google.gson.DefaultTypeAdapters$CollectionTypeAdapter.deserialize(DefaultTyp
eAdapters.java:399)
     [java]     at
com.google.gson.DefaultTypeAdapters$CollectionTypeAdapter.deserialize(DefaultTyp
eAdapters.java:369)
     [java]     at
com.google.gson.JsonDeserializerExceptionWrapper.deserialize(JsonDeserializerExc
eptionWrapper.java:50)
     [java]     ... 23 more


What version of the product are you using? On what operating system?

Revision 291, Mac OSX 10.5.8, Safari 4.03.


Please provide any additional information below.

Firefox 3 seems to work fine.

Original issue reported on code.google.com by [email protected] on 25 Aug 2009 at 1:09

Object Expected Error after integrating QUnitAdapter.js

What steps will reproduce the problem?
1. Written some QUnit tests. Included the JSTestDriver.jar, config file, 
QUnitAdapter.js, equiv.js, test file (.js) and the source in the same 
directory. All resides in the same directory.
2. Run JSTestDriver-1.1.jar and capture browser.
3. Run --tests all.

What is the expected output? What do you see instead?
Expected to see some sort of test outputs.  Instead, got Error: Object 
expected for all tests.

What version of the product are you using? On what operating system?
JSTestDriver-1.1.jar
QUnitAdapter.js (tried on both new and old versions)
equiv.js
IE 6

Please provide any additional information below.
Traced the source of error to the words "QUnitTestCase" in 
QUnitAdaptor.js. The QUnit tests themselves run fine in a browser (with 
some html code that was removed for JSTestDriver).  Was wondering do I 
need to include JUnit.jar somehow since TestCase.class is in that jar? (am 
running c# .Net at the moment)  Or have I missed something with TestCase?

Thanks.

Original issue reported on code.google.com by [email protected] on 19 Oct 2009 at 12:18

Running tests will hang forever if any browser leaves the slave page

What steps will reproduce the problem?
1. Start the test server: java -jar JsTestDriver-1.0b.jar --port 4224
2. Capture a browser
3. Navigate the browser away from the page (or close it, crash it, etc)
4. Run tests: java -jar JsTestDriver-1.0b.jar --tests all --verbose

What is the expected output? 
I would like the system to notice at some point that the browser has gone away 
and is not 
responding, and for the test run to halt, report that not all browsers were 
tested, but still report 
the results for those that were.

What do you see instead?
The test runner sits at the command line forever.  Sometimes it repeats 
"Waiting for a slot..." 
over and over, other times there is no output.

What version of the product are you using? On what operating system?
JsTestDriver-1.0b.jar on OSX 10.5.7

$ java -version
java version "1.5.0_19"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_19-b02-304)
Java HotSpot(TM) Client VM (build 1.5.0_19-137, mixed mode, sharing)


Please provide any additional information below.
I'm running the server as a daemon with the command:

nohup java -jar JsTestDriver-1.0b.jar --port 4224 &>/dev/null &

Original issue reported on code.google.com by [email protected] on 12 Jul 2009 at 8:52

Coverage throws Null Pointer Exception when decorating jQuery

What steps will reproduce the problem?

* Add jquery to be loaded in jsTestDriver.conf (I'm using version 1.2.3)
* Add the coverage plugin in jsTestDriver.conf (I'm using version 1.1)
* Run JS Test Driver
* Notice the Null Pointer Exception :(

What is the expected output? What do you see instead?

I expect to see the tests run and the coverage reported.

Instead I see the following:

Warning: multiline expression on line 1 in
C:/Karl/Dev/Bonobo/src/SevenDigital.Bonobo.Web/static/lib/jquery.js has a
statement that will not be instrumented.
Warning: multiline expression on line 345 in
C:/Karl/Dev/Bonobo/src/SevenDigital.Bonobo.Web/static/lib/jquery.js has a
statement that will not be instrumented.
Warning: multiline expression on line 1354 in
C:/Karl/Dev/Bonobo/src/SevenDigital.Bonobo.Web/static/lib/jquery.js has a
statement that will not be instrumented.

Warning: multiline expression on line 1355 in
C:/Karl/Dev/Bonobo/src/SevenDigital.Bonobo.Web/static/lib/jquery.js has a
statement that will not be instrumented.

Warning: multiline expression on line 3439 in
C:/Karl/Dev/Bonobo/src/SevenDigital.Bonobo.Web/static/lib/jquery.js has a
statement that will not be instrumented.

java.lang.NullPointerException
        at com.google.jstestdriver.coverage.Statements.add(Unknown Source)
        at com.google.jstestdriver.coverage.StatementsBuilder.build(Unknown
Source)
        at
com.google.jstestdriver.coverage.CodeCoverageDecorator.decorate(Unknown Source)
        at
com.google.jstestdriver.coverage.CoverageInstrumentingProcessor.process(Unknown
Source)
        at
com.google.jstestdriver.ProcessingFileLoader.postProcessFile(Unknown Source)
        at com.google.jstestdriver.ProcessingFileLoader.loadFiles(Unknown
Source)
        at com.google.jstestdriver.CommandTask.uploadFileSet(Unknown Source)
        at com.google.jstestdriver.CommandTask.run(Unknown Source)
        at
com.google.jstestdriver.JsTestDriverClientImpl.sendCommand(Unknown Source)
        at
com.google.jstestdriver.JsTestDriverClientImpl.runAllTests(Unknown Source)
        at com.google.jstestdriver.RunTestsAction.run(Unknown Source)
        at com.google.jstestdriver.ThreadedActionRunner.run(Unknown Source)
        at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
        at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
        at java.util.concurrent.FutureTask.run(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown
Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)
Total 0 tests (Passed: 0; Fails: 0; Errors: 0) (0.00 ms)
No lines of coverage found.

Original issue reported on code.google.com by [email protected] on 1 Oct 2009 at 8:57

Support for a config file in another directory than cwd

What steps will reproduce the problem?
1. Put the config file in another directory (eg. conf/jsTestDriver.conf)
2. Use relative paths for files to load in the config file, eg.
../public/javascripts/foo.js
3. Run using --config config/jsTestDriver.conf

What is the expected output? What do you see instead?
No tests are being run. Changing the paths in the config correctly raises
an error.

What version of the product are you using? On what operating system?
1.0b

Please provide any additional information below.
I'm trying to use this with my Rails application, where the directory
layout is as follows:

  conf/jsTestDriver.conf (the config file, used with --config
../jsTestDriver.conf)
  public/javascripts/*.js (the javascript source files)
  test/javascripts/*.js (the test files)
  test/javascripts/<test driver jar>

Putting the config file in the current directory and altering the paths (eg
../public/javascripts becomes public/javascripts), so it seems the paths
are somehow confused?

Am I doing it wrong? 

Original issue reported on code.google.com by [email protected] on 25 Sep 2009 at 8:22

Globing using ** in jsTestDriver.conf throws NullReferenceException

What steps will reproduce the problem?
1. In jsTestDriver.conf add a load path containing two asterix eg src/**/*.js 
2. Run all tests

What is the expected output? What do you see instead?
Normal execution of the test driver but a NullReferenceException is thrown

What version of the product are you using? On what operating system?
1.0b on Windows 7 Beta



Original issue reported on code.google.com by [email protected] on 31 May 2009 at 12:51

Test result/status through return value

It would be very useful if I could get the status of a test (pass/fail) 
without having to look at the output: maybe through a return value or an 
environment variable. Would be really useful in automating tests and in 
continuous builds, I would have go through logs only if a test fails this 
way.

Original issue reported on code.google.com by [email protected] on 19 Aug 2009 at 11:13

yui compatibility problem? not all tests are discovered on first load

What steps will reproduce the problem?
1. Unpack attached file
2. Run tests with '--config JsTestDriver.conf'
3. Profit?

What is the expected output? What do you see instead?

The expectation is that 120 tests should be found. Instead, on the first
run, only 50 tests are found. A subsequent run finds 120 tests (though many
of them are failing at the moment).

What version of the product are you using? On what operating system?

JsTestDriver-1.0b.jar, Firefox 1.9.10 on Ubuntu 9.04

Please provide any additional information below.


Original issue reported on code.google.com by [email protected] on 27 May 2009 at 6:46

Attachments:

Runner hangs on Syntax error

If you have a file with an error in it during load time, the runner will hang 
indefinitely.

If the browser is not firefox you get no feedback. 

Original issue reported on code.google.com by [email protected] on 19 Aug 2009 at 6:28

Compatibility with prototype javascript lib

What steps will reproduce the problem?
1. Load in load jsTestDriver.conf the prototype lib:
 - Prototype/*.js
2. Execute test as described in documentation

What is the expected output? Testreport with more than 0 tests.

What do you see instead? Total 0 tests (Passed: 0; Fails: 0; Errors: 0)
(0,00 ms)

What version of the product are you using? On what operating system?
JsTestDriver-1.0b.jar

Please provide any additional information below.
I know the problem with jquery and this: jQuery.noConflict(); solution.

I like this js-test solution very much. But i have to use prototype in my
applications.

Thanks for the work!

Original issue reported on code.google.com by [email protected] on 30 Jun 2009 at 9:12

IE7 Throws JS errors and JSTestDriver cant create new JS Object

What steps will reproduce the problem?
When running production code Bug.js with test code BugTest.js in Chrome 4 
and Firefox 3.5 it works but in IE throws Bug is undefined. If I have a 
look at the IE slave there are errors saying it expecting an identifier.

Code and Screen shots below

***Bug.js****
function Bug(){
    return {
        item: function(){
            return true;
        },
    };
}

***BugTest.js***

BugTest = TestCase("BugTest");

BugTest.prototype.testShowBug = function(){

    var bug = new Bug();
    assertEquals(true,bug.item());
}

What is the expected output? What do you see instead?


What version of the product are you using? On what operating system?
Using 1.05 in Eclipse
Vista Business x64 using Eclipse 3.5.1

Please provide any additional information below.

Original issue reported on code.google.com by [email protected] on 3 Oct 2009 at 8:25

Attachments:

Execute tearDown when test throws

As a Javascript developer, I would like to the tearDown method of a
TestCase to be executed even if a test method throws an exception to that
mocks can be reset

(e.g. when you replace window.alert with a mocked function but want the
alert to be restored afterwards)

Original issue reported on code.google.com by [email protected] on 22 Jul 2009 at 8:26

Can't put jsTestDriver.conf in another directory

This works...
java -jar ./build/JsTestDriver-1.0b.jar --config ./test-all.yml --tests all
..
Total 2 tests (Passed: 2; Fails: 0; Errors: 0) (0.00 ms)
  Chrome 2.0.172.31: Run 2 tests (Passed: 2; Fails: 0; Errors 0) (0.00 ms)

Run in same dir, moved conf up to 'build' dir...
java -jar ./build/JsTestDriver-1.0b.jar --config ./build/test-all.yml --
tests all
java.lang.NullPointerException

What is the expected output? What do you see instead?
Expected success, returned "java.lang.NullPointerException"

What version of the product are you using? On what operating system?
JsTestDriver-1.0b, winxp w/ cygwin

Original issue reported on code.google.com by lamberta on 19 Jun 2009 at 11:12

Additional hooks for test fixture

Hi, 

I am currently evaluating JS-Test-Driver. 

Similar to JUnit 4, I miss setup and teardown methods which are executed 
just once at the beginning and end of a single TestCase (see JUnit4 
@BeforeClass and @AfterClass annotations). Is it planned to add such a 
feature in JS-Test-Driver as well? 

The JS tests I am going to write needs a special bootstrap script in the 
html header. Apart of this, the tests expect a certain DOM tree, i.e. 
ideally I would also be able to define the body content and special header 
content for the tests as fixture. Is there a way how I can do this?  

(Right now, I have to write a setup method which creates a frame in which 
I have full control. There I and can setup the environment with scripts 
etc as needed. If this is the way to go, there should be a setup method 
which is only executed once for a TestCase.)

Best regards,
 Timo

Original issue reported on code.google.com by [email protected] on 1 Oct 2009 at 2:25

errors

Hi!

There's several errors I've found in a day of fiddling with the jstd.

The first was in the eclipse plugin, which died in a nullpointerexception
if a path specified in the config file is not valid. (This is an error on
console too, it shouldn't care if it can't include anything from the
specified path, or it's non-existent)

The second and bigger problem is the assertion of complex structures
(arrays, objects)

expected
{"elements":[{"id":"","innerHTML":"Aladar"},{"id":"","innerHTML":"Bela"},{"id":"
","innerHTML":"Cecil"}]}
but was
{"elements":[{"id":"","innerHTML":"Aladar"},{"id":"","innerHTML":"Bela"},{"id":"
","innerHTML":"Cecil"}]}

All this @HEAD.

Best wishes:
Meza ( @vsbmeza )


Original issue reported on code.google.com by [email protected] on 30 Aug 2009 at 1:25

No way to exclude library code from the coverage plugin

What steps will reproduce the problem?

* If you require a Javascript library for your code (e.g. jquery)
* When you use the coverage plugin
* It calculates code coverage for the library
* But there are no tests for the library, and never will be

* We should be able to exclude files from the coverage plugin

What is the expected output? What do you see instead?

I would expect to see only coverage for those files I write.


What version of the product are you using? On what operating system?

Using coverage-1.1.jar

Original issue reported on code.google.com by [email protected] on 1 Oct 2009 at 9:01

QUnitAdapter.js does not handle setup/teardown functions properly

Using a svn checkout, QUnitAdapter improperly assigns setUp and tearDown 
to undefined if they were not set in the module() call from your QUnit call. 
This upsets js-test-driver as it seems to expect some form of callable for 
tearDown() no matter what.

The attached patch makes assigning to setUp and tearDown optional based on 
whether the user actually passed them in.

Original issue reported on code.google.com by bcannon on 19 Aug 2009 at 12:21

Attachments:

NPE on instrumentation.

What steps will reproduce the problem?
1. Had a working version of JSTestDriver and code. Copied the coverage jar 
file to plugins directory and included the following in the conf file:

plugin:
- name: "coverage"
  jar: "plugins/coverage-1.1a.jar"
  module: "com.google.jstestdriver.coverage.CoverageModule"

2. Run JsTestDriver using the following command after successfully 
capturing a browser:

java -jar jstestdriver-1.1.jar --tests all --testOutput c:\jstestdriver

3. Exception occurred.

What is the expected output? What do you see instead?
Expected to see test coverage report in directory; but got the following 
exception instead:

NoClassDefFoundError: com/google/jstestdriver/hooks/ActionListProcessor

What version of the product are you using? On what operating system?
JsTestDriver 1.1
Coverage 1.1a
IE 6

Please provide any additional information below.
I checked JsTestDriver.jar and could not find the class that it was 
looking for (ActionListProcessor).

Original issue reported on code.google.com by [email protected] on 19 Oct 2009 at 4:28

Tests are cached in Opera once and never change

What steps will reproduce the problem?
1. Start test server
2. Capture an Opera browser
3. Run tests, observe result
4. Add a new test, or cause a test to begin passing or failing
5. Run tests, observe that the result for Opera is unchanged from step 3, 
though Chrome, Safari 
and Firefox do reflect the change

What version of the product are you using? On what operating system?
JsTestDriver revision 108
Opera Version 9.64 Build 5270
Mac OS X version 10.5.7

Please provide any additional information below.

This problem isn't quite completely reproducible. However I'm seeing rather 
consistently, I'd say 
9 times out of 10.

Original issue reported on code.google.com by [email protected] on 15 Jul 2009 at 2:35

Tests ignored silently if file has syntax error

What steps will reproduce the problem?
1. Create a test with a syntax error
2. Run tests


What is the expected output? What do you see instead?
At this point I would expect an error message because of the syntax error. 
Instead, some tests are completely ignored. I'm not sure if it ignores the 
testcase file with the syntax error, or all tests that would normally be 
run after the testcase with the error in it.

What version of the product are you using? On what operating system?
JsTestDriver 1.0b 
Windows XP
JRE 1.6.0_10-b33

Original issue reported on code.google.com by jani.hartikainen on 13 Aug 2009 at 9:32

Runner.js throws "a is undefined" message when doing bad assert

What steps will reproduce the problem?

BugTest= TestCase("BugTest");

BugTest.prototype.testbug = function(){
    assertEquals(true,undefined);
};

Running the code above throws the error 

"a is undefined"

Tracked it down to Asserts.js 

expectAsserts = function(count){
  jstestdriver.expectedAssertCount = count;
};

when this is called, count is undefined. 

Didnt have time to search it down further sorry!

What is the expected output? What do you see instead?
More meaningful message

What version of the product are you using? On what operating system?
Eclipse 1.0.6 on Vista x64
Running against Firefox

Please provide any additional information below.

Original issue reported on code.google.com by [email protected] on 5 Oct 2009 at 7:55

A wrong path in conf file throws NullPointerException

What steps will reproduce the problem?
1. Modify conf file to include a non-existent path
2. Run tests
3. Observe exception output on console

What is the expected output? What do you see instead?

I would excpect an error saying the following path is incorrect
"file://...". Instead I get just an error without any explanation. Even a
stack trace would be better.

What version of the product are you using? On what operating system?

JsTestDriver: 1.0b
OS: Mac OSX 10.5.8
Java: 1.6

Please provide any additional information below.

I was using the continuous build setup on save within eclipse, getting the
output to the eclipse console view. 

Original issue reported on code.google.com by [email protected] on 13 Aug 2009 at 12:13

Config file needs to know absolute location of coverage plugin jar

To use the coverage plugin you need to add the following to your
jsTestDriver.conf:

plugin:
  - name: "coverage"
    jar: "c:/absolute/path/to/js-test-driver/plugins/coverage-1.1.jar"
    module: "com.google.jstestdriver.coverage.CoverageModule"


This is frustrating because you need the absolute path to the JS Test
Driver jar install. This means the same config cannot be shared between
operating systems.

Or you can give a path relative to the config file, but this means you
cannot move your config file, or install of JS Test Driver without breaking
the link.

How about the 'jar:' specifier be changed so that you can give a path
relative the JsTestDriver jar. 

That way config files can easily be shared across operating systems and the
config files are no longer tied to the exact location of the JS Test Driver
install.

Original issue reported on code.google.com by [email protected] on 1 Oct 2009 at 9:12

$(document).add("div") does not work (cannot append child to dom)

What steps will reproduce the problem?
1. create a test that looks like:

TestCase("TestWithDom", {
    setUp: function() {
        $(document).add("div").attr("id","foo");
    },

    test: function() {
        expectAsserts(1);
        $("#foo").each(function(e){
            assertEquals("foo", e.attr("id"));
        });
    }
});

What is the expected output? What do you see instead?

I'd think it would be possible to add a div programatically but this test
does not pass.  Note that this is just one example, I've tried creating dom
elements in every way I can think of.  Am I missing one way that works?  

What is this mysterious document object in the context of a test?
console.log(document) dumps the history of the universe to my console.  

I tried to read the JsTestDriver code but there is a lot of abstraction of
the JS runtime environment and I could not understand what the document
object is while tests are running.

Really what I'm trying to test are a set of functions that trigger custom
dom events like $("#somewhere).trigger("shazam", []); To set up a test like
this I want to create a div with the id "somewhere."  Any ideas? 


What version of the product are you using? On what operating system?


Please provide any additional information below.


Original issue reported on code.google.com by kumar.mcmillan on 29 May 2009 at 2:31

Better error report formatting in the JsTD view

Currently, an error looks like this:

Message : {"stack":"AssertError\n    at
http://localhost:9999/slave/1/runner.js:1:85\n    at [object
Object].testInit
(http://localhost:9999/test//Users/corysmith/repos/trunk/JsTestDriver/src-test/c
om/google/jstestdriver/coverage/javascript/LCOVTest.js:4:2)\n
   at [object Object].runTest_
(http://localhost:9999/slave/1/runner.js:244:29)\n    at [object
Object].runTestConfiguration
(http://localhost:9999/slave/1/runner.js:213:20)\n    at [object
Object].runTestConfiguration
(http://localhost:9999/slave/1/runner.js:308:25)\n    at [object
Object].dispatch_ (http://localhost:9999/slave/1/runner.js:1:5813)\n    at
[object Object].runTestConfiguration
(http://localhost:9999/slave/1/runner.js:1:6224)\n    at [object
Object].runTestConfiguration_
(http://localhost:9999/slave/1/runner.js:1:12239)\n    at [object
Object].runTests (http://localhost:9999/slave/1/runner.js:1:12039)\n    at
[object Object].runTestCases_
(http://localhost:9999/slave/1/runner.js:1:18971)","name":"AssertError"}
Log : 


It would be highly improved if it looked like this:

AssertError
   at http://localhost:9999/slave/1/runner.js:1:85
   at [object Object].testInit
(http://localhost:9999/test//Users/corysmith/repos/trunk/JsTestDriver/src-test/c
om/google/jstestdriver/coverage/javascript/LCOVTest.js:4:2)
   at [object Object].runTest_ (http://localhost:9999/slave/1/runner.js:244:29)
   at [object Object].runTestConfiguration
(http://localhost:9999/slave/1/runner.js:213:20)
   at [object Object].runTestConfiguration
(http://localhost:9999/slave/1/runner.js:308:25)
   at [object Object].dispatch_
(http://localhost:9999/slave/1/runner.js:1:5813)
   at [object Object].runTestConfiguration
(http://localhost:9999/slave/1/runner.js:1:6224)
   at [object Object].runTestConfiguration_
(http://localhost:9999/slave/1/runner.js:1:12239)
   at [object Object].runTests
(http://localhost:9999/slave/1/runner.js:1:12039)
   at [object Object].runTestCases_
(http://localhost:9999/slave/1/runner.js:1:18971)

Log : 

Original issue reported on code.google.com by [email protected] on 17 Aug 2009 at 6:54

JsTD view doesn't clear the console on a successful run.

1. Start the JsTD server and slave a browser or two.
2. Write a failing test
3. View the reason for failure by clicking on a browser it failed in.
4. Fix the test
5. Run the test again.
6. Notice that the error message persists, even when clicking a browser of
a passed test.

Original issue reported on code.google.com by [email protected] on 17 Aug 2009 at 7:07

$(document).ready(fn) does not fire (jquery compatibility problem)

What steps will reproduce the problem?
1. create a tmp folder, copy in jquery-1.3.1.js
2. create a file named test_docready.js that looks like:

TestCase("TestDocready", {

    test_docready: function() {
        expectAsserts(1);
        var counter = 0;
        $(document).ready(function(){
            counter += 1;
        });
        $(document).ready(function(){
            assertEquals(counter, 1);
        });
    }

});

3. create a conf that looks like:

server: http://localhost:4224

load:
    - jquery*.js
    - test*.js

4. start the server as normal : java -jar ~/src/JsTestDriver-1.0b.jar
--port 4224 --captureConsole 
5. Open some browsers to http://127.0.0.1:4224/capture
6. Run the tests as you would normally: java -jar
~/src/JsTestDriver-1.0b.jar --tests all 

What is the expected output? What do you see instead?

I'd think that $(document).ready(fn) would fire like normal but instead the
tests fail, indicating that ready(fn) never fires:

FF
Total 2 tests (Passed: 0; Fails: 2; Errors: 0) (2.00 ms)
  Safari 525.28.3: Run 1 tests (Passed: 0; Fails: 1; Errors 0) (0.00 ms)
    TestDocready.test_docready failed (0.00 ms): Expected '1' asserts but
'0' encountered.
  Firefox 1.9.0.10: Run 1 tests (Passed: 0; Fails: 1; Errors 0) (2.00 ms)
    TestDocready.test_docready failed (2.00 ms): Expected '1' asserts but
'0' encountered.

*However* if I swap out jquery-1.3.1.js for jquery-1.2.6.js then the test
passes in Safari only:

.F
Total 2 tests (Passed: 1; Fails: 1; Errors: 0) (1.00 ms)
  Safari 525.28.3: Run 1 tests (Passed: 1; Fails: 0; Errors 0) (1.00 ms)
  Firefox 1.9.0.10: Run 1 tests (Passed: 0; Fails: 1; Errors 0) (1.00 ms)
    TestDocready.test_docready failed (1.00 ms): Expected '1' asserts but
'0' encountered.

What version of the product are you using? On what operating system?


Please provide any additional information below.

If you know of a workaround (maybe manually triggering jquery's ready
functions?) then let me know because I can't think of another way to use
js-test-driver to test jquery code.

Original issue reported on code.google.com by kumar.mcmillan on 27 May 2009 at 2:36

Globbed files are not loaded in alphabetical order

What steps will reproduce the problem?

1. create a directory "scripts"
2. create files 0.js through 100.js in "scripts"
3. add this content to each file, where N is the number in its filename: 
object${N+1} = 
object$N+1 (e.g. for 0 you'd have object1 = object0 + 1)
2. in a level above "scripts", create init.js with this: object0 = 0
3. create a config file like so:
    server: http://localhost:4224/

    load:
      - init.js
      - scripts/*.js

What is the expected output? What do you see instead?

It should run with no errors, but on a file system / OS that doesn't always 
return files in 
alphabetical order the 2nd load directive, the glob, may require things out of 
order, causing an 
error to occur (since in this example all subsequent files depend on the 
previous ones).

What version of the product are you using? On what operating system?

Revision 67 on Ubuntu Linux.
Please provide any additional information below.

Original issue reported on code.google.com by [email protected] on 9 Jun 2009 at 5:04

Attachments:

Relative paths containing '..' will not be loaded correctly

What steps will reproduce the problem?
1. In JsTestDriver.conf add a relative path containing .. eg ../../src/*.js
to a test
2. Run the the test driver

What is the expected output? What do you see instead?
1 tests are run - 0 tests are run

What version of the product are you using? On what operating system?
R67 (latest on 5 june) on Windows

Please provide any additional information below.
The problem seem to be with the way src files are normalized in the
ConfigurationParser. I fixed the problem on my machine by adding a
getCanonicalPath() to resolve the ".."'s


Original issue reported on code.google.com by [email protected] on 5 Jun 2009 at 7:41

java.lang.NullPointerException when config file is not in the working directory

What steps will reproduce the problem?
1. run java -jar JsTestDriver-1.0b.jar --config mytests/js-tests.yaml
--tests all

What is the expected output? What do you see instead?

I'd expect an error message saying "this config file must be in the working
directory" instead I see java.lang.NullPointerException without any
traceback.  I was pretty confused by this but after lots of trial and error.

What version of the product are you using? On what operating system?


Please provide any additional information below.

I really like the concepts behind js-test-driver, thanks for open sourcing
this.

Original issue reported on code.google.com by [email protected] on 27 May 2009 at 4:21

Better machine readable output

I've got a couple of tools I use to automatically run my tests every time I 
save a file and report the 
results as an unobtrusive notification.  I love jsTestDriver because I can 
finally test my js like I do 
everything else, but the output isn't very conducive for testing.  

At minimum, it would be nice if it returned an error code other than 0 on 
failure.  Ideally it would 
have the option for stdout to be a machine readable representation of the test 
results.  JSON is 
ideal, but XML would do fine.  

Finding the output file, noticing that it has changed and then reading is 
kindof a pain and makes it 
more difficult than it needs to be to deliver a good experience to the tester. 

Original issue reported on code.google.com by [email protected] on 1 Jul 2009 at 6:00

JsTestdriverEclipse plugin does not update when it loses a browser

What steps will reproduce the problem?
1. Open the JsTD view
2. Start the server
3. slave the firefox browser
4. close the browser

What is the expected output? What do you see instead?
The firefox icon goes back to gray indicating a lost browser.

What I saw was no change.



Original issue reported on code.google.com by [email protected] on 17 Aug 2009 at 6:41

documentation for --browser option is inaccurate (or misleading?)

It's not clear to me what paths the --browser option accepts.  It says a
path to a browser but on Mac, --browser /Applications/Firefox.app does not
work.  I saw in the screencast that on mac to use --browser open but this
only works for Safari.  --browser 'open -A Firefox' does not seem to do
anything.  

Could you provide some examples to the documentation for the --browser option?

thanks, Kumar

Original issue reported on code.google.com by kumar.mcmillan on 27 May 2009 at 4:50

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.