featurist / browser-monkey

Reliable DOM testing
https://browsermonkey.org
53 stars 6 forks source link

Print the DOM when an element can't be found? #40

Open joshski opened 8 years ago

joshski commented 8 years ago

I think this is a controversial request, so I thought I'd see how others feel about it. I'd like to know what was in the DOM when browser-monkey fails to find something.

Even if it's noisy, I'd personally prefer it most of the time if I knew what was in the DOM, i.e. instead of:

Error: expected to find: .navigation .btn[disabled]

...I would like to see:

Error: expected to find: .navigation .btn[disabled] in <html>...[very long string]...</html>

What do others think? Can I add this feature, and should it be disabled by default?

dereke commented 8 years ago

I would love more contextual information about errors!