Coder Social home page Coder Social logo

allure-framework / allure-js Goto Github PK

View Code? Open in Web Editor NEW
204.0 16.0 108.0 484.78 MB

Allure integrations for JavaScript test frameworks

Home Page: https://allurereport.org/

License: Apache License 2.0

TypeScript 97.49% JavaScript 2.50% Shell 0.01%
allure reporing reporting-engine jest mocha cucumber jasmine playwright newman postman

allure-js's Introduction

Allure Javascript Integrations

This project aggregates Allure Javascript commons and reporters.

Allure Report logo


Supported frameworks

CucumberJS

npm npm

Read more

Vitest

npm npm

Read more

Jest

npm npm

Read more

Jasmine

npm npm

Read more

Mocha

npm npm

Read more

Playwright

npm npm

Read more

Cypress

npm npm

Read more

Newman

npm npm

Read more

Decorators @testdeck

npm npm

Read more

Hermione

npm npm

Read more

CodeceptJS

npm npm

Read more

Development

allure-js-commons

Interface for Allure 2 to be used from Javascript and TypeScript.

npm npm

Read more

allure-js's People

Contributors

baev avatar cheshi-mantu avatar claudiaj avatar cmecklenborg avatar dependabot-preview[bot] avatar dependabot[bot] avatar dtinth avatar egerix avatar epszaw avatar eroshenkoam avatar guiyomh avatar ilya2010ujl avatar just-boris avatar kirill-konshin avatar kobenguyent avatar korobochka avatar link89 avatar mind029 avatar muhserks avatar mxschmitt avatar pavelfeldman avatar qameta-ci avatar renovate[bot] avatar serembon avatar sseliverstov avatar sskorol avatar swcarter007 avatar vovsemenv avatar yury-s avatar zcsteele 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

allure-js's Issues

allure-cucumber-js - Cannot read property 'sourceLocation' of undefined when running with --parallel

I'm submitting a ...

  • bug report
  • feature request
  • support request => Please do not submit support request here, see note at the top of this template.

What is the current behavior?

Allure-cucumberjs is used as a reporter for cucumber-js test framework.
When I run tests using --parallel flag, test runner throws error:

TypeError: Cannot read property 'sourceLocation' of undefined
    at AllureReporter.onTestStepStarted (.../node_modules/allure-cucumberjs/src/CucumberJSAllureReporter.ts:192:18)
    at EventEmitter.emit (events.js:189:13)
    at Master.parseSlaveMessage (.../node_modules/cucumber/lib/runtime/parallel/master.js:55:31)
    at ChildProcess.slave.process.on.message (.../node_modules/cucumber/lib/runtime/parallel/master.js:83:12)
    at ChildProcess.emit (events.js:189:13)
    at emit (internal/child_process.js:820:12)
    at process._tickCallback (internal/process/next_tick.js:63:19)

Please tell us about your environment:

Allure version
Test framework "cucumber": "^6.0.5"
Allure adaptor allure-cucumberjs": "^2.0.0-beta.6"

Bring allure-mochajs in line with other projects

Currently allure-mochajs is wildly different from other packages.

  • Rename to allure-mocha
  • Migrate from tslint to ESLint
  • Put all compiled files under dist folder
  • More structured .npmignore and resulting package
  • (?) Reduce number of dependencies

One level deep describe is ignored in suites view

I'm submitting a ...

  • bug report
  • feature request
  • support request => Please do not submit support request here, see note at the top of this template.

What is the current behavior?

I have a test suite:

describe('TabPanel', () => {
    it('will work if appears several times at a page', () => {

It generates following JSON:

{
  "uuid": "c4d05013-b522-45f1-9860-a4fd58e2a4a5",
  "historyId": "TabPanel will work if appears several times at a page",
  "status": "passed",
  "statusDetails": {},
  "stage": "finished",
  "steps": [],
  "attachments": [],
  "parameters": [],
  "labels": [
    {
      "name": "parentSuite",
      "value": "TabPanel"
    }
  ],
  "links": [],
  "start": 1586542601975,
  "name": "will work if appears several times at a page",
  "fullName": "TabPanel will work if appears several times at a page",
  "stop": 1586542602032
}

When I open suites view in Allure EE this test does not belong to any suite:

image

What is the expected behavior?

I figured that you should have double describe in order to make Suite grouping work, like this:

describe('Store', () => {
    describe('cloning', () => {
        it('should provide a new store with the same data as source', () => {

Then json will be like this:

{
  "uuid": "f217cfaf-0c46-46db-90ea-38615cef4a29",
  "historyId": "Store cloning should provide a new store with the same data as source",
  "status": "passed",
  "statusDetails": {},
  "stage": "finished",
  "steps": [],
  "attachments": [],
  "parameters": [],
  "labels": [
    {
      "name": "parentSuite",
      "value": "Store"
    },
    {
      "name": "suite",
      "value": "cloning"
    }
  ],
  "links": [],
  "start": 1586542591551,
  "name": "should provide a new store with the same data as source",
  "fullName": "Store cloning should provide a new store with the same data as source",
  "stop": 1586542592553
}

Can I send allure report via email through Jenkins?

I'm submitting a ...

  • bug report
  • feature request
  • support request => Please do not submit support request here, see note at the top of this template.

What is the current behavior?

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem

What is the expected behavior?

What is the motivation / use case for changing the behavior?

Please tell us about your environment:

Allure version 2.7.0
Test framework jest@latest
Allure adaptor allure-mocha@latest
Generate report using allure-jenkins@latest

Other information

Implement @step decorator

I'm submitting a ...

  • bug report
  • feature request
  • support request => Please do not submit support request here, see note at the top of this template.

Decorators greatly reduce boilerplate required to create steps.
We should support API similar to Java decorators.

Revise allure-mocha

I'm submitting a ...

  • bug report
  • feature request
  • support request => Please do not submit support request here, see note at the top of this template.

What is the current behavior?

Current allure-mocha version seems a bit outdated:

  • dependencies are outdated;
  • hooks are not correctly handled;
  • mocha-typescript is deprecated;
  • it's hard to apply decorators with such a tricky exports;
  • some new features like "epic" are uncovered.

What is the motivation / use case for changing the behavior?

It's hard to reuse current allure-mocha implementation within other frameworks or libraries. So we need to consider the following updates:

  • update package dependencies to the latest versions;
  • update typescript dependency in a root module, as re-exporting issue is already fixed;
  • replace deprecated mocha-typescript with @testdeck/mocha;
  • add before/after hooks handlers;
  • add Allure container to the root allure-js-commons for easier decorators' implementation;
  • revise module exports;
  • cover "epic" feature.

Support Jest table tests

I'm submitting a ...

  • bug report
  • feature request
  • support request => Please do not submit support request here, see note at the top of this template.

Jest has a functionality similar to https://github.com/junit-team/junit4/wiki/Parameterized-tests where you can define a number of tests using a table: https://jestjs.io/docs/en/api#testeachtablename-fn-timeout

test.each([
  [1, 1, 2],
  [1, 2, 3],
  [2, 1, 3],
])('.add(%i, %i)', (a, b, expected) => {
  expect(a + b).toBe(expected);
});

Currently it will result in 3 tests in Allure report: .add(1,1), .add(1,2) and .add(2,1). It would be nice to have some way to group these tests in report.

Please add jest-circus support

I'm submitting a ...

  • feature request

What is the current behavior?

Currently allure-js supports only Jasmine test results. Jest-circus apperantly has a different format and therefore when I try to run my tests with jest-circus runner, I get

    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)

error

What is the motivation / use case for changing the behavior?

I would like to run our E2E API tests with latest jest test runner.

Please tell us about your environment:

Allure version 2.7.0
Test framework jest@latest
Allure adaptor allure-jest@latest

Allure-mocha is not compatible with --check-leaks option

I'm submitting a ...

  • bug report
  • feature request
  • support request => Please do not submit support request here, see note at the top of this template.

What is the current behavior?

When I use --check-leaks flag, my tests fail.

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem

It can be reproduced in the demo package. Add the --check-leaks flag here and see the output:

0 passing (102ms)
  2 failing

  1) Authorization
       "before each" hook:
     Error: global leaks detected: allure, cache


  2) Authorization
       Sergey Korol should be able to sign:
     Error: No executable!
      at MochaAllureInterface.get [as currentExecutable] (node_modules/mocha-allure2-reporter/src/MochaAllureInterface.ts:124:13)

What is the expected behavior?

Reporter should be compatible with any mocha option.

What is the motivation / use case for changing the behavior?

Please tell us about your environment:

Allure version 2.7.0
Test framework [email protected]
Allure adaptor allure-mocha@latest
Generate report using n/a

update CucumberJSAllureReporter to support latest cucumber "@cucumber/cucumber"

HI;

we updated our testproject to support @cucumber/cucumber as the old version is deprecated. See following Links:
deprecated: https://www.npmjs.com/package/cucumber
current cucumber : https://www.npmjs.com/package/@cucumber/cucumber

And with the latest version we are facing the issue that CucumberJSAllureReporter is importing cucumber dependecies from the deprecated cucumber.

`> import { Formatter, World as CucumberWorld } from "cucumber";

That is why I am not getting allure reports anymore.

Would you please update CucumberJSAllureReporter to support the latest @cucumber/cucumber

thank you for supporting

jasmine-allure2-reporter - AllureReporter is not a constructor (ECMAScript 5.1)

ECMAScript 5.1
Allure version 2.8.1
"dependencies": {
"allure2-js-commons": "^1.2.0",
"jasmine": "^2.5.0",
"jasmine-allure2-reporter": "^1.2.0"

We use ECMAScript 5.1 in our project. Jasmine-allure-reporter of the first version works fine with ECMAScript 5.1, but now we want to update the version to jasmine-allure2-reporter and when we run the tests we get an error "AllureReporter is not a constructor"

var AllureReporter = require ('jasmine-allure2-reporter'); - We call "require" in the specs to install
'jasmine-allure2-reporter' use "import":
import { JasmineAllureReporter } from "../src/JasmineAllureReporter";
import { JasmineConsoleReporter } from "../src/JasmineConsoleReporter";
but "import" is a prerogative of ECMAScript 6

How we can fix that problem?

Thanks you!

Unable to nest test suites with Allure-jest

I'm submitting a ...

  • [#] bug report
  • feature request
  • support request => Please do not submit support request here, see note at the top of this template.

What is the current behavior?

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

I am experiencing the same issue with Allure-Jest like the following users:

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem

please see links above - it is the same issue

What is the expected behavior?

describe() function is used for marking test suites in Allure report. Multiple nested describe() functions produce nested test suites in the report.

What is the motivation / use case for changing the behavior?

Better visibility/ redability of test results in projects of higher complexity;

Please tell us about your environment:

Allure version 2.9.0
Test framework [email protected]
Generate report using [email protected] ([email protected] on a local host)

Other information

[feature requests] Create document for new Allure-JS - All document refers to Allure1

I'm submitting a ...

  • bug report
  • feature request
  • support request => Please do not submit support request here, see note at the top of this template.

What is the current behavior?

Allure-JS document not found.

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem

What is the expected behavior?

Create document for new Allure-JS, it is confusing because all document refers to Allure1

What is the motivation / use case for changing the behavior?

Document how to use with Allure-JS in JavaScript project and create or use @step Annotation

Please tell us about your environment:

Allure version 2.7.0
Test framework jest@latest
Allure adaptor allure-mocha@latest
Generate report using allure-jenkins@latest

Other information

TypeError: Class constructor CucumberJSAllureFormatter cannot be invoked without 'new'

It's working for typescript configuration but not for Java script config.
Same issue when you use versions:

    "cucumber": "5.1.0",
    "allure-cucumberjs": "2.0.0-beta.4",

Next Configuration

var CucumberJSAllureFormatter = require('allure-cucumberjs').CucumberJSAllureFormatter;
var AllureRuntime = require('allure-cucumberjs').AllureRuntime;

function Reporter(options) {
  CucumberJSAllureFormatter.call(this,
    options,
    new AllureRuntime({ resultsDir: "./out/allure-results" }),
    {});
}
Reporter.prototype = Object.create(CucumberJSAllureFormatter.prototype);
Reporter.prototype.constructor = Reporter;

exports.default = Reporter;
TypeError: Class constructor CucumberJSAllureFormatter cannot be invoked without 'new'
    at new Reporter (C:\Users\fescobar\Documents\git\cross-automation\allure-report.js:5:29)
    at Function.build (C:\Users\fescobar\Documents\git\cross-automation\node_modules\cucumber\lib\formatter\builder.js:49:12)
    at C:\Users\fescobar\Documents\git\cross-automation\node_modules\cucumber\lib\cli\index.js:121:35
    at Generator.next (<anonymous>)
    at asyncGeneratorStep (C:\Users\fescobar\Documents\git\cross-automation\node_modules\cucumber\lib\cli\index.js:44:103)
    at _next (C:\Users\fescobar\Documents\git\cross-automation\node_modules\cucumber\lib\cli\index.js:46:194)

Related issue: korobochka/cucumberjs-allure2-reporter#4

allure-mocha - TypeError: Cannot read property 'epic' of undefined

I'm trying to do this configuration, but allure is undefined. Do you have any example calling allure method from mocha tests using TypeScript?

    "allure-mocha": "2.0.0-beta.6",
// es-modules
import { allure } from 'allure-mocha/runtime';
// or commonjs
const { allure } = require('allure-mocha/runtime');

it('is a test', () => {
  allure.epic('Some info');
});
TypeError: Cannot read property 'epic' of undefined

Thank you

Lerna support

I'm submitting a ...

  • bug report
  • feature request
  • support request => Please do not submit support request here, see note at the top of this template.

Add monorepo project based on Lerna. Draft version should include the following repos:

Projects should be merged into current repo as packages, including original repos' master branch history.

Name conventions:

  • allure-js-commons (compatibility with recent version);
  • allure-{framework_name}

Note that allure-mocha is currently binded by the other user (https://www.npmjs.com/package/allure-mocha), so we'll temporary name this package as allure-mochajs, until getting full publishing permissions.

Allure report counts failed/broken "after all" , "before all" tests to total test counts

I am new to Allure reports and WebdriverIO
I'm submitting a - [ ] bug report

Current Behavior : Allure report counts all after, all before all tests in the total test count which are not passed . If these are passed it will not add up to the total test count
image

Expected behavior : Show all individual test cases , not "after all", "before all" test cases . And if After all Before All test cases failed show the details in the skipped test cases , as we see for passed test cases

Please tell us about your environment:

Allure version 6.11.0"
Test framework mocha-framework": 6.11.0

Other information

How to add test-steps under test body in allure-nightwatch

I'm submitting a feature request

What is the current behavior?

If i generate allure report from default xml generated from nightwatch.js then test steps are not getting added under test body.

What is the expected behavior?

I want allure report having test steps , substeps under test body, just like below screenshot. I am able to add steps in allure-mochasome but not in allure-nightwatch
Screenshot 2020-06-06 at 3 09 19 PM

What is the motivation / use case for changing the behavior?

It gives more clarity in reports about steps taken in test cases.

Please tell us about your environment:

Allure-nightwatch-adapter 1.2.4
nightwatch v0.9.21

Other information

can we have supported framework for nightwatch same way as for cucumber, mocha, etc?

Although used one adapter(allure-nightwatch-adapter) for nightwatch but it adds all test cases under test body. and total count of test cases becomes total count of suits.
Screenshot 2020-06-08 at 4 54 41 PM

Add support for cucumber-js v7

I'm submitting a ...

  • bug report
  • feature request
  • support request => Please do not submit support request here, see note at the top of this template.

What is the current behavior?

Not support for cucumber-js v7.

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem

After updating cucumberjs to v7 the report is not generated anymore.

What is the expected behavior?

As per cucumber changelog:

Formatters: 

- Events are now based on cucumber-messages
- event-protocol formatter has been removed and replaced with message
- Custom formatters will need to migrate
- json formatter is deprecated and will be removed in next major release. Custom formatters should migrate to use the message formatter, or the standalone JSON formatter as a stopgap.

What is the motivation / use case for changing the behavior?

Ability to use the latest features of cucumber-js

Please tell us about your environment:

Allure version 2.7.0
Test framework cucumber@7
Allure adaptor allure-cucumberjs@latest
Generate report using allure-commandline@latest

Other information

Changelog
cucumber-messages

Incorrect "version" in package.json

I'm submitting a ...

  • bug report
  • feature request
  • support request => Please do not submit support request here, see note at the top of this template.

What is the current behavior?

The tag of the version is 2.0.0-beta.7 but the version in package.json is 2.0.0-beta.6

What is the expected behavior?

The tag and version in package.json is the same

What is the motivation / use case for changing the behavior?

Please tell us about your environment:

Allure version 2.7.0
Test framework [email protected]
Allure adaptor [email protected]

Update allure-js-commons

Commons need to be updated:

  • Update models (remove ExecutableItem, move from classes to interfaces)
  • AllureInterface: rename to Allure, make API similar to allure-java

allure-mocha: add possibility to attach a screenshot scoped to a failing test only

I'm submitting a ...

  • bug report
  • feature request
  • support request => Please do not submit support request here, see note at the top of this template.

What is the current behavior?

Given current mocha root hook

import allureRuntime from 'allure-mocha/runtime.js';
import { ContentType } from 'allure-js-commons';

async function afterEach(this: Context): Promise<void> {
    const allure = allureRuntime.allure;
    if (this.currentTest?.err) {
        try {
                await allure.createAttachment('Screenshot', await page.screenshot(), ContentType.PNG);
            } catch (err) {
                const message = `could not create a screenshot. Reason: ${err.message}`;
                await allure.createAttachment('Screenshot', message, ContentType.TEXT);
            }
    }
}

And a suite of 3 tests
When tests # 1 and # 2 fail with different reasons, # 3 passes
Then each of 3 tests in the report contains 2 attachments in the 'Tear Down' block.

What is the expected behavior?

Then tests # 1 and # 2 contain only their respective attachments, test # 3 contains no attachments at all.

What is the motivation / use case for changing the behavior?

Clean reports. Tests are independent from each other, so when one fails I don't want to see its attachment in another test report.
Currently the only way I found to attach something exactly to a test is doing this within the test body,
but then the code is not reusable. When allure is called from afterEach, block the currentTest is already not accessible in AllureReporter although it is accessible from mocha context.

Please tell us about your environment:

Test framework [email protected]
Allure adaptor [email protected]
Generate report using [email protected]

Other information

Jira-server-url config to make testId and issueId referencing to project jira (WDIO)

I'm submitting a ...

  • bug report
  • feature request
  • support request => Please do not submit support request here, see note at the top of this template.

What is the current behavior?

Allure generates report where testID has {allure-report-path}/{jira-id} link.
An error occurs by click on a link.

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem

What is the expected behavior?

Allure generates report where testID/issueID has {jira-server-path}/{jira-id} link. Alike allure.properties file in JAVA.

image

What is the motivation / use case for changing the behavior?

Team members will have possibilities navigate to mentioned Jira tests by click.

Please tell us about your environment:

Allure version 2.7.0
Test framework wdio@latest
Allure adaptor @wdio/allure-reporter@latest
Generate report using allure-teamcity@latest

Other information

Provide a static method to write environment info

I'm submitting a ...

  • bug report
  • feature request
  • support request => Please do not submit support request here, see note at the top of this template.

What is the current behavior?

In case of parallel test runs, there is no clear place where to put allure.writeEnvironmentInfo() call.

In the parent process, there is no allure object, it fails.

In child processes, you have a race condition, where multiple tests are writing to the same file. This may not end well.

Proposed API

import Allure from "allure-js-commons";

Allure.writeEnvironmentInfo();

Allure support for Jest Testing Framework

I'm submitting a ...

  • feature request

What is the current behavior?

Currently we have support of Allure with Jasmine Testing Framework.Can we have a feature to support the Jest Testing Framework in the javascript ecosystem.

Link of Jest - (https://facebook.github.io/jest/docs/en/tutorial-react.html)

What is the motivation / use case for changing the behavior?

Jest is preferred unit testing tool for React Applications. Having Allure compatible with Jest can add more nice reports at the end of the execution.

Please tell us about your environment:

Allure version 2.2.0
Test framework Jest

Other information

Support before and after hooks

I'm submitting a ...

  • bug report
  • feature request
  • support request => Please do not submit support request here, see note at the top of this template.

What is the current behavior?

Currently, all steps and attachments in before and after sections are getting ignored. We should provide an ability to record them to the report.

What is the expected behavior?

this code should work, attachment added to the report.

before(() => {
   allure.attachment('from before', 'hello!', ContentType.TEXT);
})

Please tell us about your environment:

Allure version 2.7.0
Test framework jest@latest
Allure adaptor allure-mocha@latest
Generate report using allure-jenkins@latest

Other information

allure-mocha example is not using allure-mocha

I'm submitting a ...

  • bug report
  • feature request
  • support request => Please do not submit support request here, see note at the top of this template.

What is the current behavior?

allure-mocha's example is not not using module allure-mocha

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem

Example repository is mocha-allure2-example.

It's package.json has only one package from allure ecosystem: mocha-allure2-reporter.

mocha-allure2-reporter's the only one dependecy is allure2-js-commons.

But allure-mocha's dependecy is allure-js-commons.

So there is nothing in common, and current example link leads to wrong example.

What is the expected behavior?

allure-mocha should provide correct example

What is the motivation / use case for changing the behavior?

Please tell us about your environment:

Allure version 2.7.0
Test framework jest@latest
Allure adaptor allure-mocha@latest
Generate report using allure-jenkins@latest

Other information

registerHandler is not a function when trying to use cucumberjs reporter

I'm submitting a ...

  • [X ] bug report
  • feature request
  • support request => Please do not submit support request here, see note at the top of this template.

What is the current behavior?

this.registerHandler is not a function error

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem

Node v10.16.3
Cucumber.js 6.0.5 or 5.1.0 (just ones I tested with)
allure-cucumberjs 2.0.0-beta.7
also tried cucumberjs-allure-reporter 1.0.3 just in case.

When trying to run with ./node_modules/cucumber/bin/cucumber-js ./features --format ./allure/reporter.js -r ./steps
reporter.js contents match suggested content https://docs.qameta.io/allure/#_usage_4

var reporter = require('cucumberjs-allure-reporter');
reporter.config({targetDir: "../allure/results"});
module.exports = reporter;

I thought it was related to breaking changing in cucumberjs, https://github.com/cucumber/cucumber-js/blob/master/CHANGELOG.md#breaking-changes, but it seems to be occurring on 5.1.0.
I also tried the github suggested, https://github.com/allure-framework/allure-js/blob/master/packages/allure-cucumberjs/README.md

var CucumberJSAllureFormatter = require(allure-cucumberjs).CucumberJSAllureFormatter;
var AllureRuntime = require(allure-cucumberjs).AllureRuntime;

function Reporter(options) {
  CucumberJSAllureFormatter.call(this,
    options,
    new AllureRuntime({ resultsDir: "./out/allure-results" }),
    {});
}
Reporter.prototype = Object.create(CucumberJSAllureFormatter.prototype);
Reporter.prototype.constructor = Reporter;

exports.default = Reporter;

but get a allure is not defined.

What is the expected behavior?

Generates results data or explain which version of cucumberjs are supported in main documentation (https://docs.qameta.io/allure/#_usage_4 and/or github page of this repo). (It would also be helpful to say if it's npm i allure-cucumberjs or npm i cucumberjs-allure-reporter (as it seems documentation mentions this in import) or npm i cucumberjs-allure2-reporter (as this stackoverflow issue suggests https://stackoverflow.com/questions/53544153/unable-to-generate-allure-report-for-protractor-cucumber).

Other information

TypeError: this.registerHandler is not a function
    at new Reporter (/Users/name/Documents/Code/puppet-ga/node_modules/cucumberjs-allure-reporter/src/CucumberJSAllureReporter.js:14:10)
    at Function.build (/Users/name/Documents/Code/puppet-ga/node_modules/cucumber/lib/formatter/builder.js:49:12)
    at /Users/name/Documents/Code/puppet-ga/node_modules/cucumber/lib/cli/index.js:121:35
    at Generator.next (<anonymous>)
    at asyncGeneratorStep (/Users/name/Documents/Code/puppet-ga/node_modules/cucumber/lib/cli/index.js:44:103)
    at _next (/Users/name/Documents/Code/puppet-ga/node_modules/cucumber/lib/cli/index.js:46:194)
    at /Users/name/Documents/Code/puppet-ga/node_modules/cucumber/lib/cli/index.js:46:364
    at new Promise (<anonymous>)
    at /Users/name/Documents/Code/puppet-ga/node_modules/cucumber/lib/cli/index.js:46:97
    at /Users/name/Documents/Code/puppet-ga/node_modules/cucumber/lib/cli/index.js:125:23
    at tryCatcher (/Users/name/Documents/Code/puppet-ga/node_modules/bluebird/js/release/util.js:16:23)
    at MappingPromiseArray._promiseFulfilled (/Users/name/Documents/Code/puppet-ga/node_modules/bluebird/js/release/map.js:68:38)
    at MappingPromiseArray.PromiseArray._iterate (/Users/name/Documents/Code/puppet-ga/node_modules/bluebird/js/release/promise_array.js:115:31)
    at MappingPromiseArray.init (/Users/name/Documents/Code/puppet-ga/node_modules/bluebird/js/release/promise_array.js:79:10)
    at MappingPromiseArray._asyncInit (/Users/name/Documents/Code/puppet-ga/node_modules/bluebird/js/release/map.js:37:10)
    at _drainQueueStep (/Users/name/Documents/Code/puppet-ga/node_modules/bluebird/js/release/async.js:97:12)

Or on Readme Version

ReferenceError: allure is not defined
    at Object.<anonymous> (/Users/name/Documents/Code/puppet-ga/allure/reporter.js:5:41)
    at Module._compile (internal/modules/cjs/loader.js:778:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
    at Module.require (internal/modules/cjs/loader.js:692:17)
    at require (internal/modules/cjs/helpers.js:25:18)
    at Function.loadCustomFormatter (/Users/name/Documents/Code/puppet-ga/node_modules/cucumber/lib/formatter/builder.js:115:29)
    at Function.getConstructorByType (/Users/name/Documents/Code/puppet-ga/node_modules/cucumber/lib/formatter/builder.js:82:33)
    at Function.build (/Users/name/Documents/Code/puppet-ga/node_modules/cucumber/lib/formatter/builder.js:42:40)
    at /Users/name/Documents/Code/puppet-ga/node_modules/cucumber/lib/cli/index.js:121:35
    at Generator.next (<anonymous>)
    at asyncGeneratorStep (/Users/name/Documents/Code/puppet-ga/node_modules/cucumber/lib/cli/index.js:44:103)
    at _next (/Users/name/Documents/Code/puppet-ga/node_modules/cucumber/lib/cli/index.js:46:194)
    at /Users/name/Documents/Code/puppet-ga/node_modules/cucumber/lib/cli/index.js:46:364

Console.logs are shown as stdout files

Describe the bug
Issues with playwright allure report

To Reproduce
Steps to reproduce the behavior:

  • npx playwright test --browser=chromium --reporter=line,allure-playwright
  • allure generate ./allure-results -c && allure open

Expected behavior
I would expect to see the The console.logs directly in the test case

Screenshots
I'm seeing for each log a stdout file that contains the log.
image
I need to click every file to see the log

Desktop (please complete the following information):

  • Browser chromium

And a question: is how to attach screenshots to the allure reports?
I'm using latest playwright version with playwright test runner

Thank you very much!

Mocha 8 parallel mode is not supported

I'm submitting a ...

  • bug report
  • feature request
  • support request => Please do not submit support request here, see note at the top of this template.

What is the current behavior?

Running tests using mocha 8 parallel feature with enabled allure-mocha reporter (2.0.0-beta.9) breaks test run with various errors:

Uncaught TypeError: test.parent.titlePath is not a function or its return value is not iterable

      at AllureReporter.startCase (node_modules\allure-mocha\src\AllureReporter.ts:98:62)
      at MochaAllureReporter.onTest (node_modules\allure-mocha\src\MochaAllureReporter.ts:39:23)    

I looked into code, and noticed that for mocha 8 code:
const [parentSuite, suite, ...subSuites] = test.parent.titlePath();
must be updated to
const [parentSuite, suite, ...subSuites] = test.parent.fullTitle();
Which might break backward compatibility. But report can be generated now.

But after updating there are still issue with using .createStep:
const step = allure.createStep(stepName, () => {}

allure cannot be imported since it is undefined.

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem

Demo repo can be taken from : https://github.com/Heisenbug-2021-api-testing-workshop/heisenbug-2021-api-testing-workshop-Xotabu4

Update .mocharc.js - add parallel: true to reproduce

What is the expected behavior?

What is the motivation / use case for changing the behavior?

Please tell us about your environment:

Allure version 2.7.0
Test framework mocha@latest
Allure adaptor [email protected]
Generate report using allure-server@latest

Other information

Allure-mocha does not show nested suites

I'm submitting a ...

  • bug report
  • feature request (some people may consider it a regression, it worked better in 1.x)
  • support request => Please do not submit support request here, see note at the top of this template.

What is the current behavior?

In the report you see all tests on the flat level, without nesting

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem

desctibe('a suite', () => {
   describe('child suite', () => {
      it('test one', () => {});
   });
   it('test two', () => {});
});

What is the expected behavior?

At the suites tab, I expect the following

  • a suite
    • child suite
      • test one
    • test two

What is the motivation / use case for changing the behavior?

Please tell us about your environment:

Allure version 2.7.0
Test framework mocha@latest
Allure adaptor allure-mocha@latest
Generate report using allure-jenkins@latest

Other information

allure-cucumber-js - other formatter are override while allure is enabled in config

I'm submitting a ...

  • bug report
  • feature request
  • support request => Please do not submit support request here, see note at the top of this template.

What is the current behavior?

I've got a package which formats the logs during test execution (cucumber-pretty). Now, while I provide Allure reporter to cucumberOpts.format together with cucumber-pretty, the 2nd one doesn't want to work.

My config file:

import { browser, Config } from 'protractor';

export const config: Config = {
  SELENIUM_PROMISE_MANAGER: false,
  allScriptsTimeout: 11000,
  directConnect: true,
  restartBrowserBetweenTests: false,

  cucumberOpts: {
    compiler: 'ts:ts-node/register',
    format: [
        'json:results/results.json',
        'node_modules/cucumber-pretty',
        'reporter/reporter.ts',
        'rerun:@rerun.txt',
    ],
    require: ['../e2e/steps/*.ts', '../e2e/support/*.ts', '../support/*.ts'],
    strict: true,
    tags: '',
  },
  framework: 'custom',
  frameworkPath: require.resolve('protractor-cucumber-framework'),
  specs: ['../e2e/features/**/*.feature'],
...
};

'reporter/reporter.ts' is a file with class Reporter for CucumberJSAllureFormatter

What is the expected behavior?

It should be able to add also other formatter for the log file.

Please tell us about your environment:

Allure version 2.7.0
Test framework protractor-cucumber-framework
Allure adaptor allure-cucumberjs @2.0.0-beta.6
Generate report using ssh allure generate...

Which library should I be using?

Hi there.

I'm struggling to figure out which allure - mocha library I should be using. There seems to be 3 and all are referenced in different areas of allure's documentation/github repo. Some guidance would be very helpful.

yarn add allure-mocha: https://github.com/allure-framework/allure-js/tree/master/packages/allure-mocha
yarn add mocha-allure2-reporter: https://github.com/sskorol/mocha-allure2-reporter
yarn add mocha-allure-reporter: https://github.com/allure-framework/allure-mocha

Note: I'm not using typescript. However I do like the idea of being able to use the @ annotations.

CucumberJS data tables are not appearing in a scenario view Test Body

Describe the bug
When running an allure report for CucumberJS, and a scenario has a step with a data table or list, the scenario's Test Body will show the steps but not the data table sassociated with the steps.
To Reproduce
Steps to reproduce the behavior:

  1. Run a CucumberJS scenario with a datatable.
  2. Output an Allure report
  3. Go to Suites
  4. Select the scenario with a data table in its step
  5. Look at the Test Body of that scenario
  6. See error

Expected behavior
The step's data table or item list should be output with the step in the Test Body.

In this example, in the screenshot, the step named "Then the following elements are displayed:" should have an item list appearing with it.

Screenshots
image

Environment (please complete the following information):

Allure version 2.9.0
Test framework WebDriverIO for JavaScript
Allure adaptor @wdio/allure-reporter": "7.3.1"
Generate report using allure generate ./log/allure-raw/ --clean && allure open

Additional context
Here's an example Cucumber scenario that can be used:

Given this is a scenario
When the list items are present:
| apple |
| orange |
The data table appears in the report:
| order | value |
| 1 | apple |
| 2 | orange|

Seems that label feature not rendering

The xml is generated by allure-mocha, and when transferd to html, label feature is missing.

 <?xml version='1.0'?>
 <ns2:test-suite xmlns:ns2='urn:model.allure.qatools.yandex.ru' start='1578913462617' stop='1578913466708'>
     <name>Simple login</name>
     <title>Simple login</title>
     <test-cases>
         <test-case start='1578913463776' status='broken' stop='1578913466644'>
             <name>I believe I can fly</name>
             <title>I believe I can fly</title>
             <labels>
                 <label name='feature' value='Simple loginfeature'/>
             </labels>
             <parameters>
                 <parameter kind='argument' name='env' value='test'/>
                 <parameter kind='argument' name='religion' value='ph'/>
             </parameters>
             <steps/>
             <attachments/>
             <failure>
                 <message>First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.</message>
                 <stack-trace>TypeError: First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.
                     at Function.Buffer.from (buffer.js:183:11)
                     at screenshot (common/hack_mocha.js:51:42)
                     at &lt;anonymous>
                     at process._tickCallback (internal/process/next_tick.js:189:7)</stack-trace>
             </failure>
             <description type='text'>Simple loginname</description>
         </test-case>
     </test-cases>
 </ns2:test-suite>
 ~

Report is like below:
image

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.