Skip to content

Commit af11309

Browse files
authored
Merge pull request #1288 from magento-pangolin/MQE-136-mtf1-allure-report
[pangolin] MQE-136: [MTF 1.0] Implement mechanism to run current (MTF) functional tests from MTF2
2 parents 838bc58 + f345688 commit af11309

File tree

3 files changed

+48
-1
lines changed

3 files changed

+48
-1
lines changed

dev/tests/functional/composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
"magento/mtf": "1.0.0-rc56",
44
"php": "7.0.2|~7.0.6|~7.1.0",
55
"phpunit/phpunit": "~4.8.0|~5.5.0",
6-
"phpunit/phpunit-selenium": ">=1.2"
6+
"phpunit/phpunit-selenium": ">=1.2",
7+
"allure-framework/allure-phpunit": "~1.2.0"
78
},
89
"suggest": {
910
"netwing/selenium-server-standalone": "dev-master",

dev/tests/functional/phpunit.xml.dist

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,20 @@
2626
</arguments>
2727
</listener>
2828
<listener class="Magento\Mtf\System\Event\StateListener" />
29+
<listener class="Yandex\Allure\Adapter\AllureAdapter">
30+
<arguments>
31+
<string>var/allure-results</string> <!-- XML files output directory -->
32+
<boolean>false</boolean> <!-- Whether to delete previous results on rerun -->
33+
<array> <!-- A list of custom annotations to ignore (optional) -->
34+
<element key="0">
35+
<string>ZephyrId</string>
36+
</element>
37+
<element key="1">
38+
<string>Group</string>
39+
</element>
40+
</array>
41+
</arguments>
42+
</listener>
2943
</listeners>
3044

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

0 commit comments

Comments
 (0)