Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/inflectra/jasmine-spiratest
Reports the results of a jasmine test run into SpiraTest/Team/Plan
https://github.com/inflectra/jasmine-spiratest
jasmine nodejs tdd
Last synced: 24 days ago
JSON representation
Reports the results of a jasmine test run into SpiraTest/Team/Plan
- Host: GitHub
- URL: https://github.com/inflectra/jasmine-spiratest
- Owner: Inflectra
- License: mit
- Created: 2019-02-08T21:14:43.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2021-04-26T19:46:10.000Z (over 3 years ago)
- Last Synced: 2024-10-12T23:22:22.974Z (24 days ago)
- Topics: jasmine, nodejs, tdd
- Language: JavaScript
- Size: 12.7 KB
- Stars: 0
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Spira Integration with JasmineJS Testing Framework
## Brief Overview
This reporter will integrate JasmineJS with Inflectra's ALM suite. It will create a test run in Spira for each test spec executed in Jasmine.
### Don't have Spira?
If you haven't tried out one of our products, you can get a 30 day free trial for our flagship ALM product [SpiraPlan](http://www.inflectra.com/SpiraPlan/) with no credit card needed!
### Guide Basics
Unfortunately, this integration will work with SpiraTest/SpiraTeam/SpiraPlan (hereafter refered to as SpiraTest) version 5.0 and above and Jasmine 3.x. If you have an older version, you will need to update to use this reporter.This guide assumes a basic familiarity with both SpiraTest and the Jasmine testing framework.
## Setting up the integration
Install the integration by running `npm i jasmine-spiratest` in the root directory of your tests. Inside each test spec file, import the SpiraReporter with `var SpiraReporter = require('jasmine-spiratest')` then put the line `jasmine.getEnv().addReporter(new SpiraReporter(spiraCredentials));` where `spiraCredentials` is an object of the format below. You can see a full sample test spec at the bottom of this README.
```javascript
{
"url": "https://doctor/SpiraPlan",
"username": "fredbloggs",
"token": "{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}",
"projectId": 1,
"releaseId": 1,
"testSetId": 1,
"testCases": {
"default": 20,
"should multiply correctly": 21,
"should solve exponents and logarithms correctly": 16
}
}
```
Fields are required unless otherwise noted.Field | Description
--- | --- |
`url` | The root URL of your SpiraTest instance without a '/' at the end
`username` | The username you use to sign into SpiraTest
`token` | Your RSS Token. Foundin your profile page as the `RSS Token` field. You must have RSS Feeds enabled for this to work
`projectId` | The ID of the project you would like the Test Runs to be filed under
`releaseId` | **OPTIONAL** - Use if you would like to associate created test runs with a release
`testSetId` | **OPTIONAL** - Use if you would like to associated created test runs with a test set
`testCases` | Must contain the `default` field within it and, optionally, specific test cases for a given test spec name
`default` | Inside the `testCases` field, this is the ID of the default test case mapped to a created test run
`` | **OPTIONAL** - Use *as many times as you would like* to map a the created test run for a spec to a particular test case in SpiraTest. Note that capitalization, special characters and spaces are ignored both in `testCases` *and* the spec itselfOnce you have added the SpiraReporter to the jasmine environment in each file as described above, you are all set!
## Using the SpiraTest Reporter
Actually, you don't do anything different! Just run `npm test` or however you ran jasmine before and you should see test runs created in the project you specified!## Sample Test Spec with SpiraTest Integration
```JavaScript
describe("Test having two specs", () => {
var SpiraReporter = require('jasmine-spiratest');jasmine.getEnv().addReporter(new SpiraReporter({
"url": "https://doctor/SpiraPlan",
"username": "fredbloggs",
"token": "{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}",
"projectId": 1,
"releaseId": 1,
"testSetId": 1,
"testCases": {
"default": 20,
"equality works": 21,
"addition works": 16
}
}));describe("Test basic JavaScript", () => {
it("Equality works...", () => {
expect(2).toEqual(2);
});
it("Addition works", () => {
expect(3 + 2).toEqual(5);
});
it("Multiplication works", () => {
expect(4 * 5).toEqual(20);
});
});
});
```