2.1.6 • Published 25 days ago

testit-adapter-cucumber v2.1.6

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
25 days ago

Test IT TMS adapters for Cucumber

Test IT

Getting Started

Installation

npm install testit-adapter-cucumber

Usage

Configuration

DescriptionPropertyEnvironment variableCLI argument
Location of the TMS instanceurlTMS_URLtmsUrl
API secret key How to getting API secret key?privateTokenTMS_PRIVATE_TOKENtmsPrivateToken
ID of project in TMS instance How to getting project ID?projectIdTMS_PROJECT_IDtmsProjectId
ID of configuration in TMS instance How to getting configuration ID?configurationIdTMS_CONFIGURATION_IDtmsConfigurationId
ID of the created test run in TMS instancetestRunIdTMS_TEST_RUN_IDtmsTestRunId

Create tms.config.json file in the root directory of the project:

{
  "url": "Url",
  "privateToken": "Private_token",
  "projectId": "Project_id",
  "configurationId": "Configuration_id",
  "testRunName": "Test_run_name",
  "adapterMode": 2,
  "automaticCreationTestCases": false
}

And fill object with your configuration. Formatter sends results to Test IT.

TestRunId is optional. If it's not provided than it create automatically.

Add to cucumber.js file

module.exports = {
  default:
    '-f testit-adapter-cucumber',
};

Tags

Formatter provides additional methods to World:

  • addMessage - adds message to autotest
  • addLinks - adds links to autotest
  • addAttachments - uploads specified to Test IT and links to test run
When('Something happens', function () {
  this.addMessage('💔');
  this.addLinks([
    {
      url: 'http://github.com',
    },
    {
      url: 'https://wikipedia.org',
      title: 'Wikipedia',
      description: 'The free encyclopedia',
      type: 'Related',
      hasInfo: true,
    },
  ]);
  this.addAttachments(['path/to/file.txt']);
});

Cucumber tags can be used to specify information about autotest.

Only those specified above the Scenario are taken into account

  • @ExternalId - unique internal autotest ID (used in Test IT)
  • @Title - autotest name specified in the autotest card. If not specified, the name from the displayName method is used
  • @DisplayName - internal autotest name (used in Test IT)
  • @Description - autotest description specified in the autotest card
  • @Links - links listed in the autotest card (@Link={"url":"http://google.com","hasInfo":true,"description":"GoogleDescription","title":"Google","type":"Defect"}) or in text (@Link=http://google.com)
  • @Labels - tags listed in the autotest card
  • @WorkItemIds - a method that links autotests with manual tests. Receives the array of manual tests' IDs
  • @NameSpace - directory in the TMS system
  • @ClassName - subdirectory in the TMS system

Examples

Tags

Feature: Tags
  @DisplayName=GoogiliGoogle
  @Description=Cannot_Write_With_Spaces
  @ExternalId=344
  @Links=http://google.com
  @Links=http://vk.com
  @Labels=Maths
  @Labels=School
  Scenario: Scenario with links
    When 2+2
    Then Result is 4
  @Title=LINKS
  @ExternalId=343
  @Links={"url":"http://google.com","hasInfo":true,"description":"GoogleDescription","title":"Google","type":"Defect"}
  Scenario: Scenario with link obj
    When 2+2
    Then Result is 4

Parameterized test

Feature: Rule
  Tests that use Rule
  @ExternalId=999
  Scenario: Summing
    When <left>+<right>
    Then Result is <result>

    Examples: Options
      Examples show different options
      | left | right | result |
      | 1    | 1     | 3      |
      | 9    | 9     | 18     |

Contributing

You can help to develop the project. Any contributions are greatly appreciated.

  • If you have suggestions for adding or removing projects, feel free to open an issue to discuss it, or directly create a pull request after you edit the README.md file with necessary changes.
  • Please make sure you check your spelling and grammar.
  • Create individual PR for each suggestion.
  • Please also read through the Code Of Conduct before posting your first idea as well.

License

Distributed under the Apache-2.0 License. See LICENSE for more information.

2.1.6

25 days ago

2.1.5

26 days ago

2.1.4

1 month ago

2.1.3

2 months ago

2.1.2

2 months ago

2.1.1

5 months ago

2.0.2

6 months ago

2.1.0

6 months ago

2.0.1

7 months ago

2.0.0

7 months ago

1.1.7

9 months ago

1.1.5

9 months ago

1.1.4

11 months ago

1.1.1

1 year ago

1.1.0

1 year ago

1.1.3

1 year ago

1.1.2

1 year ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago