### Install Spira xUnit Addon Source: https://spiradoc.inflectra.com/Unit-Testing-Integration/Integrating-with-xUnit-NodeJS Install the library using npm. This command should be run in your project's root directory. ```bash npm install spira-addons-xunit ``` -------------------------------- ### RemoteLaunchX Console Output Example Source: https://spiradoc.inflectra.com/RemoteLaunch-User-Guide/RemoteLaunch-Guide This is an example of the console output you can expect when running RemoteLaunchX, showing connection status, test run retrieval, and execution details. ```text Starting RemoteLaunch\...\n\n========================\n\nServer URL: http://localhost/Spira\n\nServer Login: fredbloggs\n\nAutomation Host: MyHost1\n\nChecking License Key for: Inflectra Corporation\n\nProduction License Key in Use.\n\nTesting connection to Spira\...\n\nSuccessfully connected to Spira.\n\nWARNING: Unable to retrieve test runs for Spira project PR2, so\nskipping this project - Automation Host with token 'MyHost1' doesn't\nexist in projec PR2.\n\nWARNING: Unable to retrieve test runs for Spira project PR3, so\nskipping this project - Automation Host with token 'MyHost1' doesn't\nexist in projec PR3.\n\nRetrieved 1 test run(s) from Spira.\n\nExecuting test case TC18 with filename\n'C:\\Windows\\System32\\ipconfig.exe\|\/all'\n\nThis is a Linked test script\n\nExecuting command 'C:\\Windows\\System32\\ipconfig.exe' with arguments\n'/all'\n\n**Execution Status = Passed**\n\nExiting RemoteLaunch\...\n\n======================== ``` -------------------------------- ### NUnit Addins File Configuration Source: https://spiradoc.inflectra.com/Unit-Testing-Integration/Integrating-with-NUnit Example content for the nunit.bundle.addins file after installing the Spira NUnit add-in. Ensure SpiraTestNUnitAddIn.dll is listed. ```text addins/nunit.v2.driver.dll addins/nunit-v2-result-writer.dll addins/nunit-project-loader.dll addins/vs-project-loader.dll addins/teamcity-event-listener.dll addins/SpiraTestNUnitAddIn.dll ``` -------------------------------- ### QTP/UFT Test Execution Report Example Source: https://spiradoc.inflectra.com/RemoteLaunch-User-Guide/HP-UFT--QTP This is an example of a detailed test report generated by QTP/UFT, showing test execution details, summary results, and step-by-step actions. ```text QuickTest Professional Test: Test1 Results Name: Res21 Run Started: 10/22/2010 - 11:49:06 Run Ended: 10/22/2010 - 11:49:10 Summary Results ======= ======= Passed: 0 Failed: 0 Warnings: 0 Detailed Results ======= ======= Iteration: 1 ============= Action: Log In To Flight ============= Step: Login: Dialog Step: Agent Name:.SetText: "Bobba Fett" Step: Agent Name:.Type: "<__MicTab>" Step: Password:.SetSecureText: "4cc08e88683135b35bb8a7dab8442c69b8441f3e" Step: OK.Click: Step: Flight Reservations: Dialog Step: OK.Click: ``` -------------------------------- ### Example Spira Product Token Source: https://spiradoc.inflectra.com/Build-Server-Integration/GitHub-Actions An example of a Spira product token, '[PR:1]', which should be included in the GitHub repository description to establish the integration. ```Markdown [PR:1] ``` -------------------------------- ### WebLOAD Script Execution Example Source: https://spiradoc.inflectra.com/RemoteLaunch-User-Guide/WebLOAD An example of a successful WebLOAD script execution as reported back to Spira, showing the script file and arguments passed. ```text Results from results.xml: Passed Test File Name: C:\Users\suzanne.bauer\Documents\WebLOAD\Sessions\input\WebLOADFirstTest.tpl with arguments: C:\Users\su.be\Documents\WebLOAD\Sessions\output\WebLOADFirstTest20200228135424.ls /rc C:\Users\su.be\Documents\WebLOAD\Sessions\output\results.xml /ar 300 ``` -------------------------------- ### Basic GET API Call Example Source: https://spiradoc.inflectra.com/Developers/API-Overview An example of a basic GET API call to retrieve user information from Spira. Ensure correct URL, username, API key, and headers are provided. ```HTTP GET https://COMPANY.spiraservice.net/Services/v7_0/RestService.svc/users?username=administrator&api-key={XXXXXX-YYYY-4D29-ZZZZ-5E300XYZ0AC2} content-type: application/json Accept: application/json { body content } ``` -------------------------------- ### Example Sync Mode and Parameter Combinations Source: https://spiradoc.inflectra.com/External-Bug-Tracking-Integration/Using-SpiraTeam-with-Jira-Cloud Illustrates how to combine sync modes with optional parameters for data synchronization between SpiraTeam and Jira. ```text Bidirectional,NoAttachments Complete,NoAttachments,createReleasesOnly Default,NoAttachments (or just NoAttachments for default mode) ``` -------------------------------- ### Indenting Example for Requirements Source: https://spiradoc.inflectra.com/Migration-and-Integration/Importing-from-Microsoft-Excel-%28Office365%29 Use '> ' at the start of the 'Name' field to create a child requirement. This example shows a hierarchical structure. ```text Indenting Example: Item 1 > Item 2 child of item 1 > Item 3 child of item 1 > > Item 4 child of item 3 ``` -------------------------------- ### Run RemoteLaunchX on Windows Source: https://spiradoc.inflectra.com/RemoteLaunch-User-Guide/RemoteLaunch-Guide This is a sample Windows batch file to simplify the execution of RemoteLaunchX. Ensure Java 1.8 SE or later is installed. ```batch @echo off java -jar RemoteLaunchX.jar ``` -------------------------------- ### Retrieve a Task using GET Source: https://spiradoc.inflectra.com/Developers/API-Overview Use GET requests to retrieve specific artifacts from Spira. This example shows how to fetch a task by its ID from a given project. ```HTTP GET https://my-company.spiraservice.net/Services/v7_0/RestService.svc/projects/1/tasks/2? Accept: application/json ``` -------------------------------- ### PHPUnit Test Class Example Source: https://spiradoc.inflectra.com/Unit-Testing-Integration/Integrating-with-PHPUnit A basic PHPUnit test class demonstrating test methods and setup. ```php fValue1= 2; $this->fValue2= 3; } /** * Tests the addition of the two values */ public function testAdd__2() { $result = $this->fValue1 + $this->fValue2; // forced failure result == 5 $this->assertTrue ($result == 6); } /** * Tests division by zero */ /* public function testDivideByZero__3() { $zero = 0; $result = 8 / $zero; $result++; // avoid warning for not using result } /** * Tests two equal values */ /* public function testEquals__4() { $this->assertEquals(12, 12); $this->assertEquals(10, 10); $num1 = 12; $num2 = 12; $this->assertEquals($num1, $num2); $this->assertEquals("Size", 12, 13); $this->assertEquals("Capacity", 10, 199, 0); } /** * Tests success */ /* public function testSuccess__5() { //Successful test $this->assertEquals(12, 12); } } ?> ``` -------------------------------- ### Query Examples with Project Tokens Source: https://spiradoc.inflectra.com/Spira-Administration-Guide/System-Reporting Demonstrates how to use special tokens to filter report data by ProjectId, ProjectGroupId, or to include all system data. Using these tokens is crucial for data security and relevance. ```SQL select value R from SpiraTestEntities.R_Requirements as R where R.PROJECT_ID = ${ProjectId} ``` ```SQL select value R from SpiraTestEntities.R_Requirements as R where R.PROJECT_GROUP_ID = ${ProjectGroupId} ``` ```SQL select value R from SpiraTestEntities.R_Requirements as R ``` -------------------------------- ### Sample NUnit Test Fixture Source: https://spiradoc.inflectra.com/Unit-Testing-Integration/Integrating-with-NUnit A basic NUnit test fixture with SetUp and multiple Test methods, including examples that will succeed and fail. ```csharp using NUnit.Framework; namespace SampleTestSuite { [TestFixture] class SampleTest { int One, Two; [SetUp] protected void SetUp() { One = 1; Two = 2; } [Test] public void TestAdd() { int Result = One + Two; //will succeed Assert.AreEqual(Result, 3); } [Test] public void TestMultiply() { int Result = One * Two; //will fail Assert.AreEqual(Result, 3); } [Test] public void TestConcat() { string Result = string.Concat(One, Two); //will fail Assert.AreEqual(Result, "21"); } } } ``` -------------------------------- ### Spira Configuration File Example Source: https://spiradoc.inflectra.com/Unit-Testing-Integration/Integrating-with-xUnit-Python This is an example of the spira.cfg file used to configure the Spira connection and map test cases and test sets. Ensure sensitive information like tokens are handled securely. ```ini [credentials] # Following are required url = http://localhost/spira username = administrator token = {XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX} project_id = 1 # Following are optional: release_id = 5 test_set_id = 1 create_build = true # Spira Test case for a specific classname.name [test_cases] LIS.Registration.registration1 = 2 LIS.Registration.registration2 = 3 LIS.Registration.registration3 = 4 LIS.Authentication.Login.login1 = 5 LIS.Authentication.Login.login2 = 9 LIS.Authentication.Login.login3 = 8 LIS.Authentication.auth1 = 6 LIS.Authentication.auth2 = 12 LIS.Authentication.auth3 = 13 LIS.Registration.registration4 = 5 LIS.Registration.registration5 = 9 LIS.Registration.registration6 = 8 LIS.Registration.registration7 = 6 LIS.Registration.registration8 = 12 # Spira Test sets for a specific name # If not, the global value is used instead [test_sets] LIS.Registration = 2 LIS.Authentication = 5 LIS.Authentication.Login = 2 ``` -------------------------------- ### Run RemoteLaunchX on UNIX/Linux/MacOS X Source: https://spiradoc.inflectra.com/RemoteLaunch-User-Guide/RemoteLaunch-Guide This is a sample shell script for running RemoteLaunchX on UNIX, Linux, or Mac OS X systems. It requires Java 1.8 SE or later. ```shell #!/bin/sh java -jar RemoteLaunchX.jar ``` -------------------------------- ### Squish Test Execution Log Example Source: https://spiradoc.inflectra.com/RemoteLaunch-User-Guide/Squish This log shows the output from a Squish test execution, including start times, test case names, and PASS/FAIL statuses. ```log 2010-11-02T16:50:01-04:00 START_TEST suite_examples 2010-11-02T16:50:01-04:00 START_TEST tst_icefaces_addressbook_datadriven 2010-11-02T16:50:05-04:00 PASS Comparison 'true' and 'true' are equal 2010-11-02T16:50:25-04:00 PASS Verified True expression 2010-11-02T16:50:30-04:00 PASS Verified True expression 2010-11-02T16:50:32-04:00 PASS Comparison 'Reginald' and 'Reginald' are equal 2010-11-02T16:50:33-04:00 PASS Comparison 'CA' and 'CA' are equal 2010-11-02T16:50:40-04:00 PASS Comparison 'true' and 'true' are equal 2010-11-02T16:50:59-04:00 PASS Verified True expression 2010-11-02T16:51:09-04:00 PASS Verified True expression 2010-11-02T16:51:12-04:00 PASS Comparison 'Tanja' and 'Tanja' are equal 2010-11-02T16:51:12-04:00 PASS Comparison 'NY' and 'NY' are equal ``` -------------------------------- ### Ranorex Test Execution Log Example Source: https://spiradoc.inflectra.com/RemoteLaunch-User-Guide/Ranorex This log shows the detailed output from a Ranorex test execution, including start and end times, statuses of test suites and cases, and validation messages. It helps in diagnosing failures. ```text +-----------------------------------------------------------------------+ | [2011/10/14 14:08:32.795][Debug ][Logger]: Console logger | | starting. | | | | [2011/10/14 14:08:32.874][Info ][Test]: Test Suite 'WinForms | | Test' started. | | | | [2011/10/14 14:08:32.889][Info ][Test]: Test Case | | 'VS2005_Application_Test' started. | | | | [2011/10/14 14:08:33.467][Success][Test]: Test Module | | 'StartWinformsSample' completed with status 'Success'. | | | | [2011/10/14 14:08:33.467][Info ][Test]: Test Module | | 'CheckIfApplicationAlive' started. | | | | [2011/10/14 14:08:33.608][Info ][Validation]: Validating Exists | | on item 'WinFormsApp.ButtonTest_PushButton'. | | | | [2011/10/14 14:09:55.718][Failure][Test]: Test Case | | 'VS2005_Application_Test' completed with status 'Failed'. | | | | [2011/10/14 14:09:55.718][Failure][Test]: Test Suite 'WinForms | | Test' completed with status 'Failed'. | +-----------------------------------------------------------------------+ ``` -------------------------------- ### Combine .env.spira and spira.cfg for Configuration Source: https://spiradoc.inflectra.com/Unit-Testing-Integration/Integrating-with-PyTest Recommended approach for best security and flexibility: use .env.spira for credentials and spira.cfg for test mappings. The [credentials] section is not needed in spira.cfg when using .env.spira. ```dotenv # Credentials - DO NOT commit to git SPIRA_URL=http://localhost/Spira SPIRA_USERNAME=fredbloggs SPIRA_TOKEN={XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXXX} SPIRA_PROJECT_ID=1 SPIRA_RELEASE_ID=5 SPIRA_TEST_SET_ID=1 ``` ```ini # No [credentials] section needed when using .env.spira! [test_cases] # Default test case ID for unmapped tests (optional) default = 20 # Function-level mapping test_add_2 = 22 # Class-level mapping (all tests in class use this ID) testcalculator = 25 [markers] ``` -------------------------------- ### Basic JUnit 5 Test Fixture in Java Source: https://spiradoc.inflectra.com/Unit-Testing-Integration/Integrating-with-JUnit A standard JUnit 5 test class structure in Java. It includes setup methods annotated with @BeforeEach and test methods annotated with @Test, along with various assertion examples. ```java package com.inflectra.spiratest.addons.junitextension.samples; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertTrue; /** * Some simple tests using the ability to return results back to Spira * * @author Inflectra Corporation * @version 4.0.0 */ public class SimpleTest { protected int fValue1; protected int fValue2; /** * Sets up the unit test */ @BeforeEach public void setUp() { fValue1 = 2; fValue2 = 3; } /** * Tests the addition of the two values */ @Test public void testAdd() { double result = fValue1 + fValue2; // forced failure result == 5 assertTrue(result == 6); } /** * Tests division by zero */ @Test public void testDivideByZero() { int zero = 0; int result = 8 / zero; } /** * Tests two equal values */ @Test public void testEquals() { assertEquals(12, 12); assertEquals(12L, 12L); assertEquals(new Long(12), new Long(12)); assertEquals(12, 13, "Size"); assertEquals(12.0, 11.99, 0.0, "Capacity"); } /** * Tests success */ @Test public void testSuccess() { //Successful test assertEquals(12, 12); } } ``` -------------------------------- ### Install pytest-spiratest Plugin Source: https://spiradoc.inflectra.com/Unit-Testing-Integration/Integrating-with-PyTest Install the latest version of the Spira plugin for pytest using pip. Ensure you have Python (with pip) and pytest version 3.0 or later installed. ```bash pip install pytest-spiratest ```