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

[Feature] add Allure reporter #7034

Closed
mxschmitt opened this issue May 18, 2021 · 22 comments
Closed

[Feature] add Allure reporter #7034

mxschmitt opened this issue May 18, 2021 · 22 comments
Labels
feature-test-runner Playwright test specific issues P3-collecting-feedback

Comments

@mxschmitt
Copy link
Member

mxschmitt commented May 18, 2021

See here for instructions: https://github.com/allure-framework/allure-js/blob/master/packages/allure-playwright/README.md

@BorisOsipov
Copy link
Contributor

The link to allure-js library is obsolete.

A new allure-js is here https://github.com/allure-framework/allure-js

@mxschmitt mxschmitt transferred this issue from microsoft/folio Jun 10, 2021
@mxschmitt mxschmitt added the feature-test-runner Playwright test specific issues label Jun 10, 2021
@mxschmitt mxschmitt self-assigned this Jun 12, 2021
@mxschmitt mxschmitt added this to the v1.13.0 milestone Jun 14, 2021
@mxschmitt mxschmitt removed this from the v1.13.0 milestone Jun 15, 2021
@mxschmitt mxschmitt assigned JoelEinbinder and unassigned mxschmitt Jun 16, 2021
@mpuertao
Copy link

This is possible?->, add screenshots to the report with allure in the version 1.13.0 of @playwright/test

@kshrestha99
Copy link

I would like to second the need for screenshots to the report for each test 'it' statement, for both passing and failing tests.

@pavelfeldman
Copy link
Member

pavelfeldman commented Jul 21, 2021

For instructions see here: https://github.com/allure-framework/allure-js/blob/master/packages/allure-playwright/README.md

@vsravuri
Copy link

@pavelfeldman Could you please share JS example ?

@AlexKomanov
Copy link
Contributor

@pavelfeldman
Please provide the code example for output directory definition.

@mpuertao
Copy link

mpuertao commented Jul 22, 2021

it doesn't work for me with V1.13.0

image

Has someone worked for you and can you share some example code?

@JoelEinbinder
Copy link
Contributor

You have to npm i experimental-allure-playwright first.

@mpuertao
Copy link

Ok, thanks @JoelEinbinder. Question: Where is the HTML generated?

@mailtogagan
Copy link

allure reports are looking good.. with traces and screenshots also embedded in the report.. still needs to be explore a bit more.

@AlexKomanov
Copy link
Contributor

Ok, thanks @JoelEinbinder. Question: Where is the HTML generated?

@mpuertao
It depends on your definition of the directories.
Allure requires installation of the server (local or remote) or it can be used as a plugin in the case of Jenkins. See more here
I used the local installation of the allure server.

Then I defined the report (still experimental):

image

Then, performed this command (the path to the directory is up to you):

image

After the test run - the defined folder will be created:

image

But the created results are kind of RAW data. In order to generate a report in the case of the local server, we need to run another command - 'allure generate -o <path-to-output-directory:

image

It will generate a folder with the report files:

image

Then, in order to open the report - we need to open a server with the command 'allure open , as the following:

image

And then - the report will open in the browser:

image

Hope it is clear enough.

@mpuertao
Copy link

mpuertao commented Jul 23, 2021

Very thanks @AlexKomanov . I was missing the: allure open. I worked perfect for me. thanks again

image

@BMayhew
Copy link

BMayhew commented Jul 23, 2021

Following @pavelfeldman post, my local allure results were being saved to allure-results (vs allure-result) so for the report to load with results I had to adjust the run commands as

npx playwright test --reporter=line,experimental-allure-playwright
allure generate ./allure-results --clean
allure open ./allure-report

Great work on this, super easy to get allure wired up!!!

@ssurabhi10
Copy link

Facing error on ubuntu allure: command not found when running allure generate ./allure-results --clean

@mxschmitt
Copy link
Member Author

You need to install Allure, see here for instructions: https://docs.qameta.io/allure/

@ssurabhi10
Copy link

ssurabhi10 commented Jul 31, 2021

Get this error
Exception in thread "main" java.lang.UnsatisfiedLinkError: Can't load library: /usr/lib/jvm/java-16-openjdk-amd64/lib/libawt_xawt.so
while running allure open ./allure-report in ubuntu 20

@ssurabhi10
Copy link

Is there any other way to open reports other than allure open ./allure-report ?

@mxschmitt
Copy link
Member Author

This is not an Playwright related error, please use the Allure support channels e.g. on their GitHub for that.

Allure is required to open an allure report.

@itasworkshop
Copy link

I tried to use it but it's giving image

@baev
Copy link

baev commented Aug 7, 2021

btw https://www.npmjs.com/package/allure-playwright was released

@Himani33
Copy link

Hi.. Does anyone know which allure package to use for playwright with jest runner (I AM NOT USING PLAYWRIGHT/TEST RUNNER). I am using jest-allure npm package but it does not take screenshots in failure tests. I am looking for a npm package to generate allure reporting with screenshots for my Playwright + jest runner tests. Any recommendations will be highly appreciated.

@dharitreesahoo
Copy link

How can I print Execution Environment in Allure report. I am using playwright Test Runner. In Jest runner I am able to get the solution. Can any body help on this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-test-runner Playwright test specific issues P3-collecting-feedback
Projects
None yet
Development

No branches or pull requests