ndrake0027/drupal-junit-parser

There is no license information available for the latest version (2.1) of this package.

JUnit parser for Drupal behat and PHPUnit output to a simple html table.

2.1 2021-12-03 20:25 UTC

This package is auto-updated.

Last update: 2024-05-04 05:27:13 UTC


README

Parsers for PHPUnit and Behat junit output for drupal 8 test

Installing

composer require ndrake0027/drupaljunitparser

Adding directly in composer.json

"require": {
  "ndrake0027/drupaljunitparser" : "dev-master" 
},

Example usage:

<?php
/********
 * Main *
 *******/

require __DIR__ . '/vendor/autoload.php';

use DrupalJUnit\Parser\Parser;

$dir = $argv[1];
$pattern = isset($argv[3]) ? $argv[3] : '';
$type = isset($argv[2]) ? $argv[2] : '';
$parser = new Parser();
$parser->parse($dir, $pattern, $type);

Example output

Behat output

Run results
Total tests Total failures Total errors
442 33 0

Aggregated suite results
Suite name Total tests Total failures Total errors
access 71 0 0
Scenario Failures
Failing Suite Failing Class Failing Test Failure message
Test Suite Test Class name Test name Some exception i.e.: (Behat\Mink\Exception\ElementNotFoundException)

PHPUnit output

Run results
Total tests Total failures Total errors Total time
575 24 0 9167.635773
Aggregated suite results
Type Total test Total time Total failures Total errors
functionalJavascript 20 2480.456045 0 0
Feature results
Suite Type Class name Tests Failures Errors Time Assertions
functionalJavascript Drupal\Tests\Path\FunctionalJavascript\TestClass 1 0 0 117.336066 12
Scenario Failures
Failing Suite Failing Class Failing Test Failure message
Test Suite Test Class name Test name Some exception and stacktrace i.e.: RuntimeException: Could not fetch version information from https://dummy_server:port/test/cli. Please check if Chrome is running. Please see docs/troubleshooting.md if Chrome crashed unexpected.