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

allure plugin for robotframework-seleniumlibrary #476

Open
1 of 3 tasks
skhomuti opened this issue Mar 5, 2020 · 6 comments
Open
1 of 3 tasks

allure plugin for robotframework-seleniumlibrary #476

skhomuti opened this issue Mar 5, 2020 · 6 comments

Comments

@skhomuti
Copy link
Collaborator

skhomuti commented Mar 5, 2020

I'm submitting a ...

  • bug report
  • feature request
  • support request => Please do not submit support request here, see note at the top of this template.

This could be an good example or part of a robot adapter

import allure
from SeleniumLibrary import ScreenshotKeywords
from SeleniumLibrary.base import keyword, LibraryComponent


class AllureSeleniumPlugin(LibraryComponent):

    @keyword
    def capture_page_screenshot(self, filename='selenium-screenshot-{index}.png'):
        path = ScreenshotKeywords(ctx=self.ctx).capture_page_screenshot(filename)
        allure.attach.file(path, attachment_type=allure.attachment_type.PNG)
Library     SeleniumLibrary     plugins=AllureSeleniumPlugin
@fengnex
Copy link

fengnex commented Nov 17, 2020

The bug still exists in v2.8.19, the latest version of allure-robotframework!

I wonder how to fix it, and can anyone help out?

Hope the abover planned new feature would be implemented soon!

@fengnex
Copy link

fengnex commented Nov 18, 2020

@skhomuti Is there any plan for that?
There has been more than eight months since you opened the feature on 5 March!

@skhomuti
Copy link
Collaborator Author

@fengnex plan for what? This is a feature request. There is no bug here.

there are several ways to attach screenshots to a report. In this task, one of them is indicated - just copy this code to yourself, and add an argument to the selenium library.

@fengnex
Copy link

fengnex commented Nov 19, 2020

@skhomuti
Thanks for your kind response first.

I'm just not sure whether the above code will work and what the required all modifications should be. You know, it seems that there are no proper ways to test it right now, but anyway I will try to confirm your opinion.

@skhomuti
Copy link
Collaborator Author

@fengnex I have prepared an example using this plugin. Let me know if it doesn't work for you
https://github.com/skhomuti/allure-robotframework-screenshot-example

@vploaia
Copy link

vploaia commented Nov 19, 2020

Hi @skhomuti
I receive AttributeError: 'function' object has no attribute 'file'
at
allure.attach.file(path, attachment_type=allure.attachment_type.PNG).
Actually, print(dir(allure.attach)) returns the following:
'['call', 'class', 'delattr', 'dir', 'doc', 'eq', 'format', 'func', 'ge', 'get', 'getattribute', 'gt', 'hash', 'init', 'init_subclass', 'le', 'lt', 'ne', 'new', 'reduce', 'reduce_ex', 'repr', 'self', 'setattr', 'sizeof', 'str', 'subclasshook']'
Could you please take a look?

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

No branches or pull requests

4 participants