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

"Screenshot could not be saved. (...) No such file or directory" - tmp/capybara does not exist yet #227

Open
marekciupak opened this issue Apr 5, 2018 · 1 comment
Labels

Comments

@marekciupak
Copy link

Hi,

I've got the following error:

WARN: Screenshot could not be saved. An exception is raised: #<Errno::ENOENT: No such file or directory @ rb_sysopen - /home/circleci/XXX/tmp/capybara/screenshot_2018-04-05-04-39-52.104.png>.

Here is my temporary solution:

# features/env.rb

# ....
Dir.mkdir(Capybara.save_path) unless Dir.exist?(Capybara.save_path)

I guess it would be good to fix the problem on the gem level.

Best,
Marek

@marekciupak
Copy link
Author

Ah, and there is one important thing when it comes to reproducing the issue :-)

The problem occurs only when the directory does not exist yet and you explicitly use:

Capybara::Screenshot.screenshot_and_open_image

When the test simply fails (without any usage of Capybara::Screenshot.screenshot_and_open_image), then the directory is created without problems and the screenshot is saved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants