Skip to content

Commit

Permalink
Release 2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
boxblinkracer committed Aug 6, 2022
1 parent 5932423 commit d58526a
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 18 deletions.
20 changes: 19 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,24 @@

All notable changes to this project will be documented in this file.

## [2.0.0]

### Breaking Changes

We had to change the way how the integration is registered.
The new way allows to read additional Cypress events and gather information about browsers, versions and more.
Please see the UPGRADE.md file for more about this topic.

### Added

- Add collected data to TestRail result such as Cypress version, browser, baseURL, system and Spec file.
- Add option to set a custom comment that is passed on to the result in TestRail. You can use this to describe your AUT version, commit hash or more.

### Changed

- Changed the way how the integration is registered.
- TestRail results are now sent at the end of a spec file, and not directly after a single test anymore.

## [1.1.0]

### Added
Expand All @@ -12,7 +30,7 @@ All notable changes to this project will be documented in this file.
### Changed

- Result comment is now trimmed to keep it neat ;)
- Improved extraction of Case IDs in Cypress titles by adding a trim to the title.
- Improved extraction of Case IDs in Cypress titles by adding a trim to the title.

## [1.0.0]

Expand Down
23 changes: 16 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

![Build Status](https://github.com/boxblinkracer/cypress-testrail/actions/workflows/ci_pipe.yml/badge.svg) ![NPM Downloads](https://badgen.net/npm/dt/cypress-testrail) ![GitHub release (latest by date)](https://img.shields.io/github/v/release/boxblinkracer/cypress-testrail) ![NPM License](https://img.shields.io/npm/l/cypress-testrail)


This integration helps you to automatically send test results to TestRail. And yes, super easy and simple!

Add your TestRail credentials in Cypress, decide which test results should be sent to TestRail and you're done!
Expand All @@ -21,15 +20,13 @@ Define new test cases in TestRail, and add automation to it, when you are ready.
npm i cypress-testrail --save-dev
```


### 2. Setup TestRail credentials

Now configure your credentials for the TestRail API.
Just add this snippet in your `Cypress.env.json` file and adjust the values.
Please keep in mind, the `runId` is always the test run, that you want to send the results to.
You can find the ID inside the test run in TestRail. It usually starts with an R, like "R68".


```yaml
{
"testrail": {
Expand All @@ -41,16 +38,29 @@ You can find the ID inside the test run in TestRail. It usually starts with an R
}
```


### 3. Register Plugin

Just place this line in your `support/index.js` file.
Just place this line in your `plugins/index.js` file.
There's nothing more that is required to register the TestRail reporter.

```javascript
import 'cypress-testrail';
const TestRailReporter = require('cypress-testrail');

module.exports = (on, config) => {
new TestRailReporter(on, config).register();
return config
}
```

In addition to this, you can register the reporter with a **custom comment**.
That comment will then be sent to the TestRail result along with the other metadata,
such as Cypress version, browser, baseURL and more.

```javascript
const customComment = 'AUT v' + Cypress.env('MY_APP_VERSION');

new TestRailReporter(on, config, customComment).register();
```

### 4. Map Test Cases

Expand All @@ -74,7 +84,6 @@ it('C123: My Test for TestRail XYZ', () => {

You can now start Cypress (restart after config changes), and all your results should be sent to TestRail as soon as your mapped tests pass or fail!


### Copying / License

This repository is distributed under the MIT License (MIT). You can find the whole license text in the [LICENSE](LICENSE) file.
16 changes: 7 additions & 9 deletions UPGRADE.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
# UPGRADE

## vX -> ....
## 1. CHANGELOGS

### See changelog
First, please always (and also) look at the CHANGELOG.md.
It will tell you more about the changes made.

First have a look at the changes in the CHANGELOG.md

### New way to register plugin
## Upgrade v1.x => v2.x

There is a new way to register the plugin.

Expand All @@ -17,17 +16,16 @@ import 'cypress-testrail';
```

The new way requires the plugin to be registered in the `plugins/index.js` file.

This is required, because we need new events to read data about browsers and specs, and that is only available in that scope.

```javascript
const TestRailReporter = require('cypress-testrail');

module.exports = (on, config) => {

// create a new reporter with our variables
// and just use the register() function.
new TestRailReporter(on, config).register();

return config
}
```

That's it, it should all work again!
6 changes: 6 additions & 0 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,9 @@ jest: ## Runs JS Unit Tests

eslint: ## Starts the ESLinter
./node_modules/.bin/eslint --config ./.eslintrc.json ./src

# ---------------------------------------------------------------------------------------------

pr: ## Prepares a pull request
make jest -B
make eslint -B
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cypress-testrail",
"version": "1.1.0",
"version": "2.0.0",
"description": "Easy and decoupled Cypress TestRail reporter",
"main": "index.js",
"private": false,
Expand Down

0 comments on commit d58526a

Please sign in to comment.