Code Monkey home page Code Monkey logo

Comments (8)

nataly22 avatar nataly22 commented on August 18, 2024 3

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

allure dashboard

test_registration_a
sttings_a
po_start_page_a
po_android_dev_page_a
functions_a
func_func
report_picture_open
6c4722c5 a378 4bf6 822a c4deb88c6310 testsuite xml
screen_with_report

from allure-pytest.

pupssman avatar pupssman commented on August 18, 2024

@nataly22 could you please provide MVE and/or actual report (with source files and built reports)?

from allure-pytest.

nataly22 avatar nataly22 commented on August 18, 2024

from allure-pytest.

pupssman avatar pupssman commented on August 18, 2024

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

from allure-pytest.

nataly22 avatar nataly22 commented on August 18, 2024

sending archive
tmp_for_github.tar.gz
reports.tar.gz

from allure-pytest.

pupssman avatar pupssman commented on August 18, 2024

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)

from allure-pytest.

nataly22 avatar nataly22 commented on August 18, 2024

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)

good_end

from allure-pytest.

pupssman avatar pupssman commented on August 18, 2024

Glad to know problem is solved

from allure-pytest.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.