How to debug ember-cli tests running in phantomjs

后端 未结 4 597
不知归路
不知归路 2021-02-01 17:55

Context: I have an acceptance test for my ember-cli application, and the test passes just fine in Chrome. However, in phantomjs, my test fails -- the UI doesn\'t get created the

相关标签:
4条回答
  • 2021-02-01 18:39

    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

    0 讨论(0)
  • 2021-02-01 18:43

    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

    0 讨论(0)
  • 2021-02-01 18:56

    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.

    0 讨论(0)
  • 2021-02-01 19:01

    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)

    0 讨论(0)
提交回复
热议问题