tonicforhealth / testrail-report-aggregator
Tool to aggregation report from JUnit like format to TestRail run report.
v0.1.0
2016-06-03 14:32 UTC
Requires
- danielgsims/php-collections: ~1.4
- guzzlehttp/guzzle: ~6.2
- php-http/discovery: ~0.8.0
- php-http/guzzle6-adapter: ~1.0
- php-http/message: ~1.2
- php-http/plugins: ~1.0
- pimple/pimple: ^3.0
- puli/cli: ~1.0
- puli/composer-plugin: dev-classmap as 1.0-beta10
- symfony/console: ^3.0
Requires (Dev)
- php-http/mock-client: ~0.3
- phpunit/phpunit: ~4.8|~5.3
This package is not auto-updated.
Last update: 2024-11-15 19:06:22 UTC
README
Tool to aggregation report from JUnit like format to TestRail run report.
Installation using Composer
$ composer require tonicforhealth/testrail-report-aggregator
Junit report example
<?xml version="1.0" encoding="UTF-8"?>
<testsuites>
<testsuite name="IDENT.IDENT2.1.9.4 description" tests="1" failures="0"/>
<testsuite name="IDENT.IDENT2.1.9.5 description" tests="1" failures="0"/>
<testsuite name="IDENT.IDENT2.1.9.6 description" tests="1" failures="1">
<failure
message="Some error text of the Test IDENT.IDENT2.1.9.6"/>
</testsuite>
</testsuites>
Case sync use ident which find in the name by using regex ^[\w._-]+.[\w]+.[\w]+
Usage
<?php
$testRunId = 1885;
$apiUrl = 'https://test.testrail.com/index.php?/api/v2/';
$user = 'dev@test.com';
$passwordOrToken = 'chengeMePls'
$junitXml = 'fixture/simple_junit_report.xml';
$authentication = new BasicAuth(
$user,
$passwordOrToken
);
$plugins[] = new AuthenticationPlugin($authentication);
$pluginClient = new PluginClient(HttpClientDiscovery::find(), $plugins);
$httpMethodsClient = new HttpMethodsClient($pluginClient, MessageFactoryDiscovery::find());
$junitReport = new JunitReport($junitXml);
$testRailReportA = new JUnitToTestRailRunTransformer($testRunId);
$testRailSync = new TestRailSync($apiUrl, $httpMethodsClient);
$testRailReport = $testRailReportA->transform($junitReport);
$testRailSync->sync($testRailReport);
$testRailSync->pushResults($testRailReport);