hrcorval / behavex

BDD testing solution designed to enhance your Behave-based testing workflows
https://github.com/hrcorval/behavex
MIT License
89 stars 20 forks source link

context.evidence_path does not exist #9

Closed kappa10j closed 2 years ago

kappa10j commented 2 years ago

Describe the bug def after_scenario(context, scenario): context.browser.save_screenshot(context.evidence_path)

context doesn't have an evidence_path

AttributeError("'Context' object has no attribute 'evidence_path'")

behavex 1.5.3 Windows 10 python 3.10.2

kappa10j commented 2 years ago

I thought I could save the file directly but I still dotn see it in the report

context.browser.savescreenshot("./output/outputs/logs/{0}/{0}.jpg".format(scenario.name).replace(" ",""))

anibalinn commented 2 years ago

I'll take a look at this issue. There might be a condition that causes this variable not to be generated

kappa10j commented 2 years ago

Thanks. I've checked with the approved python versions and it's not the python version.

On Tue, Feb 22, 2022, 4:15 PM anibalinn @.***> wrote:

I'll take a look at this issue. There might be a condition that causes this variable not to be generated

— Reply to this email directly, view it on GitHub https://github.com/hrcorval/behavex/issues/9#issuecomment-1048218560, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACYYFHXIGWUY4IFFXLZ7L63U4P4H7ANCNFSM5OSVJ6CQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you authored the thread.Message ID: @.***>

hrcorval commented 2 years ago

Despite we are not being able to reproduce the issue, We have done a small improvement in upcoming version (v1.5.4). We can give it a try, and if the problem persists we can keep this thread open.

hrcorval commented 2 years ago

Hi Kappa, Is this issue still happening in BehaveX 1.5.9? We are not able to reproduce it. Thanks!

kappa10j commented 2 years ago

I do still see the issue. Maybe I'm misunderstanding how it should work. What logs can i provide you?

The after_scenario function is in my environment.py file

prsnth89 commented 2 years ago

Hello,

Does anyone could help on taking screenshots and attaching to behavex html report?

My scenario is whenever a step gets failed i need to take screenshot and place it html report, currently i could take screenshot for each and every step but facing couple of issues 1) Should take screenshot only during failures [In java cucumber we have a method like step.isFailed() then take screenshot 2) Screenshot image should be attached in report

my environment.py is

def after_step(context, step): print(step) print(f"----after step---") evidence_path = './output/outputs/logs/test.png' context.driver.save_screenshot(evidence_path) print("stored screenshot successfully")

My POC in python was successful along with this great plugin, i just got blocked with this issue alone, it would be very helpful if some could answer on this

hrcorval commented 2 years ago

We have tested multiple variations of this implementation, and we could not reproduce this issue. We can reopen this issue if we are getting provided of some additional context or steps to reproduce it. Thanks