HaroonBadsha / js-test-driver

Automatically exported from code.google.com/p/js-test-driver
0 stars 0 forks source link

Problems with Script inclusion in Firefox 9+ #334

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

Unfortunately, I could not find a trivial setup to reproduce the problem, but 
from the point of an outside observer, it seems that the Javascript files 
configured in JsTestDriver.com are loaded asynchronously by Firefox 9+ 
(everything works fine in Firefox 8). 

We experience the problem when we include the QUnitAdapter. It asserts that the 
function window.equiv is set. window.equiv is set by equiv.js immediately when 
the script is loaded and the asseration in QUnitAdapter.js is done the same 
way. equiv.js is included in JsTestDriver.conf before QUnitAdapter.js. When we 
updated to Firefox 9 (same behavior in 10.0), then the assertion in 
QUnitAdapter.js fails (window.equiv is not set). When I add console log 
statements to equiv.js and QUnitAdapter.js, then the log output of equiv.js 
appears much (seconds!) later, then the log output of QUnitAdapter.js. 

We include quite a large number of Javascript files in our test environment 
(~300 files). When I reduce the set of files, then the issue appears randomly 
(but almost always) for different situation where script order is important 
(e.g. when importing popular libraries, such as d3).

Everything works fine on Chrome, Safari, Firefox 8.

What version of the product are you using? On what operating system?
Firefox 9, Firefox 10 (Mac, Win)

Original issue reported on code.google.com by peter.ri...@gmx.net on 9 Feb 2012 at 7:36

GoogleCodeExporter commented 8 years ago
I'll look into it. It sounds like firefox is reporting the script load 
completion too early. (Love browser bugs...)

In the meantime, and especially because you have so many scripts, use the 
--preloadFiles flag. It will write the script tags into the captured runner, in 
order. So far, I haven't found any bugs in that setup.

Original comment by corbinrs...@gmail.com on 9 Feb 2012 at 10:41

GoogleCodeExporter commented 8 years ago
In the meantime this issue appears in all major browser (we tested with Chrome 
and it also appears in Chrome since the last automatic update was done ...). 

--preloadFiles does NOT solve the issue

However, I've found out that the issue only appears when the --reset flag is 
used. We need to use this flag because of the structure of our application. If 
the --reset flag is not used, then the execution runs as expected. However, we 
need to restart the server each time before we execute any tests, which 
actually is equal to a blocker for us!

Original comment by peter.ri...@gmx.net on 16 May 2012 at 3:13

GoogleCodeExporter commented 8 years ago
Interesting. Look at the page source after running a reset. Are the script tags 
in the right order?

I haven't been able to reproduce.

Original comment by corbinrs...@gmail.com on 16 May 2012 at 3:17

GoogleCodeExporter commented 8 years ago
Inclusion of CSS files in the JsTestDriver.conf seems to cause the problem. 
When I remove all references to CSS files in the JsTestDriver.conf file, then 
--reset can be used.

Original comment by peter.ri...@gmx.net on 16 May 2012 at 3:36