1.2.3 • Published 9 months ago

zephyr-helper v1.2.3

Weekly downloads
-
License
ISC
Repository
-
Last release
9 months ago

zephyr-helper

Herramienta para la integración con zephyr.

Installation

npm install zephyr-helper

Usage

Cypress

import zephyr from 'zephyr-helper'

zephyr.cypress.uploadResults('your/path/to/mochawesome/.jsons', 'jiraProjectKey', 'jiraApiKey').then( (R) => { 
  console.log(R)
})

It's meant to read the mochawesome results, it has a multi country, multi architecture structure for the folder find, it looks for a zephyr folder with either BFF o API in the name:

CHILE - BFF as the folder name, with all the cycles inside:

  • Login
  • Onboarding
  • ETC

Feature Name in feature file should relate to that structure:

Feature: LOGIN CHILE
Feature: ONBOARDING CHILE

The test case should exist in zephyr, not necessarily in the cycles, and the scenario name should have the test case key added, as such:

Scenario: LOGIN SERVICE - Service response ok - TestCaseKey=IDK-T3620

It only works with reports from the cypress-mochawesome-reporters, other integrations may fail

Appium

For Appium, the uploadResults function works with a txt file generated by the process, and also needs an object passed to it with the app version data and country.

import zephyr from 'zephyr-helper'

const versionData = {
  "country": "CL",
  "so": "aos",
  "appVersion": "1.0.0,
  "codeVersion": "0000"
}

zephyr.appium.uploadResults('path/to/the/txt/files', 'jiraProjectKey', 'jiraApiKey', versionData).then(r => {

  console.log(r)

})

The txt files should have this format:

:white_check_mark: [Login - @IDK-T389] Scenario: Whatever [docID-66315754][Added:T391]

Where:

The first parameter can be:

  • :white_check_mark: for Pass
  • :no_entry: for Fail
  • :manual: for non automated cases

Inside the first square brackets we have two parameters:

  • On the left we have the feature, this should match with the zephyr cycle name, same as in cypress
  • On the right, after the minus sign, we have the zephyr test case key
  • At the end, there's a parameter called Added, it should have any test case related to the flow the case is running. Login could have some added depending of the case that's being evaluated.

Then we have two more functions

import zephyr from 'zephyr-helper'

const versionData = {
  "country": "CL",
  "so": "aos",
  "appVersion": "1.0.0,
  "codeVersion": "0000"
}

zephyr.appium.createCycleFolder(api_key, versionData).then((r) => {

  zephyr.appium.addTestCycles(api_key, versionData).then((r) => {

  })

})

These are used to create a folder after a new version of the app in said technology is created. There's some preparation needed for this to work correctly.

There's need to be a base folder created in the place where you want to have the version folder (it uses the number reference from the base folder, so is created in that same place).

What this means is, if you have a folder structure like this:

Chile

--Android

---Base Folder

--iOS

---Base Folder

The version folder will be created where the Base Folder is, and the addTestCycles function will copy all the test cycles in the base folder, onto the version folder, without the test cases.

License

ISC

1.2.0

11 months ago

1.1.9

12 months ago

1.2.3

9 months ago

1.2.2

11 months ago

1.2.1

11 months ago

1.1.8

1 year ago

1.1.7

1 year ago

1.1.6

1 year ago

1.1.5

1 year ago

1.1.4

1 year ago

1.1.3

1 year ago

1.1.2

1 year ago

1.1.1

1 year ago

1.1.0

1 year ago

1.0.9

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago