Open jithinkmatthew opened 5 years ago
I don't have any real documentation, but there is an example in https://github.com/korobochka/jasmine-allure2-reporter/blob/master/test/Setup.ts
Basic setup boils down to:
const reporter = new JasmineAllureReporter(new AllureRuntime({
resultsDir: "./allure-results"
}));
jasmine.getEnv().addReporter(reporter);
export const allure: AllureInterface = reporter.getInterface();
Do you have any specific questions?
@korobochka , Thanks for the reply. I will try to configure it based on your suggestion and let you know.
Hi @korobochka Can you please clarify how to attach screenshots to the report? For example, on tests failed.
I try to use jasmine-allure2-reporter with Protractor and Jasmine2 And I added next code into my setup.ts, based on the original jasmine-allure documentation :
jasmine.getEnv().afterEach(function () {
browser.takeScreenshot().then(png => allure.attachment('Screenshot', Buffer.from(png, 'base64'), ContentType.PNG));
});
It captures a screenshot, but the screenshot is not present in the generated report.
@ValeriiBorovyk the code you provided is missing a return to make sure async screenshot operation is correctly awaited. Should be something like:
jasmine.getEnv().afterEach(function () {
return browser.takeScreenshot().then(png => allure.attachment('Screenshot', Buffer.from(png, 'base64'), ContentType.PNG));
});
For Protractor it needs to be placed into onPrepare
in the Protractors Config
, not sure what do you mean by setup.ts.
@korobochka setup.ts - means https://github.com/korobochka/jasmine-allure2-reporter/blob/master/test/Setup.ts
Can you please share an example of protractor.conf.js with configured this version of allure?
@korobochka , Could you please provide instructions to configure this? or Is it same like allure-jasmine