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

Support screenshots #165

Merged
merged 6 commits into from Dec 4, 2014

Conversation

Projects
None yet
4 participants
@raimohanska
Copy link
Contributor

raimohanska commented Dec 4, 2014

Related to #130, now you can take screenshots in your tests.

See the updated README.md for details.

@nathanboktae

This comment has been minimized.

Copy link

nathanboktae commented on lib/mocha-phantomjs.coffee in 0291907 Dec 4, 2014

I wouldn't force the phantom-screenshot-#{name} format

else if data?.hasOwnProperty('screenshot')
  name = data.screenshot or "mocha-phantomjs-" + new Date().getTime()
  @page.render(name + ".png")

This comment has been minimized.

Copy link

nathanboktae replied Dec 4, 2014

oh saw you already did that. Either way screenshot is required, so this is simple enough

else if typeof data?.screenshot is string
  @page.render(data.screenshot + ".png")
@nathanboktae

This comment has been minimized.

Copy link
Owner

nathanboktae commented Dec 4, 2014

Can you add a test too? thanks. Take a look at some of the --file tests that look for existence of a file if you need help.

@raimohanska

This comment has been minimized.

Copy link
Contributor Author

raimohanska commented Dec 4, 2014

Hi, I'll definitely simplify the impl and add a test as soon as I get a suitable timeslot for that. Thanks for timely response!

@raimohanska

This comment has been minimized.

Copy link
Contributor Author

raimohanska commented Dec 4, 2014

There you go! I added a simple test for the existence of the expected screenshot file. After test, the file is deleted.

nathanboktae added a commit that referenced this pull request Dec 4, 2014

Merge pull request #165 from raimohanska/master
Support screenshot capturing

@nathanboktae nathanboktae merged commit 683d78c into nathanboktae:master Dec 4, 2014

1 check passed

continuous-integration/travis-ci The Travis CI build passed
Details
@nathanboktae

This comment has been minimized.

Copy link
Owner

nathanboktae commented Dec 4, 2014

Thanks for the contribution!

@raimohanska

This comment has been minimized.

Copy link
Contributor Author

raimohanska commented Dec 4, 2014

You're very welcome. Thanks for your good work on mocha-phantomjs!

@metaskills

This comment has been minimized.

Copy link
Collaborator

metaskills commented Dec 5, 2014

Love this feature, awesome work y'all!

@metaskills

This comment has been minimized.

Copy link
Collaborator

metaskills commented Dec 5, 2014

I just published and tagged v3.5.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.