Giter Site home page Giter Site logo

zaqqaz / jest-allure Goto Github PK

View Code? Open in Web Editor NEW
112.0 8.0 38.0 141 KB

Generate Allure Report for jest. Allure Report, a flexible lightweight multi-language test report tool with the possibility to add steps, attachments, parameters and so on.

License: MIT License

TypeScript 100.00%
jest jest-reporter reporting tests allure-report allure

jest-allure's Introduction

๐Ÿ‘‹ Hey there!

I'm Denis
Head of Engineering at DAZN
public speaker and open source contributor
based in London ๐Ÿ‡ฌ๐Ÿ‡ง.

๐Ÿ“น Some of my talks:

Nice to meet you!

jest-allure's People

Contributors

bogomya avatar dependabot[bot] avatar doochik avatar rostrovsky avatar zaqqaz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jest-allure's Issues

Allure-results folder is empty on jenkins.

I am using jest-allure in my project. On my local machine i can see the allure-results folder have .xml files for the run but when i run the same code on jenkins (where i have create a folder name allure-results in my root dir) i see the .xml files are not created for the test run. Can you please help with this?
Using "jest-allure": "^0.1.1",

PDF report with html like links

Hello Team,

This looks amazing project.. Thanks for it.

Is there any feature planned to convert this html report to pdf format.?
It would be great addition

Thanks
Abhijeet

TypeError: Cannot set property 'currentTest' of undefined

When running jest with jest-allure installed, I often receive the above error. This did not use to happen, before using jest-allure.

Extended error message:

UserPreferences โ€บ can create an instance of the model from an arbitrary mock

TypeError: Cannot set property 'currentTest' of undefined

  at Allure.Object.<anonymous>.Allure.startCase (node_modules/allure-js-commons/index.js:44:23)
  at JasmineAllureReporter.specStarted (node_modules/jest-allure/dist/setup.js:24:21)

Package versions:

"jest": "^24.9.0",
"jest-allure": "^0.1.1",

Jest config (in package.json):

  "jest": {
    "collectCoverage": true,
    "coverageDirectory": "coverage",
    "preset": "jest-expo",
    "reporters": [
      "default"
    ],
    "setupFilesAfterEnv": [
      "jest-allure/dist/setup"
    ]
  }

I added a few console logs in jest-aalure/dist/setup.js:

FAIL models/tests/UserPreferences.test.js (98.219s)
โ— Console

console.error node_modules/jest-allure/dist/setup.js:23
  specStarted = skip NeedMock dummy
console.error node_modules/jest-allure/dist/setup.js:14
  startSuite = UserPreferences
console.error node_modules/jest-allure/dist/setup.js:23
  specStarted = can create an instance of the model from an arbitrary mock

It seems that startSuite is being called after specStarted, which would explain why Allure.startCase cannot find the suite. Any idea why this would be happening?

How to set the resultsDir ?

Hi, is there any way to replace resultsDir?

I'm using this configuration on my package.json, and I don't know how to set the resultsDir here:

"jest": {
    "reporters": [
      "default"
    ],
    "setupFilesAfterEnv": [
      "jest-allure/dist/setup"
    ]
  },

I would like to save the result files in another directory.

addAttachment of xml works, but there are Fatal Error in Allure Serve

i have a xml file
i read with node.js fs module

let fattura_in_xml = fs.readFileSync(downloadPath+"/"+filename, "utf8")

so i use addAttachment to attach to the report

reporter.addAttachment("Xml Scaricato", fattura_in_xml, "application/xml");

and it works,

image

but

allure serve

gives this fatal error


C:\src\e2e>allure serve
Generating report to temp directory...
[Fatal Error] 24573229-ec89-4d25-940d-1de66351eba7-attachment.xml:1:1: Il contenuto non รž consentito nel prologo.
Could not parse file allure-results\24573229-ec89-4d25-940d-1de66351eba7-attachment.xml: {}
org.xml.sax.SAXParseException; systemId: file:/C:/src/e2e/allure-results/24573229-ec89-4d25-940d-1de66351eba7-attachment.xml; lineNumber: 1; columnNumber: 1; Il contenuto non รž consentito nel prologo.
        at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(Unknown Source)
        at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(Unknown Source)
        at javax.xml.parsers.DocumentBuilder.parse(Unknown Source)
        at io.qameta.allure.junitxml.JunitXmlPlugin.parseRootElement(JunitXmlPlugin.java:134)
        at io.qameta.allure.junitxml.JunitXmlPlugin.lambda$readResults$0(JunitXmlPlugin.java:124)
        at java.util.ArrayList.forEach(Unknown Source)
        at io.qameta.allure.junitxml.JunitXmlPlugin.readResults(JunitXmlPlugin.java:124)
        at io.qameta.allure.ReportGenerator.lambda$readResults$0(ReportGenerator.java:47)
        at java.util.ArrayList.forEach(Unknown Source)
        at io.qameta.allure.ReportGenerator.readResults(ReportGenerator.java:47)
        at java.util.stream.ReferencePipeline$3$1.accept(Unknown Source)
        at java.util.stream.ReferencePipeline$2$1.accept(Unknown Source)
        at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(Unknown Source)
        at java.util.stream.AbstractPipeline.copyInto(Unknown Source)
        at java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)
        at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(Unknown Source)
        at java.util.stream.AbstractPipeline.evaluate(Unknown Source)
        at java.util.stream.ReferencePipeline.collect(Unknown Source)
        at io.qameta.allure.ReportGenerator.generate(ReportGenerator.java:69)
        at io.qameta.allure.ReportGenerator.generate(ReportGenerator.java:58)
        at io.qameta.allure.Commands.generate(Commands.java:105)
        at io.qameta.allure.Commands.serve(Commands.java:130)
        at io.qameta.allure.CommandLine.run(CommandLine.java:159)
        at java.util.Optional.orElseGet(Unknown Source)
        at io.qameta.allure.CommandLine.main(CommandLine.java:88)
[Fatal Error] 94f08a2f-f2f9-4048-bd23-f16011bd1ca7-attachment.xml:1:1: Il contenuto non รž consentito nel prologo.
Could not parse file allure-results\94f08a2f-f2f9-4048-bd23-f16011bd1ca7-attachment.xml: {}
org.xml.sax.SAXParseException; systemId: file:/C:/src/e2e/allure-results/94f08a2f-f2f9-4048-bd23-f16011bd1ca7-attachment.xml; lineNumber: 1; columnNumber: 1; Il contenuto non รž consentito nel prologo.
        at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(Unknown Source)
        at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(Unknown Source)
        at javax.xml.parsers.DocumentBuilder.parse(Unknown Source)
        at io.qameta.allure.junitxml.JunitXmlPlugin.parseRootElement(JunitXmlPlugin.java:134)
        at io.qameta.allure.junitxml.JunitXmlPlugin.lambda$readResults$0(JunitXmlPlugin.java:124)
        at java.util.ArrayList.forEach(Unknown Source)
        at io.qameta.allure.junitxml.JunitXmlPlugin.readResults(JunitXmlPlugin.java:124)
        at io.qameta.allure.ReportGenerator.lambda$readResults$0(ReportGenerator.java:47)
        at java.util.ArrayList.forEach(Unknown Source)
        at io.qameta.allure.ReportGenerator.readResults(ReportGenerator.java:47)
        at java.util.stream.ReferencePipeline$3$1.accept(Unknown Source)
        at java.util.stream.ReferencePipeline$2$1.accept(Unknown Source)
        at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(Unknown Source)
        at java.util.stream.AbstractPipeline.copyInto(Unknown Source)
        at java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)
        at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(Unknown Source)
        at java.util.stream.AbstractPipeline.evaluate(Unknown Source)
        at java.util.stream.ReferencePipeline.collect(Unknown Source)
        at io.qameta.allure.ReportGenerator.generate(ReportGenerator.java:69)
        at io.qameta.allure.ReportGenerator.generate(ReportGenerator.java:58)
        at io.qameta.allure.Commands.generate(Commands.java:105)
        at io.qameta.allure.Commands.serve(Commands.java:130)
        at io.qameta.allure.CommandLine.run(CommandLine.java:159)
        at java.util.Optional.orElseGet(Unknown Source)
        at io.qameta.allure.CommandLine.main(CommandLine.java:88)
[Fatal Error] 99bb7d03-4085-4758-a78d-6e65b923fbbf-attachment.xml:1:1: Il contenuto non รž consentito nel prologo.
Could not parse file allure-results\99bb7d03-4085-4758-a78d-6e65b923fbbf-attachment.xml: {}
org.xml.sax.SAXParseException; systemId: file:/C:/src/e2e/allure-results/99bb7d03-4085-4758-a78d-6e65b923fbbf-attachment.xml; lineNumber: 1; columnNumber: 1; Il contenuto non รž consentito nel prologo.
        at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(Unknown Source)
        at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(Unknown Source)
        at javax.xml.parsers.DocumentBuilder.parse(Unknown Source)
        at io.qameta.allure.junitxml.JunitXmlPlugin.parseRootElement(JunitXmlPlugin.java:134)
        at io.qameta.allure.junitxml.JunitXmlPlugin.lambda$readResults$0(JunitXmlPlugin.java:124)
        at java.util.ArrayList.forEach(Unknown Source)
        at io.qameta.allure.junitxml.JunitXmlPlugin.readResults(JunitXmlPlugin.java:124)
        at io.qameta.allure.ReportGenerator.lambda$readResults$0(ReportGenerator.java:47)
        at java.util.ArrayList.forEach(Unknown Source)
        at io.qameta.allure.ReportGenerator.readResults(ReportGenerator.java:47)
        at java.util.stream.ReferencePipeline$3$1.accept(Unknown Source)
        at java.util.stream.ReferencePipeline$2$1.accept(Unknown Source)
        at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(Unknown Source)
        at java.util.stream.AbstractPipeline.copyInto(Unknown Source)
        at java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)
        at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(Unknown Source)
        at java.util.stream.AbstractPipeline.evaluate(Unknown Source)
        at java.util.stream.ReferencePipeline.collect(Unknown Source)
        at io.qameta.allure.ReportGenerator.generate(ReportGenerator.java:69)
        at io.qameta.allure.ReportGenerator.generate(ReportGenerator.java:58)
        at io.qameta.allure.Commands.generate(Commands.java:105)
        at io.qameta.allure.Commands.serve(Commands.java:130)
        at io.qameta.allure.CommandLine.run(CommandLine.java:159)
        at java.util.Optional.orElseGet(Unknown Source)
        at io.qameta.allure.CommandLine.main(CommandLine.java:88)
[Fatal Error] b6216caf-13bd-4dbb-8701-887f29d6bac8-attachment.xml:1:1: Il contenuto non รž consentito nel prologo.
Could not parse file allure-results\b6216caf-13bd-4dbb-8701-887f29d6bac8-attachment.xml: {}
org.xml.sax.SAXParseException; systemId: file:/C:/src/e2e/allure-results/b6216caf-13bd-4dbb-8701-887f29d6bac8-attachment.xml; lineNumber: 1; columnNumber: 1; Il contenuto non รž consentito nel prologo.
        at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(Unknown Source)
        at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(Unknown Source)
        at javax.xml.parsers.DocumentBuilder.parse(Unknown Source)
        at io.qameta.allure.junitxml.JunitXmlPlugin.parseRootElement(JunitXmlPlugin.java:134)
        at io.qameta.allure.junitxml.JunitXmlPlugin.lambda$readResults$0(JunitXmlPlugin.java:124)
        at java.util.ArrayList.forEach(Unknown Source)
        at io.qameta.allure.junitxml.JunitXmlPlugin.readResults(JunitXmlPlugin.java:124)
        at io.qameta.allure.ReportGenerator.lambda$readResults$0(ReportGenerator.java:47)
        at java.util.ArrayList.forEach(Unknown Source)
        at io.qameta.allure.ReportGenerator.readResults(ReportGenerator.java:47)
        at java.util.stream.ReferencePipeline$3$1.accept(Unknown Source)
        at java.util.stream.ReferencePipeline$2$1.accept(Unknown Source)
        at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(Unknown Source)
        at java.util.stream.AbstractPipeline.copyInto(Unknown Source)
        at java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)
        at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(Unknown Source)
        at java.util.stream.AbstractPipeline.evaluate(Unknown Source)
        at java.util.stream.ReferencePipeline.collect(Unknown Source)
        at io.qameta.allure.ReportGenerator.generate(ReportGenerator.java:69)
        at io.qameta.allure.ReportGenerator.generate(ReportGenerator.java:58)
        at io.qameta.allure.Commands.generate(Commands.java:105)
        at io.qameta.allure.Commands.serve(Commands.java:130)
        at io.qameta.allure.CommandLine.run(CommandLine.java:159)
        at java.util.Optional.orElseGet(Unknown Source)
        at io.qameta.allure.CommandLine.main(CommandLine.java:88)
[Fatal Error] d9def69b-cf7e-473b-8414-6434b69ef9f1-attachment.xml:1:1: Il contenuto non รž consentito nel prologo.
Could not parse file allure-results\d9def69b-cf7e-473b-8414-6434b69ef9f1-attachment.xml: {}
org.xml.sax.SAXParseException; systemId: file:/C:/src/e2e/allure-results/d9def69b-cf7e-473b-8414-6434b69ef9f1-attachment.xml; lineNumber: 1; columnNumber: 1; Il contenuto non รž consentito nel prologo.
        at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(Unknown Source)
        at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(Unknown Source)
        at javax.xml.parsers.DocumentBuilder.parse(Unknown Source)
        at io.qameta.allure.junitxml.JunitXmlPlugin.parseRootElement(JunitXmlPlugin.java:134)
        at io.qameta.allure.junitxml.JunitXmlPlugin.lambda$readResults$0(JunitXmlPlugin.java:124)
        at java.util.ArrayList.forEach(Unknown Source)
        at io.qameta.allure.junitxml.JunitXmlPlugin.readResults(JunitXmlPlugin.java:124)
        at io.qameta.allure.ReportGenerator.lambda$readResults$0(ReportGenerator.java:47)
        at java.util.ArrayList.forEach(Unknown Source)
        at io.qameta.allure.ReportGenerator.readResults(ReportGenerator.java:47)
        at java.util.stream.ReferencePipeline$3$1.accept(Unknown Source)
        at java.util.stream.ReferencePipeline$2$1.accept(Unknown Source)
        at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(Unknown Source)
        at java.util.stream.AbstractPipeline.copyInto(Unknown Source)
        at java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)
        at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(Unknown Source)
        at java.util.stream.AbstractPipeline.evaluate(Unknown Source)
        at java.util.stream.ReferencePipeline.collect(Unknown Source)
        at io.qameta.allure.ReportGenerator.generate(ReportGenerator.java:69)
        at io.qameta.allure.ReportGenerator.generate(ReportGenerator.java:58)
        at io.qameta.allure.Commands.generate(Commands.java:105)
        at io.qameta.allure.Commands.serve(Commands.java:130)
        at io.qameta.allure.CommandLine.run(CommandLine.java:159)
        at java.util.Optional.orElseGet(Unknown Source)
        at io.qameta.allure.CommandLine.main(CommandLine.java:88)
[Fatal Error] e5daebab-df52-494a-b617-3ccee36450bb-attachment.xml:1:1: Il contenuto non รž consentito nel prologo.
Could not parse file allure-results\e5daebab-df52-494a-b617-3ccee36450bb-attachment.xml: {}
org.xml.sax.SAXParseException; systemId: file:/C:/src/e2e/allure-results/e5daebab-df52-494a-b617-3ccee36450bb-attachment.xml; lineNumber: 1; columnNumber: 1; Il contenuto non รž consentito nel prologo.
        at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(Unknown Source)
        at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(Unknown Source)
        at javax.xml.parsers.DocumentBuilder.parse(Unknown Source)
        at io.qameta.allure.junitxml.JunitXmlPlugin.parseRootElement(JunitXmlPlugin.java:134)
        at io.qameta.allure.junitxml.JunitXmlPlugin.lambda$readResults$0(JunitXmlPlugin.java:124)
        at java.util.ArrayList.forEach(Unknown Source)
        at io.qameta.allure.junitxml.JunitXmlPlugin.readResults(JunitXmlPlugin.java:124)
        at io.qameta.allure.ReportGenerator.lambda$readResults$0(ReportGenerator.java:47)
        at java.util.ArrayList.forEach(Unknown Source)
        at io.qameta.allure.ReportGenerator.readResults(ReportGenerator.java:47)
        at java.util.stream.ReferencePipeline$3$1.accept(Unknown Source)
        at java.util.stream.ReferencePipeline$2$1.accept(Unknown Source)
        at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(Unknown Source)
        at java.util.stream.AbstractPipeline.copyInto(Unknown Source)
        at java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)
        at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(Unknown Source)
        at java.util.stream.AbstractPipeline.evaluate(Unknown Source)
        at java.util.stream.ReferencePipeline.collect(Unknown Source)
        at io.qameta.allure.ReportGenerator.generate(ReportGenerator.java:69)
        at io.qameta.allure.ReportGenerator.generate(ReportGenerator.java:58)
        at io.qameta.allure.Commands.generate(Commands.java:105)
        at io.qameta.allure.Commands.serve(Commands.java:130)
        at io.qameta.allure.CommandLine.run(CommandLine.java:159)
        at java.util.Optional.orElseGet(Unknown Source)
        at io.qameta.allure.CommandLine.main(CommandLine.java:88)
[Fatal Error] 24573229-ec89-4d25-940d-1de66351eba7-attachment.xml:1:1: Il contenuto non รž consentito nel prologo.
Could not parse file allure-results\24573229-ec89-4d25-940d-1de66351eba7-attachment.xml: {}
org.xml.sax.SAXParseException; systemId: file:/C:/src/e2e/allure-results/24573229-ec89-4d25-940d-1de66351eba7-attachment.xml; lineNumber: 1; columnNumber: 1; Il contenuto non รž consentito nel prologo.
        at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(Unknown Source)
        at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(Unknown Source)
        at javax.xml.parsers.DocumentBuilder.parse(Unknown Source)
        at io.qameta.allure.xunitxml.XunitXmlPlugin.parseAssemblies(XunitXmlPlugin.java:98)
        at io.qameta.allure.xunitxml.XunitXmlPlugin.lambda$readResults$0(XunitXmlPlugin.java:90)
        at java.util.ArrayList.forEach(Unknown Source)
        at io.qameta.allure.xunitxml.XunitXmlPlugin.readResults(XunitXmlPlugin.java:90)
        at io.qameta.allure.ReportGenerator.lambda$readResults$0(ReportGenerator.java:47)
        at java.util.ArrayList.forEach(Unknown Source)
        at io.qameta.allure.ReportGenerator.readResults(ReportGenerator.java:47)
        at java.util.stream.ReferencePipeline$3$1.accept(Unknown Source)
        at java.util.stream.ReferencePipeline$2$1.accept(Unknown Source)
        at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(Unknown Source)
        at java.util.stream.AbstractPipeline.copyInto(Unknown Source)
        at java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)
        at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(Unknown Source)
        at java.util.stream.AbstractPipeline.evaluate(Unknown Source)
        at java.util.stream.ReferencePipeline.collect(Unknown Source)
        at io.qameta.allure.ReportGenerator.generate(ReportGenerator.java:69)
        at io.qameta.allure.ReportGenerator.generate(ReportGenerator.java:58)
        at io.qameta.allure.Commands.generate(Commands.java:105)
        at io.qameta.allure.Commands.serve(Commands.java:130)
        at io.qameta.allure.CommandLine.run(CommandLine.java:159)
        at java.util.Optional.orElseGet(Unknown Source)
        at io.qameta.allure.CommandLine.main(CommandLine.java:88)
[Fatal Error] 94f08a2f-f2f9-4048-bd23-f16011bd1ca7-attachment.xml:1:1: Il contenuto non รž consentito nel prologo.
Could not parse file allure-results\94f08a2f-f2f9-4048-bd23-f16011bd1ca7-attachment.xml: {}
org.xml.sax.SAXParseException; systemId: file:/C:/src/e2e/allure-results/94f08a2f-f2f9-4048-bd23-f16011bd1ca7-attachment.xml; lineNumber: 1; columnNumber: 1; Il contenuto non รž consentito nel prologo.
        at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(Unknown Source)
        at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(Unknown Source)
        at javax.xml.parsers.DocumentBuilder.parse(Unknown Source)
        at io.qameta.allure.xunitxml.XunitXmlPlugin.parseAssemblies(XunitXmlPlugin.java:98)
        at io.qameta.allure.xunitxml.XunitXmlPlugin.lambda$readResults$0(XunitXmlPlugin.java:90)
        at java.util.ArrayList.forEach(Unknown Source)
        at io.qameta.allure.xunitxml.XunitXmlPlugin.readResults(XunitXmlPlugin.java:90)
        at io.qameta.allure.ReportGenerator.lambda$readResults$0(ReportGenerator.java:47)
        at java.util.ArrayList.forEach(Unknown Source)
        at io.qameta.allure.ReportGenerator.readResults(ReportGenerator.java:47)
        at java.util.stream.ReferencePipeline$3$1.accept(Unknown Source)
        at java.util.stream.ReferencePipeline$2$1.accept(Unknown Source)
        at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(Unknown Source)
        at java.util.stream.AbstractPipeline.copyInto(Unknown Source)
        at java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)
        at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(Unknown Source)
        at java.util.stream.AbstractPipeline.evaluate(Unknown Source)
        at java.util.stream.ReferencePipeline.collect(Unknown Source)
        at io.qameta.allure.ReportGenerator.generate(ReportGenerator.java:69)
        at io.qameta.allure.ReportGenerator.generate(ReportGenerator.java:58)
        at io.qameta.allure.Commands.generate(Commands.java:105)
        at io.qameta.allure.Commands.serve(Commands.java:130)
        at io.qameta.allure.CommandLine.run(CommandLine.java:159)
        at java.util.Optional.orElseGet(Unknown Source)
        at io.qameta.allure.CommandLine.main(CommandLine.java:88)
[Fatal Error] 99bb7d03-4085-4758-a78d-6e65b923fbbf-attachment.xml:1:1: Il contenuto non รž consentito nel prologo.
Could not parse file allure-results\99bb7d03-4085-4758-a78d-6e65b923fbbf-attachment.xml: {}
org.xml.sax.SAXParseException; systemId: file:/C:/src/e2e/allure-results/99bb7d03-4085-4758-a78d-6e65b923fbbf-attachment.xml; lineNumber: 1; columnNumber: 1; Il contenuto non รž consentito nel prologo.
        at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(Unknown Source)
        at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(Unknown Source)
        at javax.xml.parsers.DocumentBuilder.parse(Unknown Source)
        at io.qameta.allure.xunitxml.XunitXmlPlugin.parseAssemblies(XunitXmlPlugin.java:98)
        at io.qameta.allure.xunitxml.XunitXmlPlugin.lambda$readResults$0(XunitXmlPlugin.java:90)
        at java.util.ArrayList.forEach(Unknown Source)
        at io.qameta.allure.xunitxml.XunitXmlPlugin.readResults(XunitXmlPlugin.java:90)
        at io.qameta.allure.ReportGenerator.lambda$readResults$0(ReportGenerator.java:47)
        at java.util.ArrayList.forEach(Unknown Source)
        at io.qameta.allure.ReportGenerator.readResults(ReportGenerator.java:47)
        at java.util.stream.ReferencePipeline$3$1.accept(Unknown Source)
        at java.util.stream.ReferencePipeline$2$1.accept(Unknown Source)
        at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(Unknown Source)
        at java.util.stream.AbstractPipeline.copyInto(Unknown Source)
        at java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)
        at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(Unknown Source)
        at java.util.stream.AbstractPipeline.evaluate(Unknown Source)
        at java.util.stream.ReferencePipeline.collect(Unknown Source)
        at io.qameta.allure.ReportGenerator.generate(ReportGenerator.java:69)
        at io.qameta.allure.ReportGenerator.generate(ReportGenerator.java:58)
        at io.qameta.allure.Commands.generate(Commands.java:105)
        at io.qameta.allure.Commands.serve(Commands.java:130)
        at io.qameta.allure.CommandLine.run(CommandLine.java:159)
        at java.util.Optional.orElseGet(Unknown Source)
        at io.qameta.allure.CommandLine.main(CommandLine.java:88)
[Fatal Error] b6216caf-13bd-4dbb-8701-887f29d6bac8-attachment.xml:1:1: Il contenuto non รž consentito nel prologo.
Could not parse file allure-results\b6216caf-13bd-4dbb-8701-887f29d6bac8-attachment.xml: {}
org.xml.sax.SAXParseException; systemId: file:/C:/src/e2e/allure-results/b6216caf-13bd-4dbb-8701-887f29d6bac8-attachment.xml; lineNumber: 1; columnNumber: 1; Il contenuto non รž consentito nel prologo.
        at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(Unknown Source)
        at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(Unknown Source)
        at javax.xml.parsers.DocumentBuilder.parse(Unknown Source)
        at io.qameta.allure.xunitxml.XunitXmlPlugin.parseAssemblies(XunitXmlPlugin.java:98)
        at io.qameta.allure.xunitxml.XunitXmlPlugin.lambda$readResults$0(XunitXmlPlugin.java:90)
        at java.util.ArrayList.forEach(Unknown Source)
        at io.qameta.allure.xunitxml.XunitXmlPlugin.readResults(XunitXmlPlugin.java:90)
        at io.qameta.allure.ReportGenerator.lambda$readResults$0(ReportGenerator.java:47)
        at java.util.ArrayList.forEach(Unknown Source)
        at io.qameta.allure.ReportGenerator.readResults(ReportGenerator.java:47)
        at java.util.stream.ReferencePipeline$3$1.accept(Unknown Source)
        at java.util.stream.ReferencePipeline$2$1.accept(Unknown Source)
        at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(Unknown Source)
        at java.util.stream.AbstractPipeline.copyInto(Unknown Source)
        at java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)
        at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(Unknown Source)
        at java.util.stream.AbstractPipeline.evaluate(Unknown Source)
        at java.util.stream.ReferencePipeline.collect(Unknown Source)
        at io.qameta.allure.ReportGenerator.generate(ReportGenerator.java:69)
        at io.qameta.allure.ReportGenerator.generate(ReportGenerator.java:58)
        at io.qameta.allure.Commands.generate(Commands.java:105)
        at io.qameta.allure.Commands.serve(Commands.java:130)
        at io.qameta.allure.CommandLine.run(CommandLine.java:159)
        at java.util.Optional.orElseGet(Unknown Source)
        at io.qameta.allure.CommandLine.main(CommandLine.java:88)
[Fatal Error] d9def69b-cf7e-473b-8414-6434b69ef9f1-attachment.xml:1:1: Il contenuto non รž consentito nel prologo.
Could not parse file allure-results\d9def69b-cf7e-473b-8414-6434b69ef9f1-attachment.xml: {}
org.xml.sax.SAXParseException; systemId: file:/C:/src/e2e/allure-results/d9def69b-cf7e-473b-8414-6434b69ef9f1-attachment.xml; lineNumber: 1; columnNumber: 1; Il contenuto non รž consentito nel prologo.
        at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(Unknown Source)
        at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(Unknown Source)
        at javax.xml.parsers.DocumentBuilder.parse(Unknown Source)
        at io.qameta.allure.xunitxml.XunitXmlPlugin.parseAssemblies(XunitXmlPlugin.java:98)
        at io.qameta.allure.xunitxml.XunitXmlPlugin.lambda$readResults$0(XunitXmlPlugin.java:90)
        at java.util.ArrayList.forEach(Unknown Source)
        at io.qameta.allure.xunitxml.XunitXmlPlugin.readResults(XunitXmlPlugin.java:90)
        at io.qameta.allure.ReportGenerator.lambda$readResults$0(ReportGenerator.java:47)
        at java.util.ArrayList.forEach(Unknown Source)
        at io.qameta.allure.ReportGenerator.readResults(ReportGenerator.java:47)
        at java.util.stream.ReferencePipeline$3$1.accept(Unknown Source)
        at java.util.stream.ReferencePipeline$2$1.accept(Unknown Source)
        at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(Unknown Source)
        at java.util.stream.AbstractPipeline.copyInto(Unknown Source)
        at java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)
        at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(Unknown Source)
        at java.util.stream.AbstractPipeline.evaluate(Unknown Source)
        at java.util.stream.ReferencePipeline.collect(Unknown Source)
        at io.qameta.allure.ReportGenerator.generate(ReportGenerator.java:69)
        at io.qameta.allure.ReportGenerator.generate(ReportGenerator.java:58)
        at io.qameta.allure.Commands.generate(Commands.java:105)
        at io.qameta.allure.Commands.serve(Commands.java:130)
        at io.qameta.allure.CommandLine.run(CommandLine.java:159)
        at java.util.Optional.orElseGet(Unknown Source)
        at io.qameta.allure.CommandLine.main(CommandLine.java:88)
[Fatal Error] e5daebab-df52-494a-b617-3ccee36450bb-attachment.xml:1:1: Il contenuto non รž consentito nel prologo.
Could not parse file allure-results\e5daebab-df52-494a-b617-3ccee36450bb-attachment.xml: {}
org.xml.sax.SAXParseException; systemId: file:/C:/src/e2e/allure-results/e5daebab-df52-494a-b617-3ccee36450bb-attachment.xml; lineNumber: 1; columnNumber: 1; Il contenuto non รž consentito nel prologo.
        at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(Unknown Source)
        at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(Unknown Source)
        at javax.xml.parsers.DocumentBuilder.parse(Unknown Source)
        at io.qameta.allure.xunitxml.XunitXmlPlugin.parseAssemblies(XunitXmlPlugin.java:98)
        at io.qameta.allure.xunitxml.XunitXmlPlugin.lambda$readResults$0(XunitXmlPlugin.java:90)
        at java.util.ArrayList.forEach(Unknown Source)
        at io.qameta.allure.xunitxml.XunitXmlPlugin.readResults(XunitXmlPlugin.java:90)
        at io.qameta.allure.ReportGenerator.lambda$readResults$0(ReportGenerator.java:47)
        at java.util.ArrayList.forEach(Unknown Source)
        at io.qameta.allure.ReportGenerator.readResults(ReportGenerator.java:47)
        at java.util.stream.ReferencePipeline$3$1.accept(Unknown Source)
        at java.util.stream.ReferencePipeline$2$1.accept(Unknown Source)
        at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(Unknown Source)
        at java.util.stream.AbstractPipeline.copyInto(Unknown Source)
        at java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)
        at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(Unknown Source)
        at java.util.stream.AbstractPipeline.evaluate(Unknown Source)
        at java.util.stream.ReferencePipeline.collect(Unknown Source)
        at io.qameta.allure.ReportGenerator.generate(ReportGenerator.java:69)
        at io.qameta.allure.ReportGenerator.generate(ReportGenerator.java:58)
        at io.qameta.allure.Commands.generate(Commands.java:105)
        at io.qameta.allure.Commands.serve(Commands.java:130)
        at io.qameta.allure.CommandLine.run(CommandLine.java:159)
        at java.util.Optional.orElseGet(Unknown Source)
        at io.qameta.allure.CommandLine.main(CommandLine.java:88)
Report successfully generated to C:\Users\ANDREA~1\AppData\Local\Temp\8702296355586944336\allure-report
Starting web server...
2019-11-05 15:04:29.539:INFO::main: Logging initialized @8928ms to org.eclipse.jetty.util.log.StdErrLog
Server started at <http://10.1.0.107:53091/>. Press <Ctrl+C> to exit

i don't know why there are some italian logs,

but " Il contenuto non รž consentito nel prologo." means " the content is not permitted in the prologue"

Unable to nest `describe` blocks correctly

When I write describe() within another describe() in order to create nested test suites, the title from one describe() gets concatenated with the title from the other describe(), and the test suites are displayed all in one level - no nesting.

const testMyFunc = (input) =>  describe(`with ${input}`, () => {
    it('blah', () => { /* ... */ });
    it('foo', () => { /* ... */ });
    it('bar', () => { /* ... */ });
  });

describe('myFunc', () => {
  ['1', '2', '3'].forEach(testMyFunc);
});

Within the generated Allure report, I have 3 separate myFunc top-level suites, but I only want 1.

I get something like this:
> myFunc with 1
  > blah
  > foo
  > bar
> myFunc with 2
  > blah
  > foo
  > bar
> myFunc with 3
  > blah
  > foo
  > bar

But I would like something like this (it works with other Allure reporters):
> myFunc
  > with 1
    > blah
    > foo
    > bar
  > with 2
    > blah
    > foo
    > bar
  > with 3
    > blah
    > foo
    > bar

I know this is possible with Allure, I have seen it work with other report generators. But I am having this issue specifically with jest-allure.

This similar issue was raised on the allure-js repo, but I think it may be more appropriate to file it here.

Blank page on allure serve/open command

I have been trying to figure out why the report which is being generated is blank when opened.
My version and configuration are as follows-
jest version- 27.0.1
jest allure version-0.1.3

jest.config.js
module.exports = {
setupFilesAfterEnv: ["jest-allure/dist/setup"],
testRunner : 'jest-jasmine2',
testMatch: ['**/*.test.js'],
testEnvironment: "node",
}

My test cases passes well and does generates allure-results folder and allure generate command generates allure report folder without any issue. But when I finally run allure serve /open command to see the report the page is simply blank. I can see some errors thrown in the console which I am sharing here-
allure report blank

I am not sure on what I am doing wrong in my config.

Your test suite must contain at least one test with setup script

I can't get this to work with latest stable jest (24.9.0).

If I use setupFilesAfterEnv or import 'jest-allure/dist/setup' manually, my tests do not run and jest detects 0 tests:

> jest

 FAIL  tests/main.ts
  โ— Test suite failed to run

    Your test suite must contain at least one test.

      at node_modules/@jest/core/build/TestScheduler.js:242:24
      at asyncGeneratorStep (node_modules/@jest/core/build/TestScheduler.js:131:24)
      at _next (node_modules/@jest/core/build/TestScheduler.js:151:9)
      at node_modules/@jest/core/build/TestScheduler.js:156:7
      at node_modules/@jest/core/build/TestScheduler.js:148:12
      at onResult (node_modules/@jest/core/build/TestScheduler.js:271:25)

----------|----------|----------|----------|----------|-------------------|
----------|----------|----------|----------|----------|-------------------|
All files |        0 |        0 |        0 |        0 |                   |
 main.ts  |        0 |      100 |        0 |        0 |... 12,13,15,17,21 |
 wait.ts  |        0 |        0 |        0 |        0 |         1,2,3,4,7 |
----------|----------|----------|----------|----------|-------------------|

If I comment them out, my tests pass.

I have tried putting the import at the end of my tests.

jest.config.js

module.exports = {
  clearMocks: true,
  moduleFileExtensions: ['ts', 'js'],
  testEnvironment: 'node',
  // testRunner: 'jest-circus/runner', // Not compatible with jest-allure
  transform: { '^.+\\.ts$': 'ts-jest' },
  collectCoverage: true,
  collectCoverageFrom: ['src/**/*.ts'],
  testRegex: '(/tests/[^/]+)\\.ts$',
  verbose: true,
  setupFilesAfterEnv: ['jest-allure/dist/setup'],
};

[Bug] java.lang.UnsupportedOperationException: The BROWSE action is not supported

Hello

I installed jest-allure and got the error with allure serve :

Exception in thread "main" java.lang.UnsupportedOperationException: The BROWSE action is not supported on the current platform!
	at java.desktop/java.awt.Desktop.checkActionSupport(Desktop.java:380)
	at java.desktop/java.awt.Desktop.browse(Desktop.java:524)
	at io.qameta.allure.Commands.openBrowser(Commands.java:228)
	at io.qameta.allure.Commands.open(Commands.java:153)
	at io.qameta.allure.Commands.serve(Commands.java:137)
	at io.qameta.allure.CommandLine.run(CommandLine.java:159)
	at java.base/java.util.Optional.orElseGet(Optional.java:369)
	at io.qameta.allure.CommandLine.main(CommandLine.java:88)

I am on Ubutu 18.04.3 LTS (x86-64)

jest 24.1 update

Hello everyone,
Since I updated to jest 24.1 I had the following error

ReferenceError: reporter is not defined
beforeEach(async () => {
reporter.startStep("Log in");
^
To fix this I add the following block to my jest.config.js
setupFilesAfterEnv: [ '<rootDir>/jasmine.config.js' ]
which contains the following code
import { registerAllureReporter } from "jest-allure/dist/setup";
registerAllureReporter();
But Now I'm having issue with the allure report, since one additional XML file is generated in allure-results.
Is it possible to remove the line 71 in setup.ts ?
registerAllureReporter();

jasmine is not defined after update to [email protected]

After update jest to latest version 27.0.3 i'm have next error

Test suite failed to run

    ReferenceError: jasmine is not defined

    at registerAllureReporter (node_modules/jest-allure/dist/setup.js:62:5)
    at Object.<anonymous> (node_modules/jest-allure/dist/setup.js:65:1)
jest.config.js

module.exports = {
    reporters: ["default", "jest-allure"],
    setupFilesAfterEnv: ["jest-allure/dist/setup"]
};

number of tests not matching

in my current project, jest default reporter and junit reporter both report 120 tests however, jest-allure only reports 90 tests. I am not sure what's the issue.

Latest publish does not include /dist folder

After npm installing the latest version of jest-allure, it no longer works. Looking at the package in the node_module directory reveals there is no /dist directory.

After running

the issue is resolved.

We should probably publish again, and ensure the build runs.

"allure generate" doesn't generate report can be used without a webserver

the cli command "allure generate" create a folder with some file,
but locally opening the index.html file,
you cannot see any report becauase of


Access to XMLHttpRequest at 'file:///C:/src/e2e/allure-report/widgets/summary.json' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https.
widgets/summary.json:1 Failed to load resource: net::ERR_FAILED
index.html:1 Access to XMLHttpRequest at 'file:///C:/src/e2e/allure-report/widgets/suites.json' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https.
widgets/suites.json:1 Failed to load resource: net::ERR_FAILED
index.html:1 Access to XMLHttpRequest at 'file:///C:/src/e2e/allure-report/widgets/environment.json' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https.
widgets/environment.json:1 Failed to load resource: net::ERR_FAILED
index.html:1 Access to XMLHttpRequest at 'file:///C:/src/e2e/allure-report/widgets/behaviors.json' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https.
widgets/behaviors.json:1 Failed to load resource: net::ERR_FAILED
index.html:1 Access to XMLHttpRequest at 'file:///C:/src/e2e/allure-report/widgets/history-trend.json' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https.
widgets/history-trend.json:1 Failed to load resource: net::ERR_FAILED
index.html:1 Access to XMLHttpRequest at 'file:///C:/src/e2e/allure-report/widgets/categories.json' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https.
widgets/categories.json:1 Failed to load resource: net::ERR_FAILED
index.html:1 Access to XMLHttpRequest at 'file:///C:/src/e2e/allure-report/widgets/executors.json' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https.
widgets/executors.json:1 Failed to load resource: net::ERR_FAILED

jasmine is not defined error coming up when we try to run script

ReferenceError: jasmine is not defined
at registerAllureReporter (/Users/xxxx/Projects/xxxx/xxxx/node_modules/jest-allure/dist/setup.js:46:5)

Steps followed:

  1. "jest": { "setupTestFrameworkScriptFile": "./func-test-jest.config.js" },
  2. just imported in global setup file const { registerAllureReporter } = require("jest-allure/dist/setup");

please advise.

Thanks
--vj

[feature request] Add 'it.concurrent' async support?

I am trying to use both concurrent and reporter methods, then it throws an exception
After some research, found out that the specStarted method executed after the async function.

so, I have to use concurrent without reporter invoked, or quit using concurrent.

Help needed, thanks

code example:

it.concurrent("create api", async () => {
    reporter.description("create api");

    reporter.startStep("check");
    expect(true).toBeTruthy();
    report.endStep();
});
    TypeError: Cannot read property 'currentTest' of undefined

      3 |
      4 | it.concurrent("create api", async () => {
    > 5 |     reporter.description("create api");
        |              ^
      6 |
      7 |     reporter.startStep("check");
      8 |     expect(true).toBeTruthy();

      at Allure.Object.<anonymous>.Allure.getCurrentTest (node_modules/allure-js-commons/index.js:25:34)
      at Allure.Object.<anonymous>.Allure.setDescription (node_modules/allure-js-commons/index.js:79:10)
      at Reporter.description (node_modules/jest-allure/dist/Reporter.js:24:21)

ReferenceError: reporter is not defined

When I execute my test I get the below error
ReferenceError: reporter is not defined

I am new to js and couldn't figure out the solution in my own.
My package.json is as follows

{
"name": "voiceiqqawebjs",
"version": "1.0.0",
"description": "Gui Automation Framework for Voice IQ",
"main": "index.js",
"author": "VoiceIQ",
"license": "MIT",
"dependencies": {
"chromedriver": "^2.46.0",
"geckodriver": "^1.16.0",
"selenium-webdriver": "^4.0.0-alpha.1"
},
"devDependencies": {
"allure-commandline": "^2.9.0",
"jest": "^24.3.0",
"jest-allure": "^0.1.1",
"jest-cli": "^24.3.0"
},
"jest": {
"verbose": true,
"reporters": [
"default",
"jest-allure"
]
},
"scripts": {
"loginTest": "jest tests/Login.test.js",
"settingsTest": "jest tests/Settings.test.js"
}
}

Image attachment not working reliably

Attaching an image is not working reliably. Consider this test code:

import { registerAllureReporter } from "jest-allure/dist/setup";

registerAllureReporter();

describe("Reporter", () => {
    test("Attach image", async () => {
        await reporter.description("Attaching an image");

        const img1 = await drawText(`Generated Image`);

        await reporter.startStep("Make a screenshot");
        await reporter.addAttachment("Screenshot", img1, "image/png");
        await reporter.endStep();
    });
});

and in order to ease differing between individual test runs, a dynamically generated image using canvas including the current timestamp:

const { createCanvas } = require("canvas");

function drawText(text: string): any {
    const canvas = createCanvas(480, 240);
    const ctx = canvas.getContext("2d");

    ctx.font = "30px Impact";
    const left = 20;
    ctx.fillText(text, left, 80);
    ctx.fillText(`(${new Date().toISOString()})`, left, 120);

    return canvas.toBuffer();
}

and this package.json

{
  "scripts": {
    "test": "jest",
    "report": "allure generate --clean"
  },
  "dependencies": {
    "@types/jest": "^23.1.0",
    "allure-commandline": "^2.5.0",
    "canvas": "^2.0.0-alpha.12",
    "jest": "^23.1.0",
    "jest-allure": "^0.1.1"
  },
  "jest": {
    "transform": {
      "^.+\\.tsx?$": "ts-jest"
    },
    "testRegex": "(./.*/.*(\\.test|\\.spec))\\.(ts?|tsx?)$",
    "moduleFileExtensions": [
      "ts",
      "js",
      "json"
    ],
    "reporters": [
      "default",
      "jest-allure"
    ]
  }
}

Now run the test repeatedly:

npm test

and approx. every second run will not contain the image attachment in the report:

npm run report

Am I using this API wrong here or is this a bug?

Using jest-allure with ts-jest

I have project configuration:

// jest.config.js
module.exports = {
    preset: 'ts-jest',
    testEnvironment: 'node',
    reporters: ['default', 'jest-allure']
};

tsconfig.json

{
    "typeAcquisition": {
        "enable": true
    },
    "compilerOptions": {
        "target": "es2018",
        "allowJs": true,
        "moduleResolution": "node",
        "resolveJsonModule": true,
        "allowSyntheticDefaultImports": true,
        "experimentalDecorators": true,
        "esModuleInterop": true,
        "baseUrl": "./",
        "lib": [
            "es2018",
            "dom"
        ],
        "typeRoots": [
            "node_modules/@types",
            "node_modules/jest-allure/src",
            "./typings.d.ts"
        ]
    }
}

and I try to use global reporter in test, but receive undefined:

describe('test', () => {
  it('testcase1', () => {
    console.log(global.reporter); // undefined
  })
})

what may be wrong? Does jest-allure support typescript?

[Feature request] simplify reporter.startStep

Hello,

I want to have a step by default for every expect I do in my test. It's too heavy to use reporter.startStep/endStep each time in the test. Do you have a solution to implements a tag @step, or an instant step for some keyworks (like expects) ?

Thanks for reading !

jest-allure not working with testRunner jest-circus

Hi all,
I'm having the following issue

ReferenceError: jasmine is not defined

> 1 | import "jest-allure/dist/setup";
    | ^
  2 | 

  at registerAllureReporter (node_modules/jest-allure/dist/setup.js:46:5)
  at Object.<anonymous> (node_modules/jest-allure/dist/setup.js:49:1)
  at Object.<anonymous> (jasmine.config.js:1:1)
      at Array.forEach (<anonymous>)

Is it mandatory to use the default testRunner jasmine2 to be able to use this reporter?

how to take picture only when a jest test failed?

I researched this topic and saw a similar question in https://github.com/allure-framework/allure-jasmine/issues/10 and
But I wonder if this is something jest do or allure, or... jest-allure?
Is there some sort of each test on error event can be utilized in each description / it scope when onError without building another custom reporter?
I know I can take a screenshot by building another reporter (https://stackoverflow.com/questions/48388206/how-to-run-function-when-any-test-fails-jest)... but is that the only way to go in this case?

Thanks!

Generated reports not compatible with allure2

I'm trying to generate allure reports from the results but allure is giving me an error:
Unknown root element ns2:test-suite.

Example results:

<?xml version='1.0'?>
<ns2:test-suite xmlns:ns2='urn:model.allure.qatools.yandex.ru' start='1580811412000' stop='1580811412079'>
    <name>GitHub Actions Test</name>
    <title>GitHub Actions Test</title>
    <test-cases>
        <test-case start='1580811412001' status='passed' stop='1580811412003'>
            <name>action.yml exists</name>
            <title>action.yml exists</title>
            <labels/>
            <parameters/>
            <steps/>
            <attachments/>
        </test-case>
    </test-cases>
</ns2:test-suite>

Looking around, it looks like maybe allure2 uses json test results instead of xml. Maybe this plugin is only for allure1? But the readme references "allure2". I feel like I'm missing something obvious but I see no references to allure version problems in these issues.

Have people been successful using this with allure2?

My project is FOSS. Checkout the allure verbose output here. Expand the "Generate Allure Report" step to see the output.

no test results

C:\Users\kodmis\Documents\webprojects\fs-vue-template>npm t

[email protected] test C:\Users\kodmis\Documents\webprojects\fs-vue-template
jest --config test/jest.conf.js

PASS test/specs/components/HelloWorld.spec.js
HelloWorld.vue
โˆš contains header "Welcome to Your Vue.js App" (16ms)

Test Suites: 1 passed, 1 total
Tests: 1 passed, 1 total
Snapshots: 0 total
Time: 4.807s
Ran all test suites.

C:\Users\kodmis\Documents\webprojects\fs-vue-template>dir allure*

Volume in drive C is OSDisk
Volume Serial Number is 38F1-E399

Directory of C:\Users\kodmis\Documents\webprojects\fs-vue-template

File Not Found

C:\Users\kodmis\projects\fs-vue-template>allure generate

allure-results does not exists
Report successfully generated to allure-report

C:\Users\kodmis\Documents\webprojects\fs-vue-template>type test\jest.conf.js

const path = require('path');

module.exports = {
rootDir: path.resolve(__dirname, '../'),
moduleFileExtensions: ['js', 'json', 'vue'],
moduleNameMapper: {
'^@/(.)$': '/src/$1',
},
transform: {
'^.+\.js$': '/node_modules/babel-jest',
'.
\.(vue)$': '/node_modules/vue-jest',
},
reporters: ["jest-allure", "default"],

};

Causing JavaScript heap to run out of memory on Travis

Trying to add this library to our UI project which is being testing on travis.

We are getting the following error:

<--- Last few GCs --->
[8802:0x41646f0]    79347 ms: Mark-sweep 1312.7 (1443.5) -> 1299.8 (1443.0) MB, 1424.0 / 0.2 ms  (average mu = 0.256, current mu = 0.227) allocation failure scavenge might not succeed
[8802:0x41646f0]    81159 ms: Mark-sweep 1314.4 (1443.0) -> 1301.0 (1443.0) MB, 1528.8 / 0.1 ms  (average mu = 0.207, current mu = 0.156) allocation failure scavenge might not succeed
<--- JS stacktrace --->
==== JS stack trace =========================================
    0: ExitFrame [pc: 0x2d4c9985be1d]
    1: StubFrame [pc: 0x2d4c99811034]
Security context: 0x1e033831e6e9 <JSObject>
    2: relative [0x1918222457c9] [path.js:~1161] [pc=0x2d4c99e75c2b](this=0x191822202201 <Object map = 0x360feb4b8969>,from=0x1fb8ed0f2cb1 <String[40]: /home/travis/build/h2-/ui>,to=0x3e4d003a71b1 <String[82]: /home/travis/build/h2-/ui/node_modules/source-map/lib/quick-sort.js>)
    3: shoul...
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
 1: 0x8f9d10 node::Abort() [/home/travis/.nvm/versions/node/v10.16.0/bin/node]
 2: 0x8f9d5c  [/home/travis/.nvm/versions/node/v10.16.0/bin/node]
 3: 0xaffd0e v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [/home/travis/.nvm/versions/node/v10.16.0/bin/node]
 4: 0xafff44 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [/home/travis/.nvm/versions/node/v10.16.0/bin/node]
 5: 0xef4152  [/home/travis/.nvm/versions/node/v10.16.0/bin/node]
 6: 0xef4258 v8::internal::Heap::CheckIneffectiveMarkCompact(unsigned long, double) [/home/travis/.nvm/versions/node/v10.16.0/bin/node]
 7: 0xf00332 v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::GCCallbackFlags) [/home/travis/.nvm/versions/node/v10.16.0/bin/node]
 8: 0xf00c64 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/home/travis/.nvm/versions/node/v10.16.0/bin/node]
 9: 0xf038d1 v8::internal::Heap::AllocateRawWithRetryOrFail(int, v8::internal::AllocationSpace, v8::internal::AllocationAlignment) [/home/travis/.nvm/versions/node/v10.16.0/bin/node]
10: 0xeccd54 v8::internal::Factory::NewFillerObject(int, bool, v8::internal::AllocationSpace) [/home/travis/.nvm/versions/node/v10.16.0/bin/node]
11: 0x116cede v8::internal::Runtime_AllocateInNewSpace(int, v8::internal::Object**, v8::internal::Isolate*) [/home/travis/.nvm/versions/node/v10.16.0/bin/node]
12: 0x2d4c9985be1d 
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Can we run tests in parallel with jest-allure?

Can we run tests in parallel with jest-allure? I am having below problems.

allure-js-commons: Unexpected startStep() of Preparing the request for password check.. There is no parent step

Unable to use reporter in beforeAll() or beforeEach()

I have my set of tests in Typescript, so to be able to use the global variable reporter is declare at the start of the file:
declare var reporter: any;

And in my tests, everything works just fine and properly displayed in the end report:

describe('Describe', () => {
    test('test name', async () => {
        reporter.description('Description here');
        reporter.startStep('Start step');
        reporter.endStep();
    });
});

However if I have a beforeAll() or a beforeEach() method that's using the reporter I get warnings and nothing is saved in the end report.

console.warn node_modules/allure-js-commons/index.js:57
    allure-js-commons: Unexpected startStep() of <name here>. There is no parent step

Example:

describe('Describe', () => {

    beforeAll(async () => {
        reporter.startStep('Before all start step');
        reporter.endStep();
    });

    test('test name', async () => {
        reporter.description('Description here');
        reporter.startStep('Start step');
        reporter.endStep();
    });
});

Am I using it wrong? It's not supported? Are there any workarounds?

TS error Cannot find name reporter

I have a monorepository, and when I am editing test files I see following error in WebStorm:

xxx.spec.tsx:21:9 - error TS2304: Cannot find name 'reporter'.
21  reporter.epic('xxx');

Funny part is that tests are passing, since Jest use Babel to transpile, which does not verify types.

I've added following to my tsconfig, but it still fails:

{
  "compilerOptions": {
    "typeRoots": [
      "node_modules/@types",
      "node_modules/jest-allure/dist"
    ]
}

Generate two .xml files

Hi. I have the next problem: jest-allure generate two .xml files, one of them has an empty , but second is fulfilled.
In my package.json file i use
"jest": { "setupTestFrameworkScriptFile": "./jest.setup.js" }

In jest.setup.js i used
const { registerAllureReporter } = require("jest-allure/dist/setup")
registerAllureReporter();

In file ./node-modules/jest-allure/src/setup.ts
I noticed that you are using registerAllureReporter() in the end of code
image. I think it generate .xml second time.

I resolved my issue by the next direction:
In jest.setup.js I just require file ./jest-allure/dist/setup
require("jest-allure/dist/setup") and dont use registerAllureReporter(),

I think, you need to correct example with "setupTestFrameworkScriptFile"

in examples as provided reporter is being used but it's not declared any variable or nor referenced.

const { Severity } = require("jest-allure/dist/Reporter");

const timeout = 5000;

describe(
'/ (Home Page)',
() => {
let page;

    beforeAll(async () => {
        page = await global.__BROWSER__.newPage();
        await page.goto('https://google.com');
    }, timeout);

    afterAll(async () => {
        await page.close();
    });

    it('should load without error', async () => {
        reporter
            .description("Home Page test suite")
            .story("GOOGL-01")
            .severity(Severity.Critical);

        const text = await page.evaluate(() => document.body.textContent);

        reporter.startStep("Check that home page contain google");
        expect(text).toContain('google');
        reporter.endStep();

        reporter.startStep("Make a screenshot");
        const screenshot = await page.screenshot();
        reporter.addAttachment("Home Page", screenshot, "image/png");
        reporter.endStep();
    })
},
timeout

);

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.