Skip to content

Deliver changes from Contribution Day #63

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 28 commits into from
Mar 30, 2018
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
7a89255
Make possible to create and run MFTF test in framework to verify Fram…
okolesnyk Mar 22, 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
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
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
8e7d4d8
Merge pull request #64 from sdzhepa/mftf#56
okolesnyk 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
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
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
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
37 changes: 37 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#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=
MAGENTO_ADMIN_USERNAME=
MAGENTO_ADMIN_PASSWORD=

#*** 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

#*** 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
190 changes: 190 additions & 0 deletions RoboFile.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,190 @@
<?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->cloneFiles();
$this->_exec('vendor'. DIRECTORY_SEPARATOR .'bin'. DIRECTORY_SEPARATOR .'codecept build');
}

/**
* Generate all Tests in PHP.
*
* @param array $opts
* @return void
*/
function generateTests($opts = ['config' => null, 'force' => true, 'nodes' => null])
{
$GLOBALS['GENERATE_TESTS'] = true;

if ($opts['force'])
{
$GLOBALS['FORCE_PHP_GENERATE'] = true;
}

require 'dev' . DIRECTORY_SEPARATOR . 'tests'. DIRECTORY_SEPARATOR . 'functional' . DIRECTORY_SEPARATOR . '_bootstrap.php';
\Magento\FunctionalTestingFramework\Util\TestGenerator::getInstance()->createAllTestFiles($opts['config'], $opts['nodes']);
$this->say("Generate Tests Command Run");
}

/**
* 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 Functional tests.
*
* @return void
*/
function functional()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This robo command did not work as expected.

{
$this->_exec('.' . DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . 'bin' . DIRECTORY_SEPARATOR . 'codecept run functional --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();
}
}
}
27 changes: 27 additions & 0 deletions codeception.dist.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Copyright © Magento, Inc. All rights reserved.
# See COPYING.txt for license details.
actor: Tester
paths:
tests: dev/tests/functional
log: dev/tests/functional/_output
data: dev/tests/functional/_data
support: src/Magento/FunctionalTestingFramework
envs: etc/_envs
settings:
bootstrap: _bootstrap.php
colors: true
memory_limit: 1024M
extensions:
enabled:
- Codeception\Extension\RunFailed
- Yandex\Allure\Adapter\AllureAdapter
config:
Yandex\Allure\Adapter\AllureAdapter:
deletePreviousResults: true
outputDirectory: allure-results
ignoredAnnotations:
- env
- zephyrId
- useCaseId
params:
- .env
9 changes: 7 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,15 @@
},
"require": {
"php": "7.0.2|7.0.4|~7.0.6|~7.1.0|~7.2.0",
"allure-framework/allure-codeception": "~1.2.6",
"codeception/codeception": "~2.3.4",
"consolidation/robo": "^1.0.0",
"epfremme/swagger-php": "^2.0",
"flow/jsonpath": ">0.2",
"fzaninotto/faker": "^1.6",
"mustache/mustache": "~2.5"
"mustache/mustache": "~2.5",
"symfony/process": ">=2.7 <3.4",
"vlucas/phpdotenv": "^2.4"
},
"require-dev": {
"squizlabs/php_codesniffer": "1.5.3",
Expand All @@ -30,7 +34,8 @@
},
"autoload": {
"psr-4": {
"Magento\\FunctionalTestingFramework\\": "src/Magento/FunctionalTestingFramework"
"Magento\\FunctionalTestingFramework\\": "src/Magento/FunctionalTestingFramework",
"MFTF\\": "dev/tests/functional/MFTF"
}
},
"autoload-dev": {
Expand Down
Loading