fsprojects / Canopy.Mobile

Canopy testing framework for mobile apps
https://fsprojects.github.io/Canopy.Mobile/
MIT License
14 stars 12 forks source link

Take Screenshot when "find" fails #14

Open forki opened 7 years ago

forki commented 7 years ago

When a find operation times out we should capture a screenshot and trace other avaliable elements. @lefthandedgoat is there already a special way how canopy proper does it? I personally would use a configuration variable for the path and just activate this by default. It's probably also important to trace other elements that we can find on the page.

@part-timedev this is particularly important on the CI. Do we already know if we can tell gitlab that we have special artifacts?

lefthandedgoat commented 7 years ago

I do screenshots on any failure in canopy, but the only way I know to do it is in the runner. Do you know if Expecto has an "On Fail" thing we can hook into and make it screenshot then?

forki commented 7 years ago

/cc @haf @Krzysztof-Cieslak

haf commented 7 years ago
open Expecto
let testCase name fn =
  testCase name <| fun () -> try fn () with e -> // take screenshot
forki commented 7 years ago

That's a really nice way to do it. Thanks.

Am 24.12.2016 7:31 nachm. schrieb "Henrik Feldt" notifications@github.com:

open Expectolet testCase name fn = testCase name <| fun () -> try fn () with e -> // take screenshot

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/fsprojects/Canopy.Mobile/issues/14#issuecomment-269095350, or mute the thread https://github.com/notifications/unsubscribe-auth/AADgNFxYij1XQLhD8VyqvWROLxqZzlEVks5rLWTxgaJpZM4LUqPF .

forki commented 7 years ago

Actually this is so simple and yet so effective. Decades of nunit style have made me a bit blind.

Am 24.12.2016 7:34 nachm. schrieb "Steffen Forkmann" sforkmann@gmail.com:

That's a really nice way to do it. Thanks.

Am 24.12.2016 7:31 nachm. schrieb "Henrik Feldt" <notifications@github.com

:

open Expectolet testCase name fn = testCase name <| fun () -> try fn () with e -> // take screenshot

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/fsprojects/Canopy.Mobile/issues/14#issuecomment-269095350, or mute the thread https://github.com/notifications/unsubscribe-auth/AADgNFxYij1XQLhD8VyqvWROLxqZzlEVks5rLWTxgaJpZM4LUqPF .

forki commented 7 years ago

this works very well. we should document it