Closed nataly22 closed 7 years ago
@nataly22 could you please provide MVE and/or actual report (with source files and built reports)?
Test run: ~/101discounts/tests/tmp_for_github$ py.test test_registration_a.py --alluredir /home/ngora/reports/ui/
Text during run:
================================================= test session starts ================================================== platform linux2 -- Python 2.7.12, pytest-2.9.0, py-1.4.31, pluggy-0.3.1 rootdir: /home/ngora, inifile: plugins: allure-adaptor-1.7.5 collected 1 items
test_registration_a.py .
Generate report: ~/reports/ui/allure_cli/bin$ ./allure report generate /home/ngora/reports/ui/
Open report:
~/reports/ui/allure_cli/bin$ ./allure report open
I wrote a reply with source files and built reports on gitHub site in my issue.
Thank you in advance for your help in solving the problem
28 ноября 2016, 19:05:06, от Ivan Kalinin < notifications@github.com >: @nataly22 could you please provide MVE and/or actual report (with source files and built reports)? — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub , or mute the thread .
@nataly22 however useful screenshots could be they fail to provide the most crucial information. Please attach a .tar.gz / .zip archive with the source code and reports to the github issue.
sending archive tmp_for_github.tar.gz reports.tar.gz
Apparently, you are doing screenshots wrong.
Contents of the attachment files are as follows:
pupssman@airship:~/Downloads $ cat ~/Downloads/3d95375c-d765-404a-9bf4-6c985832f0f2-attachment.png
Screen_start_pagepupssman@airship:~/Downloads $
I.e. there is plain text string Screen_start_page
instead of image data.
This may be caused by you explicitly commanding allure to attach that very plain text string in your code:
allure.attach('my attach','Screen_start_page', allure.attach_type.PNG)
As per allure's documentation, second argument to the allure.attach
method call is the file content to be attached, which one would expect to be the PNG raw data in your case, instead of the plain text string found in the code.
This appears to be a simple typo in the test code and is therefore not a problem with the allure or allure plugin at all.
Please, be more careful with your code and good luck)
Thanks for the advice. The problem was solved as follows:
#We take screenshots by comand of uiautomator
d.screenshot('/home/ngora//reports/ui/myattach.png')
#open file as in python
f = open('/home/ngora//reports/ui/myattach.png')
#read files content to second parameter of attach method
allure.attach('Start2_page',f.read(), type=AttachmentType.PNG)
Glad to know problem is solved
When I run autotests with pytest+Selenium WebDriver+allure - allure makes screenshots,
but I run autotests with pyTest_uiAutomator+allure on mobile device Android - I get error when want to look png.file with screenshots.
My testcode:
after that a have during open png file:: "Fatal error reading PNG image file: Not a PNG file"