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

Failed before blocks don't save screenshots #72

Closed
jkrems opened this issue May 27, 2014 · 1 comment
Closed

Failed before blocks don't save screenshots #72

jkrems opened this issue May 27, 2014 · 1 comment

Comments

@jkrems
Copy link
Contributor

jkrems commented May 27, 2014

When tests fail, testium saves screenshots. Unfortunately the same does not happen for before blocks which makes debugging them pretty hard.

@EndangeredMassa
Copy link
Collaborator

Failures in before hooks cancel the entire sub-suite to which they are attached. It will run after hooks, but not afterEach. I'm not sure if that is the intent, though. mochajs/mocha#1043

I tried setting up a global beforeEach hook to save the test context and grab a screenshot if the previous test context still existed (implying the after hook didn't fire), but before hooks are called (and failed in this use case) before beforeEach hooks.

We can't wrap before with special handling because mocha redefines it's globals in between each file.

It looks like the only fix is to change mocha itself. I am hoping that mochajs/mocha#1139 gets some attention.

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

No branches or pull requests

2 participants