Created
September 7, 2020 20:48
-
-
Save SnapperGee/e3885deceecae47b302a8773aec9195a to your computer and use it in GitHub Desktop.
Gradle task that opens generated unit test summary results HTML page
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* This Gradle task assumes 2 things: | |
* | |
* 1.) The "open" command of the shell this task is executed in opens HTML files with a web browser. | |
* 2.) The name of the generated test report summary HTML page created by the Test task is set to its default name of "index.html". | |
*/ | |
tasks.register("view-testreport", Exec) | |
{ | |
dependsOn += test | |
shouldRunAfter test | |
group = 'View' | |
description = 'Opens unit test results summary HTML page in a web browser' | |
workingDir = test.reports.html.destination | |
executable = 'open' | |
args += 'index.html' | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment