Próbuję dowiedzieć się, jak uzyskać wyniki testu dla Canopy, aby pokazać w eksploratorze testu VS. Mogę sprawić, że moje testy się pokażą, a on je uruchomi, ale zawsze pokazuje przepustkę. Wydaje się, że funkcja Run() "je" wyniki, więc VS nigdy nie widzi awarii.Chcę, aby wyniki testów sieci Web Canopy były wyświetlane w eksploratorze testowym VS 2013 ... i jestem TAK ZAMKNIJ
Jestem pewien, że jest to konflikt między tym, jak Canopy dobrze interpretuje wyjątki, które dostaje w wynikach testów, ponieważ normalnie chciałbyś, aby Run() odniósł sukces niezależnie od wyniku i raportował wyniki za pomocą własnych raportów.
Może powinienem przekierować wyjście i zinterpretować to w kodzie testowania MS?
Więc tutaj jest jak mam to skonfigurować teraz ...
Visual Studio testu Runner patrzy na ten plik za to, co widzi jako testy te wywołać metody baldachim, które wykonują prawdziwe testy.
open canopy
open runner
open System
open Microsoft.VisualStudio.TestTools.UnitTesting
[<TestClass>]
type testrun() =
// Look in the output directory for the web drivers
[<ClassInitialize>]
static member public setup(context : TestContext) =
// Look in the output directory for the web drivers
canopy.configuration.ieDir <- "."
canopy.configuration.chromeDir <- "."
// start an instance of the browser
start ie
()
[<TestMethod>]
member x.LocationNoteTest() =
let myTestModule = new myTestModule()
myTestModule.all()
run()
[<ClassCleanup>]
static member public cleanUpAfterTesting() =
quit()
()
myTestModule wygląda
open canopy
open runner
open System
type myTestModule() =
// some helper methods
member x.basicCreate() =
context "The meat of my tests"
"Test1" &&& fun _ ->
// some canopy test statements like...
url "http://theURL.com/"
"#title" == "The title of my page"
//Does the text of the button match expectations?
"#addLocation" == "LOCATION"
// add a location note
click ".btn-Location"
member x.all() =
x.basicCreate()
// I could add additional tests here or I could decide to call them individually
Udało ci się? Jeśli tak, jak to zrobiłeś? Jak można się domyślić, interesuje mnie również integracja VS. :) – Veksi
Tak, zobacz odpowiedź poniżej –