Support screenshots #165

Merged
merged 6 commits into from Dec 4, 2014

Projects

None yet

4 participants

@raimohanska
Contributor

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

See the updated README.md for details.

@nathanboktae

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")

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
Owner

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
Contributor

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
Contributor

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

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

Thanks for the contribution!

@raimohanska
Contributor

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

@metaskills
Collaborator

Love this feature, awesome work y'all!

@metaskills
Collaborator

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