Last active
July 20, 2017 09:11
-
-
Save yaniviny/04f60665c18d614ac797faad8cfb0b3f to your computer and use it in GitHub Desktop.
Shows how PractiTest computes the run status of a test run
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
def compute_status | |
statuses = all_statuses.uniq - ['N/A'] #take all statuses, make them unique, remove 'N/A' | |
if statuses.include?("FAILED") #if you have FAILED, everything is FAILED | |
"FAILED" | |
elsif statuses.include?("BLOCKED") # otherwise, if you have BLOCKED, everything is set to BLOCKED | |
"BLOCKED" | |
elsif (statuses == ["NO RUN"]) || statuses.empty? # IF YOU HAVE "NO RUN", or don't have steps at all -> It should be no run | |
"NO RUN" | |
elsif statuses == ["PASSED"] #if you're left with only one status -> PASSED, it means that all steps are passed (we already did unique, remember?) | |
"PASSED" | |
else | |
"NOT COMPLETED" #otherwise, it's NOT COMPLETED | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment