Manual Test Cases from code

1 Simple form:
Close-TMXTestResult -Id [optional test case id] -Name [optional test case name] -TestPassed [bool: red vs green] -KnownIssue [bool: olive if it's a temporary problem until a next build]

from other frameworks:
Get-UIAWindow -n calc* | Get-UIAButton -n 1 -TestPassed -TestResultName "...name..."

2 full form:
New-TMXTestSuite -Id 1 -Name suite1; # create a new test suite
New-TMXTestSuite -Id 02 -Name suite02; # create one more test suite
Open-TMXTestSuite -Id 1 -Name suite1; # switch to the first test suite (another test suite is now active)
Add-TMXTestScenario -Id 001 -Name scenario1 # add a scenario to the last created/opened suite
Add-TMXTestScenario -Name scenario2 -TestSuiteName suite02 # add a scenario to the suite you specified by name or by id

You can observe the result by using Search- cmdlets described here: Filtering and sorting test results or via static testdata collection:
[TMX.TestData]::TestSuites
[TMX.TestData]::TestSuites[0].TestScenarios
[TMX.TestData]::TestSuites[1].TestScenarios

You can also add more details to a test results:
...code...
Add-TMXTestResultDetail -TestResultDetail "comment" # for example, this can be used in a logical operator
...code...
Add-TMXTestResultDetail -TestResultDetail "comment" 
...code...
Close-TMXTestResult -Name ... -TestPassed:$true or -TestPassed:$false 

all test result details added before the Close- cmdlet are part of this test result. Screenshots are added to test results automatically (UIAutomation, SePSX).

Last edited Apr 15, 2013 at 11:03 AM by josekardano, version 1

Comments

No comments yet.