Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The console of iframes is not printed on the command line #1373

Closed
ghost opened this issue Apr 14, 2015 · 2 comments
Closed

The console of iframes is not printed on the command line #1373

ghost opened this issue Apr 14, 2015 · 2 comments

Comments

@ghost
Copy link

ghost commented Apr 14, 2015

Here is a small test that illustrates the problem.

This is the output of the command line:

WARN [karma]: Port 9876 in use
INFO [karma]: Karma v0.12.31 server started at http://localhost:9877/
INFO [launcher]: Starting browser Safari
INFO [launcher]: Starting browser Firefox
INFO [launcher]: Starting browser Chrome
INFO [Firefox 37.0.0 (Mac OS X 10.10)]: Connected on socket bYlZenP4N4gvK5rj1a4D with id 14819077
INFO [Safari 8.0.5 (Mac OS X 10.10.3)]: Connected on socket KVxHjtic4VMkKl171a4C with id 69586727
INFO [Chrome 41.0.2272 (Mac OS X 10.10.3)]: Connected on socket JUOIFWPM4P3o8Kuh1a4E with id 29479825
Firefox 37.0.0 (Mac OS X 10.10) LOG: 'Create iframe'
Chrome 41.0.2272 (Mac OS X 10.10.3) LOG: 'DOMContentLoaded'
Chrome 41.0.2272 (Mac OS X 10.10.3) LOG: 'init'
Chrome 41.0.2272 (Mac OS X 10.10.3) LOG: 'Create iframe'
Firefox 37.0.0 (Mac OS X 10.10) LOG: 'test dynamically loaded iframe'
Chrome 41.0.2272 (Mac OS X 10.10.3) LOG: 'test dynamically loaded iframe'
Firefox 37.0.0 (Mac OS X 10.10) LOG: 'test to trigger event'
Chrome 41.0.2272 (Mac OS X 10.10.3) LOG: 'test to trigger event'
Safari 8.0.5 (Mac OS X 10.10.3) LOG: 'Create iframe'
Safari 8.0.5 (Mac OS X 10.10.3) LOG: 'test dynamically loaded iframe'
Safari 8.0.5 (Mac OS X 10.10.3) LOG: 'test to trigger event'
Safari 8.0.5 (Mac OS X 10.10.3): Executed 2 of 2 SUCCESS (4.887 secs / 1.997 secs)
Firefox 37.0.0 (Mac OS X 10.10): Executed 2 of 2 SUCCESS (0.222 secs / 0.21 secs)
Chrome 41.0.2272 (Mac OS X 10.10.3): Executed 2 of 2 SUCCESS (0.223 secs / 0.209 secs)
TOTAL: 6 SUCCESS

This is the console output of the debug tool:

"Create iframe" test.js:6:4
En iframe som har både allow-scripts och allow-same-origin för sitt sandbox-attribut kan ta bort sin sandboxning. debug.html
Teckenkodningen för ett ramdokument var inte deklarerad. Dokumentet kan se annorlunda ut om det visas utan dokumentet som innehöll ramen. frame.html
"DOMContentLoaded" frame.html:18:6
"init" frame.html:11:6
"test dynamically loaded iframe" test.js:20:6
"SUCCESS iframes and events: test dynamically loaded iframe" debug.html:35:0
"test to trigger event" test.js:34:6
"SUCCESS iframes and events: test to trigger event" debug.html:35:0
"init" frame.html:11:6
"CLICK EVENT" frame.html:13:8
"CLICK IN FRAME" frame.html:1:0
"Skipped 0 tests" debug.html:25:8

Perhaps not a major problem if you are aware of this. But I was quite confused until I understood the problem. It would be great if it's possible to fix. Thank's for a good testing tool!

@maksimr
Copy link
Contributor

maksimr commented Apr 14, 2015

@colmsjo Thanks!

But karma more tool to unit testing not for e2e testing.
In your case you can remap console from iframe like:

document.getElementById('frame').contentWindow.console = console;

this should fix problem

@ghost
Copy link
Author

ghost commented Apr 14, 2015

Yes, that fixed it! Thank's.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant