nikseras / js-test-driver

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

HtmlDoc appending script tag to body fails in IE8 #364

Open GoogleCodeExporter opened 8 years ago

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

When using the HtmlDoc feature to append a script tag to the body, the tag is 
not appended in IE8.

I have created a jstd test (script-tag.js attached)

TestScriptTag = TestCase('test script tag')

TestScriptTag.prototype.test_failing_in_IE = function () {
    /*:DOC += <script id='test' type='text/yaml'></script> */
    assertNotNull(document.getElementById('test'));
}

TestScriptTag.prototype.test_working_in_IE = function () {
    var body = document.getElementsByTagName('body').item(0);
    var script = document.createElement('script');
    script.setAttribute('id', 'test');
    script.setAttribute('type', 'text/yaml');
    body.appendChild(script);
    assertNotNull(document.getElementById('test'));
}

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

When running jstd with the configuration attached in verbose mode I get

Microsoft Internet Explorer 8.0 Windows [FAILED] test script 
tag.test_failing_in_IE
Microsoft Internet Explorer 8.0 Windows [PASSED] test script 
tag.test_working_in_IE
Total 2 tests (Passed: 1; Fails: 1; Errors: 0) (1.00 ms)
  Microsoft Internet Explorer 8.0 Windows: Run 2 tests (Passed: 1; Fails: 1; Errors 0) (1.00 ms)
    test script tag.test_failing_in_IE failed (0.00 ms): AssertError: expected not null but was null

I was "expecting" both tests to pass.

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

Running the server on an Ubuntu 11.10 box using JSTD 1.3.4.b, the Windows slave 
is a Win7 box running out of the box IE8.

Please provide any additional information below.
------------------------------------------------

See 
http://groups.google.com/group/js-test-driver/browse_thread/thread/47bf182ce8705
1a6 for context

Original issue reported on code.google.com by eugene.v...@gmail.com on 17 Apr 2012 at 11:57

Attachments:

GoogleCodeExporter commented 8 years ago
Attached a patch that fixes the defect (with its test)

java -jar target/bin/JsTestDriver.jar --server http://localhost:9876 --tests 
HtmlDocTest
setting runnermode QUIET
........................
Total 24 tests (Passed: 24; Fails: 0; Errors: 0) (3.00 ms)
  Opera 11.62 Windows: Run 3 tests (Passed: 3; Fails: 0; Errors 0) (1.00 ms)
  Microsoft Internet Explorer 8.0 Windows: Run 3 tests (Passed: 3; Fails: 0; Errors 0) (3.00 ms)
  Firefox 11.0 Windows: Run 3 tests (Passed: 3; Fails: 0; Errors 0) (2.00 ms)
  Chrome 18.0.1025.162 Windows: Run 3 tests (Passed: 3; Fails: 0; Errors 0) (2.00 ms)
  Firefox 11.0 Linux: Run 3 tests (Passed: 3; Fails: 0; Errors 0) (2.00 ms)
  Safari 534.55.3 Windows: Run 3 tests (Passed: 3; Fails: 0; Errors 0) (0.00 ms)
  Opera 11.62 Linux: Run 3 tests (Passed: 3; Fails: 0; Errors 0) (1.00 ms)
  Chrome 18.0.1025.151 Linux: Run 3 tests (Passed: 3; Fails: 0; Errors 0) (1.00 ms)

Original comment by eugene.v...@gmail.com on 18 Apr 2012 at 4:40

Attachments: