mercredi 16 octobre 2019

How to generate functional test html report in golang?

I am new to golang and i need to generate a html report of the functional tests that we are running. I searched for some built-in plugins that have this capability but couldn't find one. Basically I want the PASS/FAIL data that usually generates in the console when i run below code:

go test -run=TestRunAll

I get below report at the end

--- PASS: TestRunAll/Positive_Tests (255.24s)
    --- PASS: TestRunAll/Positive_Tests/Positive_Test1 (28.48s)
        --- PASS: TestRunAll/Positive_Tests/Positive_Test1/Test1 (15.88s)
        --- PASS: TestRunAll/Positive_Tests/Positive_Test1/Test2 (7.38s)
        --- PASS: TestRunAll/Positive_Tests/Positive_Test1/Test3 (5.22s)

I want a simple html report with below format:

Positive_Test1/Test1 PASS
Positive_Test1/Test2 PASS
Positive_Test1/Test3 FAIL

Aucun commentaire:

Enregistrer un commentaire