C# Класс Meyn.TestLink.TestLink

this is the proxy class to connect to TestLink. It provides a list of functions that map straight into the Tstlink API as it stands at V 1.9.2
This class makes use of XML-RPC.NET Copyright (c) 2006 Charles Cook
Наследование: ITestLinkExtra
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
CreateBuild ( int testplanid, string buildname, string buildnotes ) : GeneralResult

create a build for a testplan

CreateProject ( string projectname, string testcasePrefix, string notes = "" ) : GeneralResult

create a new project

CreateTestCase ( string authorLogin, int testsuiteid, string testcasename, int testprojectid, string summary, TestStep steps, string keywords, int order, bool checkduplicatedname, ActionOnDuplicatedName actiononduplicatedname, int executiontype, int importance ) : GeneralResult

Create a new Test Case

CreateTestCase ( string authorLogin, int testsuiteid, string testcasename, int testprojectid, string summary, string keywords, int order, bool checkduplicatedname, ActionOnDuplicatedName actiononduplicatedname, int executiontype, int importance ) : GeneralResult

create a new Testcase without having to specify test steps

Create a new Test Case

CreateTestPlan ( string testplanname, string testProjectName, string notes = "", bool active = true ) : GeneralResult

create a new Testplan

CreateTestSuite ( int testprojectid, string testsuitename, string details, int parentId, int order, bool checkduplicatedname = true ) : GeneralResult

create a new test suite

DeleteExecution ( int executionid ) : GeneralResult

delete an execution. Current status this API is not fully functioning as it is not clear how to configure testlink to allow this to happen

DoesUserExist ( string username ) : bool

check for user id to see whether it exists

GetBuildsForTestPlan ( int testplanid ) : List

get a list of all builds for a testplan

GetFirstLevelTestSuitesForTestProject ( int testprojectid ) : List

get all top level test suites for a test project

GetLastExecutionResult ( int testplanid, int testcaseid ) : ExecutionResult

get the last execution result

GetLatestBuildForTestPlan ( int tplanid ) : Build

get the newest build for a test plan

GetProject ( string projectname ) : TestProject

get a single Project

GetProjectTestPlans ( int projectid ) : List

get a list of all testplans for a project

GetProjects ( ) : List

get a list of all projects

GetTestCase ( int testcaseid, int versionId ) : TestCase

get a test case by its id

GetTestCaseAttachments ( int testCaseId ) : List

retrieve the attachments for a test case

GetTestCaseIDByName ( string testcasename ) : List

get a list of test case ids with this name.

GetTestCaseIDByName ( string testcasename, int testSuiteId ) : List

get a test cases by this name

GetTestCaseIDByName ( string testcasename, string testsuitename ) : List

ask for a test case by name.

Searching is case sensitive.

GetTestCaseIdsForTestSuite ( int testSuiteid, bool deep ) : List

get a list of testcase ids of test cases contained in a test suite

GetTestCasesForTestPlan ( int testplanid ) : List

get all test cases for a test plan

GetTestCasesForTestPlan ( int testplanid, int testcaseid ) : List

get all test cases for a test plan .

The same test case id can show up multiple times, once per platform.

GetTestCasesForTestPlan ( int testplanid, int testcaseid, int buildid ) : List

get all test cases for a test plan .

The same test case id can show up multiple times, once per platform.

GetTestCasesForTestPlan ( int testplanid, int testcaseid, int buildid, int keywordid ) : List

get all test cases for a test plan .

The same test case id can show up multiple times, once per platform.

GetTestCasesForTestPlan ( int testplanid, int testcaseid, int buildid, int keywordid, bool executed ) : List

get all test cases for a test plan .

The same test case id can show up multiple times, once per platform.

GetTestCasesForTestPlan ( int testplanid, int testcaseid, int buildid, int keywordid, bool executed, int assignedTo ) : List

get all test cases for a test plan .

The same test case id can show up multiple times, once per platform.

GetTestCasesForTestPlan ( int testplanid, int testcaseid, int buildid, int keywordid, bool executed, int assignedTo, string executedstatus ) : List

get all test cases for a test plan .

The same test case id can show up multiple times, once per platform.

GetTestCasesForTestSuite ( int testSuiteid, bool deep ) : List

get test cases contained in a test suite

GetTestPlanPlatforms ( int testplanid ) : List

get a list of all platforms for a test plan.

Throws an exception of type Testlink Exception

GetTestSuiteById ( int id ) : TestSuite

get a test suite by its id

GetTestSuitesForTestPlan ( int testplanid ) : List

get test suites for a test plan

GetTestSuitesForTestSuite ( int testsuiteid ) : List
GetTotalsForTestPlan ( int testplanid ) : List

get totals for a testplan

If a test plan has no executions to it you will still get a list iwth a single item. That item will have zeros in its totals

ReportTCResult ( int testcaseid, int testplanid, TestCaseResultStatus status, int platformId, string platformName = null, bool overwrite = false, bool guess = true, string notes = "", int buildid, int bugid ) : GeneralResult

Record the outcome of a test case execution

SayHello ( ) : string

basic Ping

TestLink ( string apiKey, string url ) : System

default constructor

TestLink ( string apiKey, string url, bool log ) : System

constructor with debug key

constructor with URL and log flag

UploadExecutionAttachment ( int executionId, string filename, string fileType, byte content, string title = "", string description = "" ) : AttachmentRequestResponse

Uploads an attachment for an execution.

The attachment content must be Base64 encoded by the client before sending it.

UploadTestCaseAttachment ( int testcaseid, string filename, string fileType, byte content, string title, string description ) : AttachmentRequestResponse

upload an attachment for a test case

UploadTestProjectAttachment ( int executionId, string filename, string fileType, byte content, string title = "", string description = "" ) : AttachmentRequestResponse

upload an attachment to a test project

UploadTestSuiteAttachment ( int testsuiteid, string filename, string fileType, byte content, string title, string description ) : AttachmentRequestResponse

upload an attachment for a test case

about ( ) : string

Gets info about the API

addTestCaseToTestPlan ( int testprojectid, int testplanid, string testcaseexternalid, int version, int platformid ) : int

add a test case to a test plan (no way of removing one)

this testExternalid is a string and a concatenation of the test project prefix and the externalid that is reported in the test case creation.

checkDevKey ( string devkey ) : bool

check if Developer Key exists

getTestPlanByName ( string projectname, string planName ) : TestPlan

get a test plan for a project

Приватные методы

Метод Описание
decodeErrors ( IEnumerable messageList ) : List

internal. try to conver the struct to an error message. Return null if it wasn't one

decodeErrors ( object messageList ) : List
decodeSingleError ( CookComputing.XmlRpc.XmlRpcStruct message ) : TLErrorMessage
handleErrorMessage ( object errorMessage ) : bool

process the response object returned by the Tstlink API for error messages. if it finds one or more error messages it throws a TLINK Exception ///

handleErrorMessage ( object errorMessage, int exceptedErrorCodes ) : bool

process the response object returned by the Tstlink API for error messages. if it finds one or more error messages it throws a TLINK Exception ///

handleReportTCResult ( object response ) : GeneralResult
myHandler ( object sender, CookComputing.XmlRpc.XmlRpcRequestEventArgs args ) : void
processTestCaseId ( object response ) : List
proxy_ResponseEvent ( object sender, CookComputing.XmlRpc.XmlRpcResponseEventArgs args ) : void
stateIsValid ( ) : void

check that the state of the interface

Описание методов

CreateBuild() публичный Метод

create a build for a testplan
public CreateBuild ( int testplanid, string buildname, string buildnotes ) : GeneralResult
testplanid int id of the test plan
buildname string name of the build
buildnotes string notes
Результат GeneralResult

CreateProject() публичный Метод

create a new project
public CreateProject ( string projectname, string testcasePrefix, string notes = "" ) : GeneralResult
projectname string
testcasePrefix string prefix for test case ids
notes string
Результат GeneralResult

CreateTestCase() публичный Метод

Create a new Test Case
public CreateTestCase ( string authorLogin, int testsuiteid, string testcasename, int testprojectid, string summary, TestStep steps, string keywords, int order, bool checkduplicatedname, ActionOnDuplicatedName actiononduplicatedname, int executiontype, int importance ) : GeneralResult
authorLogin string login id of test case author
testsuiteid int Id of test suite
testcasename string name of test case
testprojectid int id of test project
summary string summary of result
steps TestStep Array of test steps
keywords string
order int defaultOrder = 0, otherwise location in sequence to other testcases
checkduplicatedname bool 1=yes, 0=no
actiononduplicatedname ActionOnDuplicatedName one of block, generate_new, create_new_version
executiontype int manual:1, automated: 2,
importance int Importance of test case
Результат GeneralResult

CreateTestCase() публичный Метод

create a new Testcase without having to specify test steps Create a new Test Case
public CreateTestCase ( string authorLogin, int testsuiteid, string testcasename, int testprojectid, string summary, string keywords, int order, bool checkduplicatedname, ActionOnDuplicatedName actiononduplicatedname, int executiontype, int importance ) : GeneralResult
authorLogin string login id of test case author
testsuiteid int Id of test suite
testcasename string name of test case
testprojectid int id of test project
summary string summary of result
keywords string
order int defaultOrder = 0, otherwise location in sequence to other testcases
checkduplicatedname bool 1=yes, 0=no
actiononduplicatedname ActionOnDuplicatedName one of block, generate_new, create_new_version
executiontype int manual:1, automated: 2,
importance int Importance of test case
Результат GeneralResult

CreateTestPlan() публичный Метод

create a new Testplan
public CreateTestPlan ( string testplanname, string testProjectName, string notes = "", bool active = true ) : GeneralResult
testplanname string the name of the plan
testProjectName string the name of the test project that contains the test plan
notes string
active bool whether this plan is currently active
Результат GeneralResult

CreateTestSuite() публичный Метод

create a new test suite
public CreateTestSuite ( int testprojectid, string testsuitename, string details, int parentId, int order, bool checkduplicatedname = true ) : GeneralResult
testprojectid int id of test project
testsuitename string Name of this test suite
details string
parentId int parent test suite id. Optional
order int display order with sibling test suites. Optional
checkduplicatedname bool if true, throw an error of a duplicate name exists. Optional, default=true
Результат GeneralResult

DeleteExecution() публичный Метод

delete an execution. Current status this API is not fully functioning as it is not clear how to configure testlink to allow this to happen
public DeleteExecution ( int executionid ) : GeneralResult
executionid int the id of the test case execution
Результат GeneralResult

DoesUserExist() публичный Метод

check for user id to see whether it exists
public DoesUserExist ( string username ) : bool
username string
Результат bool

GetBuildsForTestPlan() публичный Метод

get a list of all builds for a testplan
public GetBuildsForTestPlan ( int testplanid ) : List
testplanid int the id of the testplan
Результат List

GetFirstLevelTestSuitesForTestProject() публичный Метод

get all top level test suites for a test project
public GetFirstLevelTestSuitesForTestProject ( int testprojectid ) : List
testprojectid int
Результат List

GetLastExecutionResult() публичный Метод

get the last execution result
public GetLastExecutionResult ( int testplanid, int testcaseid ) : ExecutionResult
testplanid int id of the test plan
testcaseid int id of test case
Результат ExecutionResult

GetLatestBuildForTestPlan() публичный Метод

get the newest build for a test plan
public GetLatestBuildForTestPlan ( int tplanid ) : Build
tplanid int id of testplan
Результат Build

GetProject() публичный Метод

get a single Project
public GetProject ( string projectname ) : TestProject
projectname string
Результат TestProject

GetProjectTestPlans() публичный Метод

get a list of all testplans for a project
public GetProjectTestPlans ( int projectid ) : List
projectid int
Результат List

GetProjects() публичный Метод

get a list of all projects
public GetProjects ( ) : List
Результат List

GetTestCase() публичный Метод

get a test case by its id
public GetTestCase ( int testcaseid, int versionId ) : TestCase
testcaseid int Id of the test case
versionId int (optional) the version id. If not given the latest version is returned
Результат TestCase

GetTestCaseAttachments() публичный Метод

retrieve the attachments for a test case
public GetTestCaseAttachments ( int testCaseId ) : List
testCaseId int
Результат List

GetTestCaseIDByName() публичный Метод

get a list of test case ids with this name.
public GetTestCaseIDByName ( string testcasename ) : List
testcasename string name of the test case (case sensitive)
Результат List

GetTestCaseIDByName() публичный Метод

get a test cases by this name
public GetTestCaseIDByName ( string testcasename, int testSuiteId ) : List
testcasename string name of the test case (case sensitive)
testSuiteId int name of test suite
Результат List

GetTestCaseIDByName() публичный Метод

ask for a test case by name.
Searching is case sensitive.
public GetTestCaseIDByName ( string testcasename, string testsuitename ) : List
testcasename string the name of the test case
testsuitename string the name of the test suite
Результат List

GetTestCaseIdsForTestSuite() публичный Метод

get a list of testcase ids of test cases contained in a test suite
public GetTestCaseIdsForTestSuite ( int testSuiteid, bool deep ) : List
testSuiteid int id of the test suite
deep bool Set the deep flag to false if you only want test cases in the test suite provided and no child test cases.
Результат List

GetTestCasesForTestPlan() публичный Метод

get all test cases for a test plan
public GetTestCasesForTestPlan ( int testplanid ) : List
testplanid int
Результат List

GetTestCasesForTestPlan() публичный Метод

get all test cases for a test plan .
The same test case id can show up multiple times, once per platform.
public GetTestCasesForTestPlan ( int testplanid, int testcaseid ) : List
testplanid int
testcaseid int
Результат List

GetTestCasesForTestPlan() публичный Метод

get all test cases for a test plan .
The same test case id can show up multiple times, once per platform.
public GetTestCasesForTestPlan ( int testplanid, int testcaseid, int buildid ) : List
testplanid int
testcaseid int
buildid int
Результат List

GetTestCasesForTestPlan() публичный Метод

get all test cases for a test plan .
The same test case id can show up multiple times, once per platform.
public GetTestCasesForTestPlan ( int testplanid, int testcaseid, int buildid, int keywordid ) : List
testplanid int
testcaseid int
buildid int
keywordid int
Результат List

GetTestCasesForTestPlan() публичный Метод

get all test cases for a test plan .
The same test case id can show up multiple times, once per platform.
public GetTestCasesForTestPlan ( int testplanid, int testcaseid, int buildid, int keywordid, bool executed ) : List
testplanid int
testcaseid int
buildid int
keywordid int
executed bool
Результат List

GetTestCasesForTestPlan() публичный Метод

get all test cases for a test plan .
The same test case id can show up multiple times, once per platform.
public GetTestCasesForTestPlan ( int testplanid, int testcaseid, int buildid, int keywordid, bool executed, int assignedTo ) : List
testplanid int
testcaseid int
buildid int
keywordid int
executed bool
assignedTo int
Результат List

GetTestCasesForTestPlan() публичный Метод

get all test cases for a test plan .
The same test case id can show up multiple times, once per platform.
public GetTestCasesForTestPlan ( int testplanid, int testcaseid, int buildid, int keywordid, bool executed, int assignedTo, string executedstatus ) : List
testplanid int
testcaseid int
buildid int
keywordid int
executed bool
assignedTo int
executedstatus string
Результат List

GetTestCasesForTestSuite() публичный Метод

get test cases contained in a test suite
public GetTestCasesForTestSuite ( int testSuiteid, bool deep ) : List
testSuiteid int id of the test suite
deep bool Set the deep flag to false if you only want test cases in the test suite provided and no child test cases.
Результат List

GetTestPlanPlatforms() публичный Метод

get a list of all platforms for a test plan.
Throws an exception of type Testlink Exception
public GetTestPlanPlatforms ( int testplanid ) : List
testplanid int
Результат List

GetTestSuiteById() публичный Метод

get a test suite by its id
public GetTestSuiteById ( int id ) : TestSuite
id int
Результат TestSuite

GetTestSuitesForTestPlan() публичный Метод

get test suites for a test plan
public GetTestSuitesForTestPlan ( int testplanid ) : List
testplanid int
Результат List

GetTestSuitesForTestSuite() публичный Метод

public GetTestSuitesForTestSuite ( int testsuiteid ) : List
testsuiteid int
Результат List

GetTotalsForTestPlan() публичный Метод

get totals for a testplan
If a test plan has no executions to it you will still get a list iwth a single item. That item will have zeros in its totals
public GetTotalsForTestPlan ( int testplanid ) : List
testplanid int
Результат List

ReportTCResult() публичный Метод

Record the outcome of a test case execution
public ReportTCResult ( int testcaseid, int testplanid, TestCaseResultStatus status, int platformId, string platformName = null, bool overwrite = false, bool guess = true, string notes = "", int buildid, int bugid ) : GeneralResult
testcaseid int Id of test case
testplanid int Id of test plan
status TestCaseResultStatus The result of the test (pass, fail or blocked)
platformId int Id of the platform. Optional if platform name is given
platformName string name of the platform. Optional if the platform id is given
overwrite bool if true, then last execution for (testcase,testplan,build,platform) will be overwritten.
guess bool (assumed to be true) defining whether to guess optinal params or require them explicitly default is true
notes string any notes or info to be added to the description field
buildid int If not given, then highest build id willl be used
bugid int Id for a bug if used in conjunction with a defect tracker
Результат GeneralResult

SayHello() публичный Метод

basic Ping
public SayHello ( ) : string
Результат string

TestLink() публичный Метод

default constructor
public TestLink ( string apiKey, string url ) : System
apiKey string developer key as provided by testlink
url string url of testlink API. Something like http://localhost/testlink/lib/api/xmlrpc.php
Результат System

TestLink() публичный Метод

constructor with debug key constructor with URL and log flag
public TestLink ( string apiKey, string url, bool log ) : System
apiKey string
url string url of testlink API. Something like http://localhost/testlink/lib/api/xmlrpc.php
log bool if true then keep last request and last response
Результат System

UploadExecutionAttachment() публичный Метод

Uploads an attachment for an execution.
The attachment content must be Base64 encoded by the client before sending it.
public UploadExecutionAttachment ( int executionId, string filename, string fileType, byte content, string title = "", string description = "" ) : AttachmentRequestResponse
executionId int
filename string The file name of the Attachment (e.g.:notes.txt)
fileType string The file type of the Attachment (e.g.: text/plain)
content byte The content (Base64 encoded) of the Attachment
title string The title of the Attachment
description string The description of the Attachment
Результат AttachmentRequestResponse

UploadTestCaseAttachment() публичный Метод

upload an attachment for a test case
public UploadTestCaseAttachment ( int testcaseid, string filename, string fileType, byte content, string title, string description ) : AttachmentRequestResponse
testcaseid int
filename string
fileType string
content byte
title string
description string
Результат AttachmentRequestResponse

UploadTestProjectAttachment() публичный Метод

upload an attachment to a test project
public UploadTestProjectAttachment ( int executionId, string filename, string fileType, byte content, string title = "", string description = "" ) : AttachmentRequestResponse
executionId int
filename string
fileType string
content byte
title string
description string
Результат AttachmentRequestResponse

UploadTestSuiteAttachment() публичный Метод

upload an attachment for a test case
public UploadTestSuiteAttachment ( int testsuiteid, string filename, string fileType, byte content, string title, string description ) : AttachmentRequestResponse
testsuiteid int
filename string
fileType string
content byte
title string
description string
Результат AttachmentRequestResponse

about() публичный Метод

Gets info about the API
public about ( ) : string
Результат string

addTestCaseToTestPlan() публичный Метод

add a test case to a test plan (no way of removing one)
this testExternalid is a string and a concatenation of the test project prefix and the externalid that is reported in the test case creation.
public addTestCaseToTestPlan ( int testprojectid, int testplanid, string testcaseexternalid, int version, int platformid ) : int
testprojectid int
testplanid int
testcaseexternalid string the id that is displayed on the GUI
version int
platformid int
Результат int

checkDevKey() публичный Метод

check if Developer Key exists
public checkDevKey ( string devkey ) : bool
devkey string
Результат bool

getTestPlanByName() публичный Метод

get a test plan for a project
public getTestPlanByName ( string projectname, string planName ) : TestPlan
projectname string the name of the owning project
planName string
Результат TestPlan