Code Monkey home page Code Monkey logo

allure-js-commons's People

Contributors

cakeinpanic avatar d0lfin avatar just-boris avatar lautaropetaccio avatar marcbachmann avatar monkpit avatar sharadjay avatar sskorol avatar vovsemenv 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

allure-js-commons's Issues

endSuite should return XML file path

It'd be really nice if Allure.prototype.endSuite could return the path generated at

fs.outputFileSync(path.join(targetDir, uuid.v4() + '-testsuite.xml'), xml('ns2:test-suite', suites));
. As a UUID is used rather than a timestamp, it's hard to see which are the most recent files in that directory. Having them in the test output would be great!

Not showing story and feature

I ran the allure-js-commons/test/runtime.spec.js using protractor. Generated the report using allure command line, it shows all tests under 'allure-runtime', the top level describe. It's not sowing feature 'labels', and story 'add'. What's missing/wrong?

unexpected cyress cucumber reporter behaviour because of allure

Cypress 5.6.0
Hi, I am using allure in Cypress framework. I use allure for reporting and cypress-cucumber-preprocessor to have json reports in order to import results to xRay. Whenever i activate allure (either in cypress.json file or through cli) the cypress report jsons dont include the failed scenarios. but when i deactivate allure, it cypress cucumber report behaves as expected. Can you suggest a workaround or solution to this issue?

Attachments and nested BDD describe statements support?

Hi. I'm seriously considering writing a Jasmine reporter for Allure, so I figured I should use allure-js-commons, however it doesn't look like it supports attachments or nested "describes".

I think Mocha supports nested describes too, so that particular change might benefit allure-mocha-reporter too, but does Allure itself even support that?

I need attachments support for adding application screenshots.

I'd like to know how hard would it be to add support for those things and if @just-boris would help me a bit if in case I ran into trouble.

Thanks ;)

Provide parameters from test case

Possible api

it("is a test", function() {
    allure.addArgument("browser", "Chrome")
    allure.addArgument("capabilities", "chrome.latest.mac")
});

Ability to add attachments to steps

While Java implementation is able to add attachments to the steps, JS implementation only allows that for test cases. It's expected that this code adds attachment to the enclosing step:

allure.createStep('enclosing step', function() {
  allure.createAttachent('name', function() {return 'blah'}, 'application/text')();
})();

Unexpected endStep

19:03:39 allure-js-commons: Unexpected endStep(). There is no any steps running
19:04:49 allure-js-commons: Unexpected endStep(). There is no any steps running
19:07:10 allure-js-commons: Unexpected endStep(). There is no any steps running
19:13:02 allure-js-commons: Unexpected endStep(). There is no any steps running

What does it mean?

Change file encoding in case of images

I am trying to attach screenshots of my test cases and I have raw data response from selenium. I see these files can only be written in base64 format and in allure when writing files encoding format is not passed. Can we pass encoding format when adding attachments?

Approach to nested step in async tests

Currently it's impossible to nest steps in a lot of cases when async tests are used. Consider this Protractor code that uses Promises:

allure.createStep('Outer step', function() {
  element.click().then(function () {
    allure.createStep('Step inside of promise', function () {})();
  });
})();

While the code is nested, it's actually executed in Control Flow of WebdriverJS and therefore zeroes out all the nestiness.

Because this is a usual thing in WebdriverJS I'd think on general approach to address this.

MarkDown Support

Any possible way currently to write description in markdown format so eventually it will be generated like the following,

<description type="markdown">

Correctly adding labels

Hey, great work with this project

Would you mind showing me the full steps to add labels? I've tried a lot of different ways and unfortunately get errors such as 'addLabel is not a function' etc.

I appreciate that in the spec file we can call 'allure.addLabel("severity", "trival"); within the Jasmine "it" blocks.

Where do we globally define Allure? The conf.js file or the spec? Would this just be global.allure = allure; within the onPrepare that contains var AllureReporter = require('jasmine-allure-reporter'); ?

Do I need to declare var runtime = require('allure-js-commons') ?

Many thanks in advance!

allure-js-commons/writer.js writeSuite method

if suites.toXML() method return not correct data

fs.outputFileSync(path.join(targetDir, uuid.v4() + '-testsuite.xml'), xml.parse('ns2:test-suite', suites.toXML()));

this method does not say any info about error and xml file does not appear

Can't mark a step to be failed in mocha

Through the code
Allure.prototype.createStep = function(name, stepFunc) {
var that = this;
return function() {
var stepName = that._format(name, Array.prototype.slice.call(arguments, 0)),
status = 'passed',
result;
that._allure.startStep(stepName);
try {
result = stepFunc.apply(this, arguments);
}
catch(error) {
status = 'broken';
throw error;
}
finally {
if(that.isPromise(result)) {
result.then(function() {
that._allure.endStep('passed');
}, function() {
that._allure.endStep('broken');
});
} else {
that._allure.endStep(status);
}
}
return result;
};
};

This seems only accept steps status to be 'passed' and 'broken', actually we'll need some steps to be 'failed'

stop and status not populated when searching for sub-elements

Looks like the step stop and status are not reported properly when calling elementIdElements

I called it a couple times in my test, and noticed this in my testsuite.xml:

<step start="1478634228965" stop="" status="">
	<name>POST /wd/hub/session/2e793399-38da-44ba-8747-961bfc1259e7/element/30/element</name>
	<title>POST /wd/hub/session/2e793399-38da-44ba-8747-961bfc1259e7/element/30/element</title>
	<attachments>
		<attachment title="Request" source="942970ed-13a6-480c-b377-32aaec46ce19-attachment.json" type="application/json" size="79"/>
	</attachments>

This leads to a java.lang.NumberFormatException when I attempt to generate a report.

[Improvement] Possibility to add data for all testcases in suite

I have a case:
before all tests in my suite i log in within some user which is selected randomly
I would like to add this information to all tests of this suite in beforeAll
Something like this:

// this whole suite fails
describe("profile test", () => {
  beforeAll(() => {
    allure.setDescription('user is ', randomUser);
    login(radomUser); 
  });
  it("dome testcase", () => {
  });
});

And then this description would appear in every test of this suite

Implement custom categories from Allure 2 Beta 6 release

It would be very nice if you implement support of broken test statuses and a way to determine them via categories.json, as described in this article: https://qameta.io/blog/2017/03/allure2-beta6/
categories

[
  {
    "name": "Ignored tests",
    "messageRegex": ".*ignored.*",
    "matchedStatuses": [ "skipped" ]
  },
  {
    "name": "Infrastructure problems",
    "traceRegex": ".*RuntimeException.*",
    "matchedStatuses": [ "broken", "failed" ]
  },
  {
    "name": "Outdated tests",
    "messageRegex": ".*FileNotFound.*",
    "matchedStatuses": [
      "broken"
    ]
  }
]

Rewrite using TypeScript

I would love to rewrite allure-js-commons using TypeScript with proper transpilation to es5 for publishing.

Benefits:

  • better code readability
  • better code maintenance
  • types
  • IDE auto complete

Allure blows up on incorrect sequences of events

Given the following events (indention shows our current state):

* start test
   * start step
   * end step
* end step (we finished whole case instead of step)
* start step

Note that last end step and start step are swapped. That causes the error:

TypeError: Cannot read property 'addStep' of undefined
   at Allure.startStep

We are trying to finish whole test case, but we need to try finish current step. If there is no current step, we should show warning, but not break people's code.

Using of custom categories.json

Hi there,
We are using allure-js-commons on our project and I want to add custom categories for our allure report.
In this documentation said, that you should put categories.json to report folder before report generation.
The issue is that when I test it locally and put categories.json to allure-report directory and than generate report for this folder - it says that report already exists and you should apply --clean to this generation so it removes everything from folder.
When I'm trying to keep this file in ./output directory for allure report, it does not apply categories to report

Maybe you can advise how to handle this?

Screen Shot 2019-10-04 at 1 03 54 PM
Screen Shot 2019-10-04 at 1 04 00 PM
Screen Shot 2019-10-04 at 1 04 06 PM
Screen Shot 2019-10-04 at 1 05 14 PM

Provide a convenient way to write environment file

Currently you can write environment.properties file into results dir manually. Actually, this package should provide this feature for you.

Proposed code sample:

allure.writeEnvironment({
  browser: 'Chrome',
  testAddress: 'http://example.com',
  //  ...
});

It should serialize properties and write the appropriate file.

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.