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

Crashes on Android instrumentation report #13

Open
bartekpacia opened this issue Aug 14, 2023 · 0 comments
Open

Crashes on Android instrumentation report #13

bartekpacia opened this issue Aug 14, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@bartekpacia
Copy link

I've got the following XML:

<?xml version='1.0' encoding='UTF-8' ?>
<testsuite name="pl.leancode.patrol.example.MainActivityTest" tests="7" failures="0" errors="0" skipped="0" time="83.293" timestamp="2023-08-14T13:30:25" hostname="localhost">
  <properties>
    <property name="device" value="Pixel_6_API_33(AVD) - 13" />
    <property name="flavor" value="" />
    <property name="project" value=":app" />
  </properties>
  <testcase name="runDartTest[permissions.notifications_test taps on notification]" classname="pl.leancode.patrol.example.MainActivityTest" time="14.363" />
  <testcase name="runDartTest[permissions.permissions_location_test accepts location permission]" classname="pl.leancode.patrol.example.MainActivityTest" time="22.246" />
  <testcase name="runDartTest[permissions.permissions_many_test grants various permissions]" classname="pl.leancode.patrol.example.MainActivityTest" time="14.848" />
  <testcase name="runDartTest[example_test top level group in file alpha first]" classname="pl.leancode.patrol.example.MainActivityTest" time="4.092" />
  <testcase name="runDartTest[example_test top level group in file alpha second]" classname="pl.leancode.patrol.example.MainActivityTest" time="4.49" />
  <testcase name="runDartTest[example_test top level group in file bravo first]" classname="pl.leancode.patrol.example.MainActivityTest" time="4.133" />
  <testcase name="runDartTest[example_test top level group in file bravo second]" classname="pl.leancode.patrol.example.MainActivityTest" time="4.022" />
</testsuite>

I tried to use this package on it but it crashes:

$ junit-cli-report-viewer build/app/outputs/androidTest-results/connected/TEST-Pixel_6_API_33\(AVD\)\ -\ 13-_app-.xml
file:///Users/bartek/.n/lib/node_modules/junit-cli-report-viewer/index.js:40
  if (!result.testsuites.$) {
                         ^

TypeError: Cannot read properties of undefined (reading '$')
    at file:///Users/bartek/.n/lib/node_modules/junit-cli-report-viewer/index.js:40:26
    at Parser.<anonymous> (/Users/bartek/.n/lib/node_modules/junit-cli-report-viewer/node_modules/xml2js/lib/parser.js:318:18)
    at Parser.emit (node:events:514:28)
    at SAXParser.onclosetag (/Users/bartek/.n/lib/node_modules/junit-cli-report-viewer/node_modules/xml2js/lib/parser.js:276:26)
    at emit (/Users/bartek/.n/lib/node_modules/junit-cli-report-viewer/node_modules/sax/lib/sax.js:624:35)
    at emitNode (/Users/bartek/.n/lib/node_modules/junit-cli-report-viewer/node_modules/sax/lib/sax.js:629:5)
    at closeTag (/Users/bartek/.n/lib/node_modules/junit-cli-report-viewer/node_modules/sax/lib/sax.js:889:7)
    at SAXParser.write (/Users/bartek/.n/lib/node_modules/junit-cli-report-viewer/node_modules/sax/lib/sax.js:1436:13)
    at exports.Parser.Parser.parseString (/Users/bartek/.n/lib/node_modules/junit-cli-report-viewer/node_modules/xml2js/lib/parser.js:337:31)
    at Parser.parseString (/Users/bartek/.n/lib/node_modules/junit-cli-report-viewer/node_modules/xml2js/lib/parser.js:5:59)
Emitted 'error' event on Parser instance at:
    at exports.Parser.Parser.parseString (/Users/bartek/.n/lib/node_modules/junit-cli-report-viewer/node_modules/xml2js/lib/parser.js:341:16)
    at Parser.parseString (/Users/bartek/.n/lib/node_modules/junit-cli-report-viewer/node_modules/xml2js/lib/parser.js:5:59)
    at exports.parseString (/Users/bartek/.n/lib/node_modules/junit-cli-report-viewer/node_modules/xml2js/lib/parser.js:383:19)
    at file:///Users/bartek/.n/lib/node_modules/junit-cli-report-viewer/index.js:35:13
    at ModuleJob.run (node:internal/modules/esm/module_job:194:25)

Node.js v18.17.0

Thank you for it anyway. It looks pretty good.

@amalfra amalfra added the bug Something isn't working label Nov 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants