generateAllureReport.php 1.1 KB

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. /**
  7. * Generate Allure report using Allure Commandline (CLI).
  8. *
  9. * Allure CLI is a Java application so it's available for all platforms.
  10. * You have to manually install Java 1.7+ before using Allure CLI.
  11. * Information on how to install Allure CLI can be found at:
  12. * http://wiki.qatools.ru/display/AL/Allure+Commandline
  13. */
  14. // Explicitly define Allure CLI executable if it's not available in your PATH.
  15. define('ALLURE_CLI', 'allure');
  16. $mtfRoot = dirname(dirname(__FILE__));
  17. $mtfRoot = str_replace('\\', '/', $mtfRoot);
  18. define('MTF_BP', $mtfRoot);
  19. // Allure test results directory which needs to match what's defined in phpunit.xml.
  20. $allureResultsDir = MTF_BP . '/var/allure-results/';
  21. // Allure report directory.
  22. $allureReportDir = MTF_BP . '/var/allure-report/';
  23. // Generate report using Allure CLI.
  24. exec(ALLURE_CLI . ' generate ' . $allureResultsDir . ' -o '. $allureReportDir);
  25. // Open report using Allure CLI.
  26. exec(ALLURE_CLI . ' report open --report-dir ' . $allureReportDir);