Skip to content
This repository has been archived by the owner on Mar 3, 2020. It is now read-only.

Need an option to disable ClickFailed screenshots, better logging #626

Closed
bilts opened this issue Mar 25, 2014 · 6 comments
Closed

Need an option to disable ClickFailed screenshots, better logging #626

bilts opened this issue Mar 25, 2014 · 6 comments
Assignees
Labels
Milestone

Comments

@bilts
Copy link

bilts commented Mar 25, 2014

We ended up with over 14,000 ClickFailed screenshots in our CI /tmp directory, I assume due to some sort of synchronization loop (Capybara::Webkit::ClickFailed is returned by invalid_element_errors, indicating Capybara should retry it), though the test logs do not report an abnormal number of screenshots.

The new ClickFailed screenshot feature should be refined to address this in a couple of ways:

  1. There should be a configuration option to disable the screenshot behavior entirely.
  2. (Ideally) The driver should avoid taking screenshots repeatedly in sync loops.
  3. (Alternatively) Every screenshot taken should be logged, regardless of whether its associated error is thrown, making this sort of problem easier to spot.
@jferris
Copy link
Contributor

jferris commented Mar 25, 2014

Saving screenshots during the retry loop was unintentional. I'll look into a way to reduce the number of screenshots we're saving here. I'll try to take care of number two. I'd be interested in a tested pull request that adds number one.

ps - your avatar is a baby, so I read your message in a baby voice in my head

@calleluks
Copy link

@jferris Did you look into reducing the number of screenshots saved? Can this issue be closed?

@jferris
Copy link
Contributor

jferris commented Jun 5, 2015

I haven't yet, no.

@jferris jferris self-assigned this Jun 5, 2015
@jferris jferris added the bug label Jun 5, 2015
@jferris jferris added this to the 1.5.3 milestone Jun 5, 2015
@jferris
Copy link
Contributor

jferris commented Jun 5, 2015

@mhoran any thoughts on this? I don't see a place in the driver API where we would make this change. It may make more sense to remove this auto-screenshot behavior and try to get something more generic into Capybara for saving screenshots for certain errors.

@mhoran
Copy link
Collaborator

mhoran commented Jun 5, 2015

I agree. Let's pull this out of capybara-webkit for now.

jferris added a commit that referenced this issue Jun 26, 2015
We can't distinguish between ClickFailed errors which will be retried,
and those which have actually failed for good. This means we end up
writing hundreds of screenshot files during a failure, and we sometimes
write several screenshot files even when the click ends up working.

This isn't feasible to work around in a driver, so this commit removes
the behavior from capybara-webkit. Something like this may make more
sense in Capybara proper.

Resolves #626.
@jferris
Copy link
Contributor

jferris commented Jun 26, 2015

I opened #800 to resolve this issue.

@jferris jferris closed this as completed Jun 26, 2015
@jferris jferris added this to the 2.0.0 milestone Jun 26, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants