Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

We will use Fitnesse JUnit output capabilities in order to get visibility of the results of the automated tests managed by Fitnesse.

Description

Whenever you install Fitnesse, you have access to a bunch of acceptance tests.

Image Added

If you take out the relative path of where you have your tests specified, you can use it in order to run those tests in the command line.


No Format
 java -jar fitnesse-standalone.jar -p 8080 -c "FitNesse.SuiteAcceptanceTests?suite&format=junit" > tmp.xml


Note that unfortunately Fitnesse does not generate a clean, ready-to-use JUnit XML file; thus you'll need to "clean it".


No Format
  fgrep -A 1000000 -i "<?xml" tmp.xml  > results.xml
Code Block
languagejava
package selenium_sample;

import org.junit.Assert;
import org.junit.Test;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
public class JTest1 {
    @Test
    public void startWebDriver(){

        //WebDriver driver = new FirefoxDriver();
        WebDriver driver = new ChromeDriver();
        driver.navigate().to("http://seleniumsimplified.com");
        Assert.assertTrue("title should start differently",
                            driver.getTitle().startsWith("Selenium Simplified"));
        driver.close();
        driver.quit();
    }
}


After successfully running the Test Case and generating the JUnit XML report (e.g., TESTS-TestSuites results.xml), it can be imported to Xray (either by the REST API or through through Import Execution Results action  action within the Test Execution).

...


Image Added


JUnit's Test Case is mapped to a Generic Test in Jira, and the Generic Test Definition field contains the name of the class, and the method name that implements the Test Case.

The Execution Details of the Generic Test contains information about the Test Suite, which in this case corresponds to the Test Case class. 


Image RemovedImage Added

References