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

Write screenshot to file #172

Merged
merged 13 commits into from
Jan 7, 2020
Merged

Write screenshot to file #172

merged 13 commits into from
Jan 7, 2020

Conversation

negiDharmendra
Copy link
Contributor

@negiDharmendra negiDharmendra commented Dec 9, 2019

  • Changed default screenshot grabber to write to file and return file path.
  • Depricate existing custom screenshot grabber API contract.
  • Create a new API contact for custom screenshot grabber to write the screenshot into file and returning file path instead of screenhsot bytes.
from getgauge.python import custom_screenshot_writer

@custom_screenshot_writer
def take_screenshot():
    conetnt = Driver.driver.get_screenshot_as_png()
    file_name = os.path.join(os.getenv("gauge_screenshots_dir"), "screenshot-file.png")
    file = open(file_name, "w")
    file.write(conetnt)
    return os.path.basename(file_name)

@gaugebot gaugebot bot added the cla-signed label Dec 9, 2019
@gaugebot gaugebot bot requested a review from BugDiver December 9, 2019 09:54
@negiDharmendra negiDharmendra force-pushed the write-screenshot-to-file branch 2 times, most recently from 0790c7b to a4782a8 Compare December 10, 2019 13:09
@BugDiver BugDiver self-requested a review December 11, 2019 11:55
getgauge/python.py Outdated Show resolved Hide resolved
tests/test_python.py Outdated Show resolved Hide resolved
BugDiver
BugDiver previously approved these changes Dec 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

2 participants