HuddleEng / PhantomFlow

Describe and visualise user flows through tests with PhantomJS
MIT License
682 stars 60 forks source link

Fail test when targeted element does not exist #13

Closed NiGhTTraX closed 10 years ago

NiGhTTraX commented 10 years ago

Fixes #12.

This fix tests for the presence of the word failed in the output from PhantomCSS. The context in which it can appear is when the screenshot capture fails e.g.:

[PhantomCSS] Screenshot capture failed:  No element matching selector found: #foo

Thus, the respective line is pushed into the errors array and the failCount incremented. This ensures that the test is marked as failed and a non-zero exit code will be returned.

I've also removed all trailing whitespace.

Any feedback is appreciated.

NiGhTTraX commented 10 years ago

@jamescryer please review.