Coder Social home page Coder Social logo

legionivo / allure-to-testrail-exporter Goto Github PK

View Code? Open in Web Editor NEW
22.0 5.0 1.0 701 KB

Intellij Idea plugin which exports code with Allure @Step annotation into TestRail as a test case

License: MIT License

Java 100.00%
junit5 allure2 allure-framework testrail testrail-api testcase-generator

allure-to-testrail-exporter's Introduction

A plugin that exports test cases from Intellij Idea to TestRail using Allure @Step annotations.

Plugin is published here - https://plugins.jetbrains.com/plugin/13322-allure-to-test-rail-exporter/

Requirements:

JDK 8+

Gradle 5(optional, wrapper is included in project)

How to update:

  • Clone repo
  • Import project into Intellij Idea as a Gradle project - everything will be done automatically
  • Do code changes
  • Change plugin version in build.gradle
  • Run buildPlugin gradle task
  • Install new plugin from build/distributions/AllureToTestRailExporter-x.x.zip
  • Have fun

Plugin does update existing test case in TestRail - no need to delete it manually and export again!

Plugin was build to work only with the following libraries::

Junit 5
Allure
How to use:
Set up valid credentials in plugin settings under Tools - TestRail exporter plugin

Check that connection is successful

Open file with tests

Select desired test by putting a cursor on a test name - this is IMPORTANT

Push Alt - Insert combination

Select "Export to TestRail" menu item

TmsLink with testCase ID should be added

If you do not need test steps - enable "Export only test name" checkbox in plugin configuration settings

Code requirements:
@DisplayName annotation is mandatory - test case title is created from it
@Feature annotation on a test or class level is mandatory - TestRail section is linked to it:
 - If @Feature is present on a class and methods levels, method annotation is taken
 - If @Feature is not present on a class level, method annotation is taken
 - If conditions above are false - class annotation is taken 
@Link is not mandatory, but strongly advised
If you want to see nice test case - write nice @Step annotations  
Demo

allure-to-testrail-exporter's People

Contributors

legionivo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

ergoz

allure-to-testrail-exporter's Issues

Allure Annotation values are not exported to TestRail

Having following code in the test:

  @Step("response should have {0}")
  public void shouldHaveThisVal(String value) {
  		//some code 
  }
  @Epic(value = "11")
  @Feature(value = "22")
  @Story(value = "333")
  @DisplayName(value = "something")
  @Test
  void someThingTest() {
    shouldHaveThisVal("aaa");
  }

As a result into TestRail following step is exported:
response should have {0}

Expected result:
response should have aaa

Exporting to TestRail doesn't work

Setup
I've installed version 1.6.2 of the IntelliJ plugin and followed this guide: https://medium.com/@legionivo/an-easy-way-to-store-test-cases-as-a-code-5ccf3a80ee09

After providing the TestRail URL, projectId, suiteId, username, and password in the plugin settings, I hit the "Test" button and it successfully populates my account name in the Status box.

I create a minimal test like this:

@DisplayName( "Jordan Test" )
@Feature( "jordan/test" )
@Test
public void jordanTest()
{

}

I type Alt+Insert while the cursor is on the test name and choose either "Export To TestRail" or "Export Only Test Name to TestRail".

Expected
The "Export To TestRail" and "Export Only Test Name to TestRail" options should create a test case located in TestRail at jordan/test called Jordan Test and a corresponding @TmsLink annotation should be added to my JUnit test.

Acutal
The "Export To TestRail" and "Export Only Test Name to TestRail" options produce the following error message:

2:14 PM	Export to TestRail: Exception in [null]. Test case export failed

In TestRail, a single folder called jordan/test (not two folders) is created, but it is empty.

No @TmsLink annotation is added to my JUnit test (since the TestRail test case was not successfully created.)

I wonder if the TestRail API has changed? The recorded GIF in the guide obviously shows this was once working. Thank you for your help!

PsiReturnStatementImpl are in unnamed module of loader

Having following test:

String token;

@Epic(value = "11")
  @Feature(value = "22")
  @Story(value = "333")
  @DisplayName(value = "something")
  @Test
  void someThingTest() {
    String val = getAuthorizationToken();
  }

This code doesn't work:

  @Step("Get auth token")
  protected String getAuthorizationToken() {
    if (token==null){
    token = tokenBase.getAuthToken();
    }
    return token;
  }

This code works:

  @Step("Get auth token")
  protected String getAuthorizationToken() {
    return tokenBase.getAuthToken();
  }

Following error in IDEA:
java.lang.ClassCastException: class com.intellij.psi.impl.source.tree.java.PsiExpressionStatementImpl cannot be cast to class com.intellij.psi.impl.source.tree.java.PsiReturnStatementImpl (com.intellij.psi.impl.source.tree.java.PsiExpressionStatementImpl and com.intellij.psi.impl.source.tree.java.PsiReturnStatementImpl are in unnamed module of loader com.intellij.ide.plugins.cl.PluginClassLoader @6926d031)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.