Skip to content

MQE-953: Merge the release branch to master #116

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 110 commits into from
Apr 24, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
110 commits
Select commit Hold shift + click to select a range
7b8a057
Merge tag '2.1.2' into develop
tomreece Mar 15, 2018
237913d
MQE-801: Allow Test Generation of a single test via arg
magterskine Mar 14, 2018
2a0ec6c
MQE-801: Tweak to fix static check failure
tomreece Mar 20, 2018
dd3dd48
MQE-880: Url parameter no longer resolved correctly if only page name…
okolesnyk Mar 21, 2018
5003492
MQE-679: 2 or more params in a url are not properly replaced
okolesnyk Mar 21, 2018
7a89255
Make possible to create and run MFTF test in framework to verify Fram…
okolesnyk Mar 22, 2018
88e6ac5
MQE-879: Add support for tests actions in suite pre/post conditions
imeron2433 Mar 22, 2018
cfb142b
MQE-779: Default Directory exists for tests not referenced in other s…
magterskine Mar 20, 2018
45962be
Make possible to create and run MFTF test in framework to verify Fram…
okolesnyk Mar 23, 2018
c96c88a
Make possible to create and run MFTF test in framework to verify Fram…
okolesnyk Mar 23, 2018
08c089a
Make possible to create and run MFTF test in framework to verify Fram…
okolesnyk Mar 23, 2018
778a626
magento/magento2-functional-testing-framework#56: Add "block" type to…
sdzhepa Mar 23, 2018
9763062
Added exception throwing on test generation if project is not built #61
vasylmalanka Mar 23, 2018
fcb3090
magento/magento2-functional-testing-framework#58: Allow browser type …
StasKozar Mar 24, 2018
8c8a771
magento/magento2-functional-testing-framework#57: Debug flag exists i…
StasKozar Mar 24, 2018
44ced3f
magento/magento2-functional-testing-framework#58: Allow browser type …
StasKozar Mar 24, 2018
91ef188
magento/magento2-functional-testing-framework#57: Debug flag exists i…
StasKozar Mar 24, 2018
5f3438c
magento/magento2-functional-testing-framework#57: Debug flag exists i…
StasKozar Mar 24, 2018
43891bd
MQE-881: Cannot Pass Arguments In Action Groups To X, Y Attributes On…
okolesnyk Mar 26, 2018
af460ab
magento/magento2-functional-testing-framework#60: Build interactive c…
lenaorobei Mar 24, 2018
bdd366d
Make possible to create and run MFTF test in framework
okolesnyk Mar 26, 2018
e05e5e7
Merge branch 'develop' of github.com:magento/magento2-functional-test…
okolesnyk Mar 26, 2018
c71b417
MQE-882: Cannot input <data> tags in entity xml
okolesnyk Mar 26, 2018
a75d1f4
Merge branch 'bug-fixes' of github.com:magento/magento2-functional-te…
okolesnyk Mar 27, 2018
467fe43
Merge branch 'CD-develop' into mftf#56
okolesnyk Mar 28, 2018
ff2bce5
Merge branch 'CD-develop' into issue60
okolesnyk Mar 28, 2018
c06af5f
Merge branch 'CD-develop' into MFTF-58
okolesnyk Mar 28, 2018
6ab66f3
MQE-830: Output error details about test failure
KevinBKozan Mar 28, 2018
8e7d4d8
Merge pull request #64 from sdzhepa/mftf#56
okolesnyk Mar 28, 2018
dcd1eca
MQE-783: Allure reporting Spike
magterskine Mar 28, 2018
78bc144
MQE-783 working prototype
magterskine Mar 28, 2018
8703e00
Merge pull request #69 from lenaorobei/issue60
okolesnyk Mar 29, 2018
04fec9e
Merge pull request #66 from vasylmalanka/issue-61
okolesnyk Mar 29, 2018
e01f07e
Merge pull request #67 from StasKozar/MFTF-58
okolesnyk Mar 29, 2018
856aa5e
MQE-783: removing comments and whitespace
magterskine Mar 29, 2018
07eae39
MQE-778: robo generate:tests generates all tests and suites by default
imeron2433 Mar 29, 2018
12ca5e4
MQE-904: Deliver changes from Magento Contribution Day
okolesnyk Mar 29, 2018
d1a7feb
Merge branch 'CD-develop' of github.com:magento/magento2-functional-t…
okolesnyk Mar 29, 2018
fd0e889
Merge pull request #70 from StasKozar/MFTF-57
okolesnyk Mar 29, 2018
9fff8f2
Merge branch 'develop' into CD-develop
okolesnyk Mar 29, 2018
b35c503
Merge pull request #74 from magento/MQE-778
imeron2433 Mar 29, 2018
3ef39ba
Merge branch 'develop' of github.com:magento/magento2-functional-test…
okolesnyk Mar 30, 2018
a34cbd1
MQE-904: Deliver changes from Contribution day
okolesnyk Mar 30, 2018
2109b0d
MQE-904: Deliver changes from Contribution day
okolesnyk Mar 30, 2018
bf24553
Merge pull request #63 from magento/CD-develop
okolesnyk Mar 30, 2018
5c426c8
MQE-783: [SPIKE] Investigate allure reporting when tests run in multi…
magterskine Apr 2, 2018
0794a74
MQE-768: Framework cannot depend on relative file structure to execut…
KevinBKozan Apr 2, 2018
48c5585
MQE-818: Enable executeJS to save a variable
KevinBKozan Apr 3, 2018
d48a35b
MQE-783: [SPIKE] Investigate allure reporting when tests run in multi…
magterskine Apr 3, 2018
df9dfda
MQE-783: [SPIKE] Investigate allure reporting when tests run in multi…
magterskine Apr 4, 2018
c9cbeb6
MQE-878: Modify parallel grouping algorithm to work with suites
imeron2433 Apr 4, 2018
f2ed017
MQE-878: Modify parallel grouping algorithm to work with suites
imeron2433 Apr 4, 2018
fc58bae
Merge pull request #83 from magento/MQE-878
imeron2433 Apr 4, 2018
6eaaa9e
MQE-759: Call Operation tags without tying them to an entity
KevinBKozan Apr 5, 2018
d3db491
MQE-783: [SPIKE] Investigate allure reporting when tests run in multi…
imeron2433 Apr 5, 2018
2e466f2
MQE-743: Can't run tests without a store having "default" store code
KevinBKozan Apr 5, 2018
3550ecd
MQE-782: Fatal error is thrown when a group name conflicts with an ex…
magterskine Mar 21, 2018
3ae57a6
Merge pull request #84 from magento/MQE-782
magterskine Apr 5, 2018
726499b
Merge branch 'develop' into MQE-783
magterskine Apr 5, 2018
2fe0d2a
MQE-743: Can't run tests without a store having "default" store code]
KevinBKozan Apr 6, 2018
00b21e3
Added ability to use array entities as arguments.
nathanjosiah Apr 6, 2018
64cdddd
Merge branch 'develop' into MQE-783
magterskine Apr 9, 2018
1062018
MQE-876: Add Skipped Tests in Allure Report
magterskine Apr 2, 2018
320dc63
Merge pull request #87 from magento/MQE-783
magterskine Apr 9, 2018
8bb00a2
Merge branch 'develop' into MQE-876
magterskine Apr 9, 2018
4ece405
Merge pull request #85 from magento/MQE-876
magterskine Apr 10, 2018
274b2b0
MQE-913: Nested Element Assertions Don’t Support Action Group Replace…
KevinBKozan Apr 10, 2018
eb6c943
MQE-784: Update parser to read suites in from extensions
imeron2433 Apr 9, 2018
734f356
Merge pull request #91 from magento/MQE-784
imeron2433 Apr 11, 2018
c204f13
MQE-893: Add flag to robo generate: tests which accepts a specific se…
imeron2433 Apr 4, 2018
dd7ff14
MQE-893: Add flag to robo generate: tests which accepts a specific se…
imeron2433 Apr 6, 2018
1e8fbd3
MQE-893: Add flag to robo generate: tests which accepts a specific se…
imeron2433 Apr 9, 2018
4f847dd
MQE-893: Add flag to robo generate: tests which accepts a specific se…
imeron2433 Apr 9, 2018
5b7eb65
MQE-893: Add flag to robo generate: tests which accepts a specific se…
imeron2433 Apr 10, 2018
81e078d
MQE-893: Add flag to robo generate: tests which accepts a specific se…
imeron2433 Apr 10, 2018
e2b88bf
MQE-893: Add flag to robo generate: tests which accepts a specific se…
imeron2433 Apr 11, 2018
5fe3796
MQE-905: Persistent entity variable not interpolated with page urls w…
KevinBKozan Apr 12, 2018
a3bb056
MQE-790: Error for duplicate step keys in a single action group defin…
imeron2433 Apr 11, 2018
ab81af6
MQE-790: Error for duplicate step keys in a single action group defin…
imeron2433 Apr 12, 2018
bd43c81
Merge pull request #94 from magento/MQE-790
imeron2433 Apr 15, 2018
9a0bb13
MQE-809: Throw a warning or error when step key referencing in merges…
imeron2433 Apr 10, 2018
3f79812
MQE-809: Throw a warning or error when step key referencing in merges…
imeron2433 Apr 12, 2018
9d03330
MQE-809: Throw a warning or error when step key referencing in merges…
imeron2433 Apr 12, 2018
586fd5c
Merge pull request #95 from magento/MQE-809
imeron2433 Apr 16, 2018
f00b2ff
MQE-914: Multiple Uniqueness References On Same Entity Generates Inco…
KevinBKozan Apr 16, 2018
31e913e
MQE-699: Exception message for "conditionalClick" failure uses '$sele…
KevinBKozan Apr 16, 2018
29522c8
MQE-919: Order of test merging
KevinBKozan Apr 17, 2018
8d6eadf
MQE-918: Support for MFTF folder
KevinBKozan Apr 17, 2018
d3ad955
Added slash escapement and moved condition for array entity arguments
nathanjosiah Apr 18, 2018
2c38cc6
Merge branch 'develop' into resolve-array-data
nathanjosiah Apr 18, 2018
9bce276
Moved array entity data replacement conditional
nathanjosiah Apr 18, 2018
2bdc905
Merge pull request #89 from magento-borg/resolve-array-data
KevinBKozan Apr 19, 2018
ebbe2d1
MQE-501: JavaScript reporting during test run
KevinBKozan Apr 19, 2018
298bbca
MQE-896: Page schema needs to allow empty section
KevinBKozan Apr 19, 2018
df4db87
MQE-899: Excessive double quotes are being generated in WaitForElemen…
KevinBKozan Apr 19, 2018
83dab03
MQE-957: MFTF Changes to support DEVOPS-2029
imeron2433 Apr 18, 2018
3277034
MQE-957: MFTF Changes to support DEVOPS-2029
imeron2433 Apr 18, 2018
e4c1f25
MQE-957: MFTF Changes to support DEVOPS-2029
imeron2433 Apr 19, 2018
02661c3
Merge pull request #104 from magento/MQE-957
imeron2433 Apr 19, 2018
d7b3ce6
MQE-766: Drag & Drop support to allow resizing of elements
KevinBKozan Apr 20, 2018
0c0f3d6
MQE-970: Tests in Suites being omitted when line counts are exact match
KevinBKozan Apr 20, 2018
53ec0e8
MQE-971: DeleteData using url is generated incorrectly in Suite hooks
KevinBKozan Apr 23, 2018
883c327
MQE-974: Change folder name from `MFTF` to `Mftf`
KevinBKozan Apr 23, 2018
1b40c8e
MQE-925: 2.2.0 CHANGELOG
KevinBKozan Apr 23, 2018
93f3b62
MQE-977: ErrorLogger expects source to be a log paramater
imeron2433 Apr 23, 2018
7a04afa
Merge pull request #113 from magento/MQE-977
imeron2433 Apr 23, 2018
ead3447
MQE-967: Resolve MFTF/Acceptance composer.json with Magento2CE
imeron2433 Apr 24, 2018
3e6d14e
Merge pull request #114 from magento/MQE-967
imeron2433 Apr 24, 2018
4dd196d
MQE-955: Commit proper version in MFTF composer.json/create the new r…
imeron2433 Apr 24, 2018
fb1e4b7
Merge pull request #115 from magento/MQE-955
imeron2433 Apr 24, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#Copyright © Magento, Inc. All rights reserved.
#See COPYING.txt for license details.

#*** Set the base URL for your Magento instance ***#
MAGENTO_BASE_URL=http://devdocs.magento.com/

#*** Set the Admin Username and Password for your Magento instance ***#
MAGENTO_BACKEND_NAME=admin
MAGENTO_ADMIN_USERNAME=admin
MAGENTO_ADMIN_PASSWORD=123123q

#*** Path to CLI entry point and command parameter name. Uncomment and change if folder structure differs from standard Magento installation
#MAGENTO_CLI_COMMAND_PATH=dev/tests/acceptance/utils/command.php
#MAGENTO_CLI_COMMAND_PARAMETER=command

#*** Selenium Server Protocol, Host, Port, and Path, with local defaults. Uncomment and change if not running Selenium locally.
#SELENIUM_HOST=127.0.0.1
#SELENIUM_PORT=4444
#SELENIUM_PROTOCOL=http
#SELENIUM_PATH=/wd/hub

#*** Browser for running tests, default chrome. Uncomment and change if you want to run tests on another browser (ex. firefox).
BROWSER=chrome

#*** Uncomment and set host & port if your dev environment needs different value other than MAGENTO_BASE_URL for Rest API Requests ***#
#MAGENTO_RESTAPI_SERVER_HOST=
#MAGENTO_RESTAPI_SERVER_PORT=

#*** Uncomment these properties to set up a dev environment with symlinked projects ***#
#TESTS_BP=
#FW_BP=
#TESTS_MODULE_PATH=

#*** These properties impact the modules loaded into MFTF, you can point to your own full path, or a custom set of modules located with the core set
MODULE_WHITELIST=Magento_Framework,Magento_ConfigurableProductWishlist,Magento_ConfigurableProductCatalogSearch
#CUSTOM_MODULE_PATHS=

#*** Bool property which allows the user to toggle debug output during test execution
#MFTF_DEBUG=
#*** End of .env ***#
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,6 @@ build/*
clover.xml
coverage/
.vscode
codeception.yml
dev/tests/functional/MFTF.suite.yml
dev/tests/functional/_output
50 changes: 50 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,56 @@
Magento Functional Testing Framework Changelog
================================================

2.2.0
-----
### Enhancements
* Traceability
* Javascript errors are now logged and reported in test output.
* Test failures are no longer overwritten by failures in an `<after>` hook.
* Tests will no longer execute an `<after>` hook twice if a failure triggered in the `<after>` hook.
* Tests marked with `<group value="skip">` will now appear in generated Allure reports.
* Along with the above, the `robo group` command no longer omits the `skip` group (skipped tests are picked up but not fully executed).
* Modularity
* MFTF no longer relies on relative pathing to determine its path to tests or Magento (favoring composer information if available).
* Tests and test materials are now read in from Magento modules as well as extensions in addition to `dev/tests/acceptance`.
* See DevDocs `Getting Started` for details on expected paths and merge order.
* Customizability
* Creation of Suites is now supported
* `<suite>` can include tests via `name`, module, or `<group>` tags.
* Consolidation of preconditions can be achieved via use of `<before/after>` tags in a `<suite>`
* All normal test actions are supported
* Data returned from actions is not available for reference in subsequent tests (`createData` or `grab` actions).
* `robo generate:tests` generates all suites and tests, and can be given a JSON configuration to generate specific test/suites.
* See MFTF Devdocs "Suite" page for more details.
* `<deleteData>` may now be called against a `url` instead of a stepKey reference.
* `<dragAndDrop>` may now be given an additional `x/y` offset.
* `<executeJS>` now returns a variable based on what the executed script returns.
* Added `<element>` `type="block"`.
* `<page>` elements may now be blank (contain no child sections).
* Maintainability
* `robo generate:tests --config parallel` now accepts a `--lines` argument, for grouping and sorting based on test length.
* `robo generate:tests` now checks for:
* Duplicate step keys within an `actionGroup`.
* Ambiguous or invalid `stepKey` references (in merge files).
* `robo generate:tests` now suppresses warnings by default. The command now accepts a `--verbose` flag to show full output including warnings.

### Fixes
* Exception message for the `<conditionalClick>` action now correctly references the `selector` given.
* Usage of multiple parameterized elements in a `selector` now correctly resolves all element references.
* Usage of multiple uniqueness references on the same entity now generate correctly.
* Persisted entity references are correctly interpolated with `<page>` url of `type="admin"`.
* Metadata that contains 2 or more params in its `url` now correctly resolve parameters.
* Arguments can now be passed to `x` and `y` attributes in `actionGroup`.
* Arguments can now be passed to nested `<assert*>` action elements.
* The `<seeInField>` action can now be used to assert against empty strings.
* Empty `<data>` elements within an `<entity>` now generate correctly.
* Mapping of the `<magentoCLI>` to the custom command has been fixed.

### GitHub Issues/Pull requests:
* [#89](https://github.com/magento/magento2-functional-testing-framework/pull/89) -- Add ability to use array entities as arguments.
* [#68](https://github.com/magento/magento2-functional-testing-framework/issues/68) -- Excessive double quotes are being generated in WaitForElementChange method arguments (fixed in [#103](https://github.com/magento/magento2-functional-testing-framework/pull/103))
* [#31](https://github.com/magento/magento2-functional-testing-framework/issues/31) -- Can't run tests without a store having "default" store code (fixed in [#86](https://github.com/magento/magento2-functional-testing-framework/pull/86))

2.1.2
-----
### Enhancements
Expand Down
214 changes: 214 additions & 0 deletions RoboFile.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,214 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/

/** This is project's console commands configuration for Robo task runner.
*
* @codingStandardsIgnoreStart
* @see http://robo.li/
*/
class RoboFile extends \Robo\Tasks
{
use Robo\Task\Base\loadShortcuts;

/**
* Duplicate the Example configuration files used to customize the Project for customization.
*
* @return void
*/
function cloneFiles()
{
$this->_exec('cp -vn .env.example .env');
$this->_exec('cp -vf codeception.dist.yml codeception.yml');
$this->_exec('cp -vf dev' . DIRECTORY_SEPARATOR . 'tests'. DIRECTORY_SEPARATOR . 'functional' . DIRECTORY_SEPARATOR .'MFTF.suite.dist.yml dev' . DIRECTORY_SEPARATOR . 'tests'. DIRECTORY_SEPARATOR . 'functional' . DIRECTORY_SEPARATOR .'MFTF.suite.yml');
}

/**
* Duplicate the Example configuration files for the Project.
* Build the Codeception project.
*
* @return void
*/
function buildProject()
{
$this->writeln("<error>This command will be removed in MFTF v3.0.0. Please use bin/mftf build:project instead.</error>\n");
$this->cloneFiles();
$this->_exec('vendor'. DIRECTORY_SEPARATOR .'bin'. DIRECTORY_SEPARATOR .'codecept build');
}

/**
* Generate all Tests in PHP.
*
* @param array $tests
* @param array $opts
* @return void
*/
function generateTests(array $tests, $opts = ['config' => null, 'force' => true, 'nodes' => null, 'debug' => false])
{
require 'dev' . DIRECTORY_SEPARATOR . 'tests'. DIRECTORY_SEPARATOR . 'functional' . DIRECTORY_SEPARATOR . '_bootstrap.php';
$GLOBALS['GENERATE_TESTS'] = true;
if (!$this->isProjectBuilt()) {
$this->say("<info>Please run bin/mftf build:project and configure your environment (.env) first.</info>");
exit(\Robo\Result::EXITCODE_ERROR);
}
$testsObjects = [];
foreach ($tests as $test) {
$testsObjects[] = Magento\FunctionalTestingFramework\Test\Handlers\TestObjectHandler::getInstance()->getObject($test);
}
if ($opts['force']) {
$GLOBALS['FORCE_PHP_GENERATE'] = true;
}
$testsReferencedInSuites = \Magento\FunctionalTestingFramework\Suite\SuiteGenerator::getInstance()->generateAllSuites($opts['config']);
\Magento\FunctionalTestingFramework\Util\TestGenerator::getInstance(null, $testsObjects, $opts['debug'])->createAllTestFiles($opts['config'], $opts['nodes'], $testsReferencedInSuites);
$this->say("<comment>Generate Tests Command Run</comment>");
}

/**
* Check if MFTF has been properly configured
* @return bool
*/
private function isProjectBuilt()
{
$actorFile = __DIR__ . DIRECTORY_SEPARATOR . 'src' . DIRECTORY_SEPARATOR . 'Magento' . DIRECTORY_SEPARATOR . 'FunctionalTestingFramework' . DIRECTORY_SEPARATOR . '_generated' . DIRECTORY_SEPARATOR . 'AcceptanceTesterActions.php';

$login = !empty(getenv('MAGENTO_ADMIN_USERNAME'));
$password = !empty(getenv('MAGENTO_ADMIN_PASSWORD'));
$baseUrl = !empty(getenv('MAGENTO_BASE_URL'));
$backendName = !empty(getenv('MAGENTO_BACKEND_NAME'));
$test = (file_exists($actorFile) && $login && $password && $baseUrl && $backendName);
return $test;
}

/**
* Generate a suite based on name(s) passed in as args.
*
* @param array $args
* @throws Exception
* @return void
*/
function generateSuite(array $args)
{
if (empty($args)) {
throw new Exception("Please provide suite name(s) after generate:suite command");
}

require 'dev' . DIRECTORY_SEPARATOR . 'tests'. DIRECTORY_SEPARATOR . 'functional' . DIRECTORY_SEPARATOR . '_bootstrap.php';
$sg = \Magento\FunctionalTestingFramework\Suite\SuiteGenerator::getInstance();

foreach ($args as $arg) {
$sg->generateSuite($arg);
}
}

/**
* Run all MFTF tests.
*
* @return void
*/
function mftf()
{
$this->_exec('.' . DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . 'bin' . DIRECTORY_SEPARATOR . 'codecept run MFTF --skip-group skip');
}

/**
* Run all Tests with the specified @group tag, excluding @group 'skip'.
*
* @param string $args
* @return void
*/
function group($args = '')
{
$this->taskExec('.' . DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . 'bin' . DIRECTORY_SEPARATOR . 'codecept run --verbose --steps --skip-group skip --group')->args($args)->run();
}

/**
* Run all Functional tests located under the Directory Path provided.
*
* @param string $args
* @return void
*/
function folder($args = '')
{
$this->taskExec('.' . DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . 'bin' . DIRECTORY_SEPARATOR . 'codecept run ')->args($args)->run();
}

/**
* Run all Tests marked with the @group tag 'example'.
*
* @return void
*/
function example()
{
$this->_exec('.' . DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . 'bin' . DIRECTORY_SEPARATOR . 'codecept run --group example --skip-group skip');
}

/**
* Generate the HTML for the Allure report based on the Test XML output - Allure v1.4.X
*
* @return \Robo\Result
*/
function allure1Generate()
{
return $this->_exec('allure generate tests'. DIRECTORY_SEPARATOR .'_output'. DIRECTORY_SEPARATOR .'allure-results'. DIRECTORY_SEPARATOR .' -o tests'. DIRECTORY_SEPARATOR .'_output'. DIRECTORY_SEPARATOR .'allure-report'. DIRECTORY_SEPARATOR .'');
}

/**
* Generate the HTML for the Allure report based on the Test XML output - Allure v2.3.X
*
* @return \Robo\Result
*/
function allure2Generate()
{
return $this->_exec('allure generate tests'. DIRECTORY_SEPARATOR .'_output'. DIRECTORY_SEPARATOR .'allure-results'. DIRECTORY_SEPARATOR .' --output tests'. DIRECTORY_SEPARATOR .'_output'. DIRECTORY_SEPARATOR .'allure-report'. DIRECTORY_SEPARATOR .' --clean');
}

/**
* Open the HTML Allure report - Allure v1.4.X
*
* @return void
*/
function allure1Open()
{
$this->_exec('allure report open --report-dir tests'. DIRECTORY_SEPARATOR .'_output'. DIRECTORY_SEPARATOR .'allure-report'. DIRECTORY_SEPARATOR .'');
}

/**
* Open the HTML Allure report - Allure v2.3.X
*
* @return void
*/
function allure2Open()
{
$this->_exec('allure open --port 0 tests'. DIRECTORY_SEPARATOR .'_output'. DIRECTORY_SEPARATOR .'allure-report'. DIRECTORY_SEPARATOR .'');
}

/**
* Generate and open the HTML Allure report - Allure v1.4.X
*
* @return void
*/
function allure1Report()
{
$result1 = $this->allure1Generate();

if ($result1->wasSuccessful()) {
$this->allure1Open();
}
}

/**
* Generate and open the HTML Allure report - Allure v2.3.X
*
* @return void
*/
function allure2Report()
{
$result1 = $this->allure2Generate();

if ($result1->wasSuccessful()) {
$this->allure2Open();
}
}
}
30 changes: 30 additions & 0 deletions bin/mftf
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/usr/bin/env php

<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/

if (PHP_SAPI !== 'cli') {
echo 'bin/mftf must be run as a CLI application';
exit(1);
}

try {
require_once __DIR__ . '/../bootstrap.php';
$application = new Symfony\Component\Console\Application();
$application->setName('Magento Functional Testing Framework CLI');
$application->setVersion('1.0.0');
$application->add(new Magento\FunctionalTestingFramework\Console\SetupEnvCommand());
$application->add(new Magento\FunctionalTestingFramework\Console\BuildProjectCommand());
$application->run();
} catch (\Exception $e) {
while ($e) {
echo $e->getMessage();
echo $e->getTraceAsString();
echo "\n\n";
$e = $e->getPrevious();
}
exit(1);
}
4 changes: 2 additions & 2 deletions bin/static-checks
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ set -e
echo "==============================="
echo " CODE SNIFFER"
echo "==============================="
vendor/bin/phpcs ./src --standard=./dev/tests/static/Magento
vendor/bin/phpcs ./src --standard=./dev/tests/static/Magento --ignore=src/Magento/FunctionalTestingFramework/Group,src/Magento/FunctionalTestingFramework/AcceptanceTester.php
vendor/bin/phpcs ./dev/tests/unit --standard=./dev/tests/static/Magento
vendor/bin/phpcs ./dev/tests/verification --standard=./dev/tests/static/Magento --ignore=dev/tests/verification/_generated
echo ""
Expand All @@ -22,7 +22,7 @@ echo ""
echo "==============================="
echo " MESS DETECTOR"
echo "==============================="
vendor/bin/phpmd ./src text /dev/tests/static/Magento/CodeMessDetector/ruleset.xml --exclude _generated
vendor/bin/phpmd ./src text /dev/tests/static/Magento/CodeMessDetector/ruleset.xml --exclude _generated,src/Magento/FunctionalTestingFramework/Group,src/Magento/FunctionalTestingFramework/AcceptanceTester.php
echo ""

echo "==============================="
Expand Down
4 changes: 2 additions & 2 deletions bin/static-checks.bat
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@

@echo off
@echo ===============================PHP CODE SNIFFER REPORT===============================
call vendor\bin\phpcs .\src --standard=.\dev\tests\static\Magento
call vendor\bin\phpcs .\src --standard=.\dev\tests\static\Magento --ignore=src\Magento\FunctionalTestingFramework\Group,src\Magento\FunctionalTestingFramework\AcceptanceTester.php
call vendor\bin\phpcs .\dev\tests\unit --standard=.\dev\tests\static\Magento
call vendor\bin\phpcs .\dev\tests\verification --standard=.\dev\tests\static\Magento --ignore=dev\tests\verification\_generated

@echo ===============================COPY PASTE DETECTOR REPORT===============================
call vendor\bin\phpcpd .\src

@echo "===============================PHP MESS DETECTOR REPORT===============================
vendor\bin\phpmd .\src text \dev\tests\static\Magento\CodeMessDetector\ruleset.xml --exclude _generated
vendor\bin\phpmd .\src text \dev\tests\static\Magento\CodeMessDetector\ruleset.xml --exclude _generated,src\Magento\FunctionalTestingFramework\Group,src\Magento\FunctionalTestingFramework\AcceptanceTester.php

@echo ===============================MAGENTO COPYRIGHT REPORT===============================
echo msgbox "INFO:Copyright check currently not run as part of .bat implementation" > "%temp%\popup.vbs"
Expand Down
8 changes: 8 additions & 0 deletions bootstrap.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/

require_once 'vendor/autoload.php';
define('BP', __DIR__);
Loading