alexschwantes / testcafe-reporter-junit

This is the xUnit reporter plugin for TestCafe.
https://devexpress.github.io/testcafe/
MIT License
3 stars 4 forks source link

[help required] How to generate XML file #5

Closed vishallanke closed 3 years ago

vishallanke commented 3 years ago

After executing testcafe chrome 'examples/client-scripts' --reporter junit command, Ican see that XML is printed on console. But, it is not generating XML file on hard drive. Any idea ?

testcafe chrome 'examples/element-properties' --reporter junit
Using locally installed version of TestCafe.
<?xml version="1.0" encoding="UTF-8" ?>
<testsuite name="TestCafe Tests: Chrome 86.0.4240.198 / Windows 10" tests="1" failures="1" skipped="0" errors="1" time="71.302" timestamp="Sun, 13 Dec 2020 15:22:14 GMT" >
  <testcase classname="Element properties" name="Check an element&#39;s markup" time="71.238">
    <failure>
    <![CDATA[
      1) Cannot obtain information about the node because the specified selector does not match any node in the DOM tree.

          > | Selector('label[for]')

         Browser: Chrome 86.0.4240.198 / Windows 10

             6 |test("Check an element's markup", async t => {
             7 |    const selector = Selector('label[for]').addCustomDOMProperties({
             8 |        outerHTML: el => el.outerHTML
             9 |    });
            10 |
          > 11 |    const elementOuterHTML = await selector().outerHTML;
            12 |
            13 |    await t.expect(elementOuterHTML).eql('<label for="remote-testing"><input type="checkbox" name="remote" id="remote-testing" data-testid="remote-testing-checkbox">Support for testing on remote devices</label>');
            14 |});
            15 |

            at <anonymous> (D:\Personal\Knowledge\TestCafe\testcafe-examples\examples\element-properties\check-element-markup.js:11:36)
            at <anonymous> (D:\Personal\Knowledge\TestCafe\testcafe-examples\examples\element-properties\check-element-markup.js:6:1)

      2) A request to "https://devexpress.github.io/testcafe/example/" has failed.
         Use quarantine mode to perform additional attempts to execute this test.
         You can find troubleshooting information for this issue at "https://go.devexpress.com/TestCafe_FAQ_ARequestHasFailed.aspx".

         Error details:
         Failed to complete a request to "https://devexpress.github.io/testcafe/example/" within the timeout period. The problem may be related to local machine's network or firewall settings, server outage, or network problems that make the server inaccessible.

         Browser: Chrome 86.0.4240.198 / Windows 10
    ]]>
    </failure>
  </testcase>
</testsuite>
alexschwantes commented 3 years ago

Hi, you can follow the instructions from testcafe https://devexpress.github.io/testcafe/documentation/reference/command-line-interface.html#-r-nameoutput---reporter-nameoutput

Essentially add the filename you want it written to on the command line:

testcafe chrome 'examples/client-scripts' --reporter junit:report.xml