ZephyrScale.Rest.Sdk
1.0.0.7
See the version list below for details.
dotnet add package ZephyrScale.Rest.Sdk --version 1.0.0.7
NuGet\Install-Package ZephyrScale.Rest.Sdk -Version 1.0.0.7
<PackageReference Include="ZephyrScale.Rest.Sdk" Version="1.0.0.7" />
paket add ZephyrScale.Rest.Sdk --version 1.0.0.7
#r "nuget: ZephyrScale.Rest.Sdk, 1.0.0.7"
// Install ZephyrScale.Rest.Sdk as a Cake Addin #addin nuget:?package=ZephyrScale.Rest.Sdk&version=1.0.0.7 // Install ZephyrScale.Rest.Sdk as a Cake Tool #tool nuget:?package=ZephyrScale.Rest.Sdk&version=1.0.0.7
ZephyrScale.Rest.Sdk
SDK to connect to the Zephyr Scale app using Zephyr Scale's Rest endpoints. Manage your communication and easily retrieve and publish test cases, test cycle and execution results to Zephyr Scale. You can integrate with you existing automation solution or process that will manage these process. Support both Server and Cloud hosted Zephyr Scale application.
For more information on Zeyhpr Scale cloud rest endpoints: https://support.smartbear.com/zephyr-scale-cloud/api-docs/
For more information on Zephyr Scale server rest endpoints: https://support.smartbear.com/zephyr-scale-server/api-docs/v1/
The request and response objects are having proper DTOS (data transfer or model objects) defined within this package.
Nuget package link: https://www.nuget.org/packages/ZephyrScale.Rest.Sdk
How to Use
Connect to service
//Connect to cloud hosted Zephyr Scale service
var zService = new ZephyrScaleCloudService("app url", "user api token");
//Connect to server hosted Zephyr Scale service
var zService = new ZephyrScaleOnPremService("app url", "username", "password");
//Get a test case by Key
var testCase = zService.TestCasesGet("POC-T1");
//Create a new Test case
var newTestCase = ZephyrOnPremService.TestCaseCreate(new TestCaseCreateRequest
{
ProjectKey = "PCO",
Folder = "/Automation",
Name = "Verify the integration between app and zyphr",
IssueLinks = new[] { "PCO-1432", "PCO-23" }.ToList(),
Owner = "peterjoseph",
Labels = new[] { "Automation", "Integration", "Api" }.ToList(),
Status = "Approved"
});
Features Cloud
- TestCaseCreate
- TestCaseUpdate
- TestCaseGetById
- TestCasesGet
- TestCasesGetFull = with options to search by any test case's field property
- TestCaseLinksGet
- TestCaseLinkCreate
- TestCaseCustomFieldNames
- TestCaseCustomFieldName
- FolderGetById
- FolderCreate
- FolderCreateRecursive = create's the full folder path based on folder not available
- FoldersGet
- FoldersGetFull = with options to search by any folder's field property
- FolderWithFullPath = builds the full path for each folder
- TestCycleCreate
- TestCycleGet
- TestCyclesGet
- TestCyclesGetFull = with option to search by any test cycle's field property
- TestCycleLinksGet
- TestCycleLinkCreate
- TestCycleCustomFieldNames
- TestExecutionCreate
- TestExecutionGet
- TestExecutionsGetFull = with options to search by any test execution result's field property value
- StatusGet
- StatusesGet
- StatusesGetFull = with options to search by any status's field property value
- EnvironmentGet
- EnvironmentsGet
- EnvironmentsGetFull = with options to search by any environment's field property value
- ProjectGet
- ProjectsGet
- ProjectsGetFull = with options to search by any project's field property value
- LinkDelete
Features Server
- TestCaseById
- TestCasesByNames
- TestCasesByNamesInFolder
- TestCaseByIdsInFolder
- TestCaseByIds
- TestCaseByTestCaseName
- TestCaseGetTopNInFolder
- TestCaseGetTopN
- TestCaseByJql
- TestCaseCreate
- TestCaseUpdate
- TestCaseGetCustomMetadata
- TestCycleGetById
- TestCycleGetByKey
- TestCycleGetByKey
- TestCycleGetByName
- TestCycleGetByName
- TestCycleGetByProjectInFolder
- TestCycleGetByFolder
- TestCycleGetByProjectKeys
- TestCycleGetByJql
- TestCycleCreate
- TestExecutionResultCreateByTestCaseInTestCycle
- TestExecutionResultUpdateByTestCaseInTestCycle
- TestExecutionResultCreateByTestCycle
- TestExecutionResultGetByTestCycle
- FolderCreate
- ProjectsInTestGet
- ProjectsInJiraGet
Custom options to connect Service - Cloud / Server
There are some level of custom customization available on the service that can be passed on via the constuctor.
- restApiVersion - Rest API version for the Zephyr Service (default value: 'v2')
- folderSeparator - Folder separator string (default value: '/')
- logPrefix - Prefix text that will be added to all the logs generated from this service (default value: 'Zephyr: ')
- pageSizeSearchResult - Page size for search request (default value: '50')
- requestRetryTimes - Number of time to retry when there is a network failure (default value: '1'). You can increase the number of times to retry based on your infrastructure if there are chance for a request to fail randomly
- timeToSleepBetweenRetryInMilliseconds - Time to sleep in milliseconds between each time a call is retry (default value: '1000'). Applied only when requestRetryTimes is more than 1
- assertResponseStatusOk - True/False whether the response code status from the server needs to be asserted for OK (default value 'true')
- listOfResponseCodeOnFailureToRetry - Any of these status code matched from response will then use for retry the request. For example Proxy Authentication randomly failing can be then used to retry (default value 'null' which means it is not checking any response code for fail retry)
- requestTimeoutInSeconds - Control the total time to wait for any request made to the Zephyr Scale server. Default time is set to 300 seconds and it can be increased if the data on the server is too many and requires more time to process to respond
A scenario where you have network issues and you want to retry operation, then try this
//Connect to cloud hosted Zephyr Scale service
var zService = new ZephyrScaleCloudService("app url", "user api token",
requestRetryTimes: 10,
timeToSleepBetweenRetryInMilliseconds: 1500,
assertResponseStatusOk: true,
listOfResponseCodeOnFailureToRetry: new System.Net.HttpStatusCode [] { System.Net.HttpStatusCode.ProxyAuthenticationRequired });
The above will apply an automatic retry of a maximum 20 times, giving itself a break of 1500 milliseconds between each request made to Zeyhpr that fails with a response code of HttpStatusCode.ProxyAuthenticationRequired
Interesting Use Cases
Folder Recursive Create - Cloud Version
With the cloud version there are some limitations on the folder, where the service by default
- does not return the full path
- does not build the parent tree structure
- does not create the full tree structure in a single command
- does not fail when the folder already exists, instead create a new folder
FolderCreateRecursive - this option will create the full path and also checks if the folder already exists on any level of the path. For example, '/Automation/A/B/C', this method will create the full path in a single request and also if any of the folder available will be skipped and only required will be created
FolderWithFullPath - this option will return you the list of folder but along with that, one of the additional property on the model is "FullPath", that build the full path of each folder in the list
Tips
- [Server Mode] When updating test case, try to provide only the required property or provide only those properties that require update, for example, CustomFields or Labels or Properties
var testcase = zService.TestCaseById(testCaseId).ToTestCaseUpdate();
testcase.CustomFields.YouCustomFieldName = "YourCustomFieldValue";
zService.TestCaseUpdate(testCaseId, new TestCaseCreateRequest { CustomFields = testcase.CustomFields });
Upcoming Features
- Zephyr - Specflow integration module (automatically push results from Specflow to Zephyr)
- Zephyr - nUnit integration module (automatically push results from nUnit tests to Zephyr)
- Zephyr - Postman integration module (automatically push results from Postman tests to Zephyr)
These features will help to track the automated test execution back to Zephyr and you will have more control on each of the test cases from
- Control on what you to push - whether you want to push everything to Zephyr or only for those test cases you are interested from a list of test you have
- Control on where you push - for a single test in nUnit or Specflow you can push into one or more different test cases in Zephyr or even to multiple projects
- Control on how your push
- based on the executing environment, for example for a test case, if run against Test Environment, then TestCase1, or if running against Stag, then TestCase2
- based on the data, for example you can have a single test case running against several test scenarios (may be different products you are testing), you can now push into different test cases based on the data from these scenarios or more simpler like different products to different test cases
- all of the above can be combined
- End to End business logic implementation - Create Folder, Test cases, Test Cycle and Test Execution
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- TestAny.Essentials.Api (>= 1.0.5.7)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.0.2 | 78 | 12/7/2024 |
1.0.0.19 | 1,783 | 6/6/2024 |
1.0.0.18 | 254 | 11/22/2023 |
1.0.0.17 | 164 | 10/11/2023 |
1.0.0.16 | 327 | 9/29/2023 |
1.0.0.15 | 176 | 9/6/2023 |
1.0.0.14 | 352 | 1/31/2023 |
1.0.0.13 | 365 | 11/27/2022 |
1.0.0.12 | 337 | 11/21/2022 |
1.0.0.11 | 336 | 11/20/2022 |
1.0.0.10 | 363 | 11/15/2022 |
1.0.0.9 | 495 | 9/1/2022 |
1.0.0.8 | 488 | 8/7/2022 |
1.0.0.7 | 476 | 7/30/2022 |
1.0.0.6 | 498 | 5/28/2022 |
1.0.0.5 | 505 | 5/28/2022 |
First Release - Rest Endpoints - Cloud and Server