Take screenshot to specific folder with timestamp name and embed

1,754 views
Skip to first unread message

Alexander Khozya

unread,
Jan 21, 2013, 8:05:49 AM1/21/13
to calaba...@googlegroups.com
1. Is there a global switch for screenshot path?
Our developers integrated Calabash in their way. And now if I launch test 
NO_LAUNCH=1 cucumber features/create_account.feature -f junit -o test-reports -f html -o report/calabash.html

screenshots are taken from directory Calabash was launched and my screenshots are stored in that folder. It results not showing them my calabash.html (because they're stored one folder up) How do I specify path for screenshot and for screenshot_and_raise?

2. How do I specify timestamp for screenshot name? I saw Rakesh post about screenshots, but you've said that this functionality was changed.

Thanks in advance!

Krukow

unread,
Jan 21, 2013, 5:02:32 PM1/21/13
to calaba...@googlegroups.com
Try something like:

screenshot_embed(:prefix => "/my/special/path", :name => "sc_#{Time.now.to_i}")

- Karl

Alexander Khozya

unread,
Jan 22, 2013, 8:30:37 AM1/22/13
to calaba...@googlegroups.com
Thank you help! It saves screenshot, but something is with embedding it into HTML file

I take screenshot with this command: screenshot_embed(:prefix => "test-reports/", :name => "sc_#{Time.now.to_i}")
I launch test with: NO_LAUNCH=1 cucumber features/spp.feature -f junit -o test-reports -f html -o test-reports/calabash.html
I have report calabash.html and screenshots in one folder, but pictures aren't displayed. Path for images inside HTML is test-reports/screenshot_name.png. But to be displayed, path shouldn't include "test-reports". 

Not sure what am I doing wrong.

Alexander Khozya

unread,
Jan 22, 2013, 1:52:27 PM1/22/13
to calaba...@googlegroups.com

Krukow

unread,
Jan 22, 2013, 4:28:03 PM1/22/13
to calaba...@googlegroups.com
Oh, I somehow missed that :)

Will try to fix with next release.

Alexander Khozya

unread,
Feb 11, 2013, 10:56:28 AM2/11/13
to calaba...@googlegroups.com
Is this bug fixed in 0.9.132? Calabash is integrated into out app with different way, so it require developer's help to update Calabash. Don't want to break anything if it's not fixed :)
Thanks in advance!

Krukow

unread,
Feb 12, 2013, 8:29:31 AM2/12/13
to calaba...@googlegroups.com
Nope, not fixed yet. Sorry.
Reply all
Reply to author
Forward
0 new messages