allure-framework / allure-js-commons Goto Github PK
View Code? Open in Web Editor NEWDeprecated, use https://github.com/allure-framework/allure-js instead
License: Other
Deprecated, use https://github.com/allure-framework/allure-js instead
License: Other
It'd be really nice if Allure.prototype.endSuite
could return the path generated at
Line 9 in b31aab5
Version 2.0.0.beta-11
has a backwards incompatibility issue because it removes these lines from index.js:
var AllureConfig_1 = require("./src/AllureConfig");
Object.defineProperty(exports, "AllureConfig", { enumerable: true, get: function () { return AllureConfig_1.AllureConfig; } });
This causes this issue: isaaceindhoven/testcafe-reporter-allure#102 because it is a dependency for that framework.
Hi, i am looking to add links to issues and Testcase ids in my Jasmine tests (using js). Is there a way to link them?
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?
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?
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 ;)
Possible api
it("is a test", function() {
allure.addArgument("browser", "Chrome")
allure.addArgument("capabilities", "chrome.latest.mac")
});
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')();
})();
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?
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?
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.
it's just FYI :)
As types definitions are missed for this project,
I implemented them by myself PR on review now DefinitelyTyped/DefinitelyTyped#25942
If I call allure.createStep from beforeAll function, the test fails with error "Cannot read property 'addStep' of undefined". But it works if called from a testcase (it). Tests are written in Jasmine 2, that supports beforeAll/afterAll
Any possible way currently to write description in markdown format so eventually it will be generated like the following,
<description type="markdown">
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!
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
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'
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.
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
Hi, I would like to know how I can fix the following error message.
allure-js-commons: Unexpected endStep(). There is no any steps running
I'm using:
All tests are passed without any issue, however I'm still seeing this message when test started running. Please help. Thanks!
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/
[
{
"name": "Ignored tests",
"messageRegex": ".*ignored.*",
"matchedStatuses": [ "skipped" ]
},
{
"name": "Infrastructure problems",
"traceRegex": ".*RuntimeException.*",
"matchedStatuses": [ "broken", "failed" ]
},
{
"name": "Outdated tests",
"messageRegex": ".*FileNotFound.*",
"matchedStatuses": [
"broken"
]
}
]
I would love to rewrite allure-js-commons
using TypeScript with proper transpilation to es5 for publishing.
Benefits:
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.
I try to add an attachment like this:
addAttachment('screenshotASD', screenshot, 'image/png');
But the attachment name does not get the name screenshotASD
anywhere in it. Rather it ends up being called 5c426ded-e834-4cf5-a43e-053a3cfc68d5-attachment.png
.
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?
Should we archive this repo and add https://github.com/allure-framework/allure-js link on top of the readme?
I'm a little confused between the environment-variable
, implemented in #8, and the 'test environment values' documented in https://github.com/allure-framework/allure-core/wiki/Environment, which doesn't seem to be implemented.
Is it in scope for allure-js-commons to provide a method to create an environment.xml
file?
Please update deprecated [email protected] to version 7 or higher.
Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.