|
View:
New views
8 Messages
—
Rating Filter:
Alert me
|
|
|
[1.02] ReferenceError: "navigator" running tests in RhinoI'm trying to run the core dojo tests with java -jar custom_rhino.jar runner.js, but it fails with:
js: uncaught JavaScript runtime exception: ReferenceError: "navigator" is not defined. The same works in browser and with an older version of dojo ( 0.9). runner.html doesn't seem require any other dependencies, but obviously the navigator object is created by the browser. The custom_rhino.jar is from 0.9 (the latest in trunk looks corrupted). If I create a fake navigator object myself in dojo.js, I get further along. Any ideas how to fix this? Kalle _______________________________________________ FAQ: http://dojotoolkit.org/support/faq Book: http://dojotoolkit.org/docs/book Forums: http://dojotoolkit.org/forum Dojo-interest@... http://dojotoolkit.org/mailman/listinfo/dojo-interest |
|
|
Re: [1.02] ReferenceError: "navigator" running tests in RhinoOn Dec 18, 2007 8:41 AM, Kalle Korhonen <kalle.o.korhonen@...> wrote:
> I'm trying to run the core dojo tests with java -jar custom_rhino.jar > runner.js, but it fails with: > js: uncaught JavaScript runtime exception: ReferenceError: "navigator" is > not defined. The same works in browser and with an older version of dojo ( > 0.9). runner.html doesn't seem require any other dependencies, but obviously > the navigator object is created by the browser. The custom_rhino.jar is from > 0.9 (the latest in trunk looks corrupted). If I create a fake navigator > object myself in dojo.js, I get further along. Any ideas how to fix this? I just downloaded the 1.0.2 source, and ran this command from the util/doh directory: > java -jar ../shrinksafe/custom_rhino.jar runner.js and that seemed to complete without a "navigator" error. James _______________________________________________ FAQ: http://dojotoolkit.org/support/faq Book: http://dojotoolkit.org/docs/book Forums: http://dojotoolkit.org/forum Dojo-interest@... http://dojotoolkit.org/mailman/listinfo/dojo-interest |
|
|
Re: [1.02] ReferenceError: "navigator" running tests in RhinoWell, what do you know, that's exactly true: I checked out the tag for 1.0.2 and running the tests in rhino does work! Then I searched for "navigator" in dojo.js and I found no references. However, if I get the zipped up release from
http://download.dojotoolkit.org/release-1.0.2/ and open dojo.js, I found multiple references. So, I wonder what's going on? Is this some special build of the same source or just completely different versions?
Furthermore, making the navigator object exist alone doesn't solve the whole browser emulation problem. I found no references in the documentation as to how and where it's done in Dojo and its DOH framework; only the one liner " When run from the command line, only pure-JS test are run" in http://dojotoolkit.org/book/dojo-book-0-9/part-4-meta-dojo/d-o-h-unit-testing. However, running from against the sources of 1.0.2 tag, it seems all 326 tests were run. Crosscheck (http://www.thefrontside.net/crosscheck) seems to do a better job at explaining the browser testing issues and explicitly supporting multiple different browser emulation environment. From the dojo documentation, it's really not clear to me whether or not I can expect pure Javascript/Dojo tests to succeed in non-browser environments and whether DOH supports emulating any parts of browser environment or not. Kalle On 12/22/07, James Burke <jburke@...> wrote: On Dec 18, 2007 8:41 AM, Kalle Korhonen <kalle.o.korhonen@...> wrote: _______________________________________________ FAQ: http://dojotoolkit.org/support/faq Book: http://dojotoolkit.org/docs/book Forums: http://dojotoolkit.org/forum Dojo-interest@... http://dojotoolkit.org/mailman/listinfo/dojo-interest |
|
|
Re: [1.02] ReferenceError: "navigator" running tests in RhinoThe built version that you get from the 1.0.2 download location (not
the -src file) is built for the browser, and not for rhino. Running that version with rhino and DOH can produce the "navigator" issue. Dojo can be run in the browser or in rhino, but the built versions we put on the website are only for running in the browser. We do not support auto-detection of the environment in the built version to cut down on the size of dojo.js and the vast majority of users only care about the browser version. So, for running in rhino, you will need to get the -src download or grab the source from subversion. DOH does not provide a simulation of the browser environment in rhino. Instead, it runs directly in a browser. If you go to the tests directory in each major project (like dojo or dijit), you should see a runTests.html. Open that in the browser of your choice, and DOH will run the tests in that browser. The tests that run in rhino are the non-browser tests (normally the pure JS tests). There may be a reporting issue with the number of tests (I have not confirmed how it calculates the numbers or how it reports what tests are run), but while it does use the same master test file for Dojo core (dojo/tests/module.js), some tests are excluded by checking to see if dojo.isBrowser is true. It will be false for the rhino case, so those tests will be skipped. Also note that while it looks like some tests in dojo/tests/module.js seem to be included for the rhino enviroment, if you look inside the specific tests being dojo.required, they may do the dojo.isBrowser check within that test file. James On Dec 23, 2007 10:47 PM, Kalle Korhonen <kalle.o.korhonen@...> wrote: > Well, what do you know, that's exactly true: I checked out the tag for 1.0.2 > and running the tests in rhino does work! Then I searched for "navigator" in > dojo.js and I found no references. However, if I get the zipped up release > from http://download.dojotoolkit.org/release-1.0.2/ and open dojo.js, I > found multiple references. So, I wonder what's going on? Is this some > special build of the same source or just completely different versions? > > Furthermore, making the navigator object exist alone doesn't solve the whole > browser emulation problem. I found no references in the documentation as to > how and where it's done in Dojo and its DOH framework; only the one liner " > When run from the command line, only pure-JS test are run" in > http://dojotoolkit.org/book/dojo-book-0-9/part-4-meta-dojo/d-o-h-unit-testing. > However, running from against the sources of 1.0.2 tag, it seems all 326 > tests were run. Crosscheck (http://www.thefrontside.net/crosscheck) seems to > do a better job at explaining the browser testing issues and explicitly > supporting multiple different browser emulation environment. > > From the dojo documentation, it's really not clear to me whether or not I > can expect pure Javascript/Dojo tests to succeed in non-browser environments > and whether DOH supports emulating any parts of browser environment or not. > > Kalle > > > > > On 12/22/07, James Burke <jburke@...> wrote: > > > > > > > > On Dec 18, 2007 8:41 AM, Kalle Korhonen <kalle.o.korhonen@...> > wrote: > > > I'm trying to run the core dojo tests with java -jar custom_rhino.jar > > > runner.js , but it fails with: > > > js: uncaught JavaScript runtime exception: ReferenceError: "navigator" > is > > > not defined. The same works in browser and with an older version of dojo > ( > > > 0.9). runner.html doesn't seem require any other dependencies, but > obviously > > > the navigator object is created by the browser. The custom_rhino.jar is > from > > > 0.9 (the latest in trunk looks corrupted). If I create a fake navigator > > > object myself in dojo.js, I get further along. Any ideas how to fix > this? > > > > I just downloaded the 1.0.2 source, and ran this command from the > > util/doh directory: > > > java -jar ../shrinksafe/custom_rhino.jar runner.js > > > > and that seemed to complete without a "navigator" error. > > > > James > > _______________________________________________ > > FAQ: http://dojotoolkit.org/support/faq > > Book: http://dojotoolkit.org/docs/book > > Forums: http://dojotoolkit.org/forum > > Dojo-interest@... > > http://dojotoolkit.org/mailman/listinfo/dojo-interest > > > > > _______________________________________________ > FAQ: http://dojotoolkit.org/support/faq > Book: http://dojotoolkit.org/docs/book > Forums: http://dojotoolkit.org/forum > Dojo-interest@... > http://dojotoolkit.org/mailman/listinfo/dojo-interest > > FAQ: http://dojotoolkit.org/support/faq Book: http://dojotoolkit.org/docs/book Forums: http://dojotoolkit.org/forum Dojo-interest@... http://dojotoolkit.org/mailman/listinfo/dojo-interest |
|
|
Re: [1.02] ReferenceError: "navigator" running tests in RhinoOn 12/24/07, James Burke <jburke@...> wrote:
The built version that you get from the 1.0.2 download location (not Thanks a lot James for your answers, this is really helpful. Quickly looking at the build.xml, I didn't see a target that would specifically "build for the browser" and I couldn't find any documentation about it. What target should I run to create this version? And why is it needed - wasn't one of the design goals of dojo 1.0 to target purely a browser environment? Dojo can be run in the browser or in rhino, but the built versions we It'd be good to document this at http://dojotoolkit.org/book/dojo-book-0-9/part-4-meta-dojo/d-o-h-unit-testing (or presumably upcoming dojo-book-1-0). DOH does not provide a simulation of the browser environment in rhino. Yes, certainly I've done this. But for continuous integration, there's certainly value in being able to run the tests from command-line, even if they consists largely of visual tests. It gives you some protection against regression errors and catches newly introduced run-time errors. My interest in this is to evaluate DOH's suitability for testing our own Javascript code that uses dojo. But it seems DOH is geared towards testing dijit and dojo-based widgets rather than for general-purpose testing framework. And that there's a fair bit of work to do if you want to integrate DOH with larger build systems following continuous integration principles. The tests that run in rhino are the non-browser tests (normally the Ok, so that seems to be what's happening. And it doesn't really say which tests are run, just "GROUP XXX has 10 tests to run" and in the end, the number of all tests and if there were any errors in them, but nothing about how many tests were actually run. In rhino, it also completes much quicker than in browser via the runTests.html which implies most of the tests were skipped in the former. Crosscheck, which I mentioned previously, seems to be about the only browser-emulation environment for Javascript testing. Have you or anybody at or affiliated with the dojo team considered using it instead of DOH or possibly merging the two? Kalle On Dec 23, 2007 10:47 PM, Kalle Korhonen <kalle.o.korhonen@...> wrote: _______________________________________________ FAQ: http://dojotoolkit.org/support/faq Book: http://dojotoolkit.org/docs/book Forums: http://dojotoolkit.org/forum Dojo-interest@... http://dojotoolkit.org/mailman/listinfo/dojo-interest |
|
|
Re: [1.02] ReferenceError: "navigator" running tests in RhinoOn Dec 27, 2007 9:34 AM, Kalle Korhonen <kalle.o.korhonen@...> wrote:
> On 12/24/07, James Burke <jburke@...> wrote: > > > The built version that you get from the 1.0.2 download location (not > > the -src file) is built for the browser, and not for rhino. Running > > that version with rhino and DOH can produce the "navigator" issue. > > > Thanks a lot James for your answers, this is really helpful. Quickly looking > at the build.xml, I didn't see a target that would specifically "build for > the browser" and I couldn't find any documentation about it. What target > should I run to create this version? And why is it needed - wasn't one of > the design goals of dojo 1.0 to target purely a browser environment? The default behavior of the build system is to build for the browser. Looking more at it now, the build system has code in it to build a rhino-specific build, but that build process fails right now. So usage in rhino right now means just using a source distribution. I filed this trac bug for doing a build for the rhino environment (I just fixed it in the repository trunk): http://trac.dojotoolkit.org/ticket/5467 See that ticket for an example profile file that makes a build for the rhino environment (requires the latest trunk code to work). > > Dojo can be run in the browser or in rhino, but the built versions we > > put on the website are only for running in the browser. We do not > > support auto-detection of the environment in the built version to cut > > down on the size of dojo.js and the vast majority of users only care > > about the browser version. So, for running in rhino, you will need to > > get the -src download or grab the source from subversion. > > It'd be good to document this at > http://dojotoolkit.org/book/dojo-book-0-9/part-4-meta-dojo/d-o-h-unit-testing > (or presumably upcoming dojo-book-1-0). I put a note near the Rhino testing section about using a source distribution when running DOH in Rhino. > > DOH does not provide a simulation of the browser environment in rhino. > > Instead, it runs directly in a browser. If you go to the tests > > directory in each major project (like dojo or dijit), you should see a > > runTests.html. Open that in the browser of your choice, and DOH will > > run the tests in that browser. > > Yes, certainly I've done this. But for continuous integration, there's > certainly value in being able to run the tests from command-line, even if > they consists largely of visual tests. It gives you some protection against > regression errors and catches newly introduced run-time errors. My interest > in this is to evaluate DOH's suitability for testing our own Javascript code > that uses dojo. But it seems DOH is geared towards testing dijit and > dojo-based widgets rather than for general-purpose testing framework. And > that there's a fair bit of work to do if you want to integrate DOH with > larger build systems following continuous integration principles. Yes, if you want something that can be triggered from the command line and catch the results on the command line, then DOH is not designed for that purpose. I find that this is an area that is lacking for browser development, but it is also a tricky problem since each browser engine has different quirks. > > The tests that run in rhino are the non-browser tests (normally the > > pure JS tests). There may be a reporting issue with the number of > > tests (I have not confirmed how it calculates the numbers or how it > > reports what tests are run), but while it does use the same master > > test file for Dojo core (dojo/tests/module.js), some tests are > > excluded by checking to see if dojo.isBrowser is true. It will be > > false for the rhino case, so those tests will be skipped. Also note > > that while it looks like some tests in dojo/tests/module.js seem to be > > included for the rhino enviroment, if you look inside the specific > > tests being dojo.required, they may do the dojo.isBrowser check within > > that test file. > > Ok, so that seems to be what's happening. And it doesn't really say which > tests are run, just "GROUP XXX has 10 tests to run" and in the end, the > number of all tests and if there were any errors in them, but nothing about > how many tests were actually run. In rhino, it also completes much quicker > than in browser via the runTests.html which implies most of the tests were > skipped in the former. > > Crosscheck, which I mentioned previously, seems to be about the only > browser-emulation environment for Javascript testing. Have you or anybody at > or affiliated with the dojo team considered using it instead of DOH or > possibly merging the two? I believe it is more important that we can prove the Dojo code runs correctly in each browser engine, and trying to rely on an emulation framework will always be suboptimal, since that emulation framework cannot capture all of the nuances of each browser engine, and it will usually lag behind the actual browser engine development (case in point, Crosscheck only advertises being able to test against IE 6, Firefox 1.0 and 1.5). I would like to see a command-line version of a testing tool, but I expect it to take a form of running the real browser engine, putting hooks in that engine to collect test results, and then relay those results to the command line. That would be neat if someone built that, but it would require a specific wrapper for each browser engine (probably in C/C++), and to get full test coverage, you would need to run it on multiple operating systems (since IE 6 for example does not run on linux or OS X). James _______________________________________________ FAQ: http://dojotoolkit.org/support/faq Book: http://dojotoolkit.org/docs/book Forums: http://dojotoolkit.org/forum Dojo-interest@... http://dojotoolkit.org/mailman/listinfo/dojo-interest |
|
|
Re: [1.02] ReferenceError: "navigator" running tests in RhinoOn 28/12/2007, James Burke <jburke@...> wrote:
I would like to see a command-line version of a testing tool, but I Selenium RC [1] does this (also distributed) but we'd need to transform the results of DOH into selenium results - which i suspect wouldn't be too tricky since it can access the DOM and JS context. Normally Selenium-RC is invoked from a unittest script in another language (java, python, etc) and 'remote controls' the browser. With DOH we could just tell the browser to load the page, DOH would run, then we just interrogate the page for the results. There's now a rhino library for selenium-rc so we don't need to involved another language. In rhino, we'd have to:
Rob :) _______________________________________________ FAQ: http://dojotoolkit.org/support/faq Book: http://dojotoolkit.org/docs/book Forums: http://dojotoolkit.org/forum Dojo-interest@... http://dojotoolkit.org/mailman/listinfo/dojo-interest |
|
|
Re: [1.02] ReferenceError: "navigator" running tests in RhinoOn 02/01/2008, Robert Coup <rcoup@...> wrote:
> > /me is off to have a play with the rhino selenium driver okay, results of my initial playing are written up at: http://rob.coup.net.nz/2008/01/automated-dojo-testing-doh-selenium-rc.html basically i got the dojo test runner kicked off via a js config file, run the dojo core tests on a bunch of machines & browsers via selenium, and pull the pass/fail results together. next step is to pull some more useful information together (eg. which specific tests passed and failed...) comments are welcome Rob :) _______________________________________________ FAQ: http://dojotoolkit.org/support/faq Book: http://dojotoolkit.org/docs/book Forums: http://dojotoolkit.org/forum Dojo-interest@... http://dojotoolkit.org/mailman/listinfo/dojo-interest |
| Free Forum Powered by Nabble | Forum Help |