How to debug ember-cli tests running in phantomjs

浪子不回头ぞ 提交于 2019-12-02 19:03:08

You can expose PhantomJS debug port and open it in browser then you can interact with context at your debugger breakpoints.

Debugging tests on PhantomJS using Testem test runner

In testem.json add "phantomjs_debug_port": 9000.

While you run your tests visit http://localhost:9000 in your browser and click the long link that shows up.

Source: cssugared

I had no luck with the other answers, so here's what I found out:

Add a return pauseTest(); at the point in your test where you want to be able to interact with the container in the browser. This is in the docs but I'm not sure it's in the guides.

To answer the part of my original question about "how do I get log messages to show up", if I use the TAP reporter, then console.log (in my app and in my tests) messages show up in the output; the xunit reporter doesn't pass console.log on, which was confusing me.

(I've also hit issues where running the tests on teamcity behaves differently than running locally; in that situation, combining the TAP reporter with https://github.com/aghassemi/tap-xunit (or the TAP teamcity plugin) lets me get log messages and also test counts)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!