winkingzhang / idea-run-wdio

The WebdriverIO Plugin is going to be your brilliant ideas to run test cases over @wdio/cli.
Apache License 2.0
5 stars 1 forks source link

How to show test suites hierarchy in the results panel #51

Open scipilot opened 10 months ago

scipilot commented 10 months ago

Thanks for making this plugin - it's great to be able to click the run/debug buttons next to the tests at last! I've missed that so much since working with Webdriver. I just installed the plugin on a project with a lot of tests and it worked straight away.

The only thing missing is there is nothing listed in the test-suite hierarchy view in the results panel (neither run or debug) which normally lists the tests in the describe/it tree, with green/red ticks and crosses etc. I only see "Instantiated tests..." while the test runs, then when the tests finish it has a red "Test framework quit unexpectedly" though the test passed and exited normally.

Is this part supposed to work or has it not been implemented yet?

If it is supposed to be working, do you know why it might not be functioning in my project?

I'm using PhpStorm 2023.1 - Build #PS-231.8109.199, built on March 30, 2023

"@wdio/cli": "^8.11.1",
"@wdio/local-runner": "^8.11.1",
"@wdio/mocha-framework": "^8.11.0",

image

image

Normally it would look something like this (different project): image

scipilot commented 10 months ago

After doing some more research I gather that the test runner needs to send ##teamcity messages which would get caught by the IDE to populate the tree.

I tried using the Teamcity reporter from https://webdriver.io/docs/wdio-teamcity-reporter and although it does emit the messages into the console output, the tree didn't get populated. I am suspicious that as WDIO adds the [0-0] prefix to all the messages and this might prevent the IDE recognising them?

I also found some implementations which send the messages such as https://github.com/JetBrains/intellij-community/blob/master/plugins/junit5_rt/src/com/intellij/junit5/JUnit5TestExecutionListener.java and https://github.com/zio/zio-test-intellij/blob/master/src/shared/src/main/scala/zio/intellij/testsupport/ZTestRunner.scala

and this post is asking the same question and while there is a lack of direct answer (where is the documentation for implementing these messages!), he seems to manage to implement it by trial and error in the end. https://intellij-support.jetbrains.com/hc/en-us/community/posts/360006574859-Custom-testing-framework-Showing-tests-in-console?page=1#community_comment_360000946660

I don't have the plugin development SDK and environment setup but I think this is the right track.