Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation #1

Open
jithinkmatthew opened this issue Apr 3, 2019 · 5 comments
Open

Documentation #1

jithinkmatthew opened this issue Apr 3, 2019 · 5 comments

Comments

@jithinkmatthew
Copy link

jithinkmatthew commented Apr 3, 2019

@korobochka ,
Could you please provide instructions to configure this?
or Is it same like allure-jasmine

@korobochka
Copy link
Owner

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?

@jithinkmatthew
Copy link
Author

@korobochka , Thanks for the reply.
I will try to configure it based on your suggestion and let you know.

@ValeriiBorovyk
Copy link

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.

@korobochka
Copy link
Owner

@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.

@ValeriiBorovyk
Copy link

@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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants