Skip to content

Commit 8b031bf

Browse files
authored
Merge pull request #528 from magento/MFTF2.5.4-RC
MFTF 2.5.4
2 parents f627085 + 1ca5694 commit 8b031bf

File tree

74 files changed

+2216
-465
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+2216
-465
lines changed

CHANGELOG.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,30 @@
11
Magento Functional Testing Framework Changelog
22
================================================
3+
2.5.4
4+
-----
5+
6+
* Traceability
7+
* Introduced new `mftf doctor` command
8+
* Command verifies and troubleshoots some configuration steps required for running tests
9+
* Please see DevDocs for more details
10+
* `<*Data>` actions now contain `API Endpoint` and `Request Header` artifacts.
11+
* Introduced new `.env` configurations `ENABLE_BROWSER_LOG` and `BROWSER_LOG_BLACKLIST`
12+
* Configuration enables allure artifacts for browser log entries if they are present after the step.
13+
* Blacklist filters out logs from specific sources.
14+
* Customizability
15+
* Introduced `timeout=""` to `magentoCLI` actions.
16+
17+
### GitHub Issues/Pull requests:
18+
* [#317](https://github.com/magento/magento2-functional-testing-framework/pull/317) -- RetrieveEntityField generation does not consider ActionGroup as part of namespace
19+
* [#433](https://github.com/magento/magento2-functional-testing-framework/pull/433) -- Add possibility to include multiple non primitive types in an array
20+
21+
### Fixes
22+
* A test now contains attachments for every exception encountered in the test (fix for a test `<after>` exception overriding all test exceptions).
23+
* Fixed hard requirement for `MAGENTO_BASE_URL` to contain a leading `/`.
24+
* `magentoCLI` actions for `config:sensitive:set` no longer obscure CLI output.
25+
* `WAIT_TIMEOUT` in the `.env` now correctly sets `pageload_timeout` configuration.
26+
* Fixed an issue where `run:group` could not consolidate a `group` that had tests in and out of `<suite>`s.
27+
328
2.5.3
429
-----
530

bin/mftf

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,11 @@ try {
2727

2828

2929
try {
30+
$version = json_decode(file_get_contents(FW_BP . DIRECTORY_SEPARATOR . 'composer.json'), true);
31+
$version = $version['version'];
3032
$application = new Symfony\Component\Console\Application();
3133
$application->setName('Magento Functional Testing Framework CLI');
32-
$application->setVersion('2.5.3');
34+
$application->setVersion($version);
3335
/** @var \Magento\FunctionalTestingFramework\Console\CommandListInterface $commandList */
3436
$commandList = new \Magento\FunctionalTestingFramework\Console\CommandList;
3537
foreach ($commandList->getCommands() as $command) {

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "magento/magento2-functional-testing-framework",
33
"description": "Magento2 Functional Testing Framework",
44
"type": "library",
5-
"version": "2.5.3",
5+
"version": "2.5.4",
66
"license": "AGPL-3.0",
77
"keywords": ["magento", "automation", "functional", "testing"],
88
"config": {
@@ -12,7 +12,7 @@
1212
"php": "7.0.2||7.0.4||~7.0.6||~7.1.0||~7.2.0||~7.3.0",
1313
"ext-curl": "*",
1414
"allure-framework/allure-codeception": "~1.3.0",
15-
"codeception/codeception": "~2.3.4 || ~2.4.0 ",
15+
"codeception/codeception": "~2.4.5",
1616
"composer/composer": "^1.4",
1717
"consolidation/robo": "^1.0.0",
1818
"csharpru/vault-php": "~3.5.3",

composer.lock

Lines changed: 69 additions & 28 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dev/tests/_bootstrap.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@
4545
'MAGENTO_BACKEND_NAME' => 'admin',
4646
'MAGENTO_ADMIN_USERNAME' => 'admin',
4747
'MAGENTO_ADMIN_PASSWORD' => 'admin123',
48-
'DEFAULT_TIMEZONE' => 'America/Los_Angeles'
48+
'DEFAULT_TIMEZONE' => 'America/Los_Angeles',
49+
'WAIT_TIMEOUT' => '10'
4950
];
5051

5152
foreach ($TEST_ENVS as $key => $value) {

dev/tests/functional/standalone_bootstrap.php

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,12 @@
1515

1616
require_once realpath(PROJECT_ROOT . '/vendor/autoload.php');
1717

18+
$envFilePath = dirname(dirname(__DIR__)) . DIRECTORY_SEPARATOR;
19+
defined('ENV_FILE_PATH') || define('ENV_FILE_PATH', $envFilePath);
20+
1821
//Load constants from .env file
19-
$envFilePath = dirname(dirname(__DIR__));
20-
if (file_exists($envFilePath . DIRECTORY_SEPARATOR . '.env')) {
21-
$env = new \Dotenv\Loader($envFilePath . DIRECTORY_SEPARATOR . '.env');
22+
if (file_exists(ENV_FILE_PATH . '.env')) {
23+
$env = new \Dotenv\Loader(ENV_FILE_PATH . '.env');
2224
$env->load();
2325

2426
foreach ($_ENV as $key => $var) {
@@ -47,7 +49,10 @@
4749

4850
defined('DEFAULT_TIMEZONE') || define('DEFAULT_TIMEZONE', 'America/Los_Angeles');
4951
$env->setEnvironmentVariable('DEFAULT_TIMEZONE', DEFAULT_TIMEZONE);
50-
52+
53+
defined('WAIT_TIMEOUT') || define('WAIT_TIMEOUT', 30);
54+
$env->setEnvironmentVariable('WAIT_TIMEOUT', 30);
55+
5156
try {
5257
new DateTimeZone(DEFAULT_TIMEZONE);
5358
} catch (\Exception $e) {

dev/tests/unit/Magento/FunctionalTestFramework/Allure/AllureHelperTest.php

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
namespace Tests\unit\Magento\FunctionalTestingFramework\Allure;
77

88
use Magento\FunctionalTestingFramework\Allure\AllureHelper;
9+
use Magento\FunctionalTestingFramework\Allure\Event\AddUniqueAttachmentEvent;
910
use Yandex\Allure\Adapter\Allure;
1011
use Yandex\Allure\Adapter\Event\AddAttachmentEvent;
1112
use Yandex\Allure\Adapter\Event\StepFinishedEvent;
@@ -24,6 +25,7 @@ class AllureHelperTest extends TestCase
2425
public function tearDown()
2526
{
2627
Allure::setDefaultLifecycle();
28+
AspectMock::clean();
2729
}
2830

2931
/**
@@ -85,13 +87,48 @@ public function testAddAttachmentToLastStep()
8587
}
8688

8789
/**
88-
* Mock file system manipulation function
90+
* AddAttachment actions should have files with different attachment names
91+
* @throws \Yandex\Allure\Adapter\AllureException
92+
*/
93+
public function testAddAttachementUniqueName()
94+
{
95+
$this->mockCopyFile();
96+
$expectedData = "string";
97+
$expectedCaption = "caption";
98+
99+
//Prepare Allure lifecycle
100+
Allure::lifecycle()->fire(new StepStartedEvent('firstStep'));
101+
102+
//Call function twice
103+
AllureHelper::addAttachmentToCurrentStep($expectedData, $expectedCaption);
104+
AllureHelper::addAttachmentToCurrentStep($expectedData, $expectedCaption);
105+
106+
// Assert file names for both attachments are not the same.
107+
$step = Allure::lifecycle()->getStepStorage()->pollLast();
108+
$attachmentOne = $step->getAttachments()[0]->getSource();
109+
$attachmentTwo = $step->getAttachments()[1]->getSource();
110+
$this->assertNotEquals($attachmentOne, $attachmentTwo);
111+
}
112+
113+
/**
114+
* Mock entire attachment writing mechanisms
89115
* @throws \Exception
90116
*/
91117
public function mockAttachmentWriteEvent()
92118
{
93-
AspectMock::double(AddAttachmentEvent::class, [
119+
AspectMock::double(AddUniqueAttachmentEvent::class, [
94120
"getAttachmentFileName" => self::MOCK_FILENAME
95121
]);
96122
}
123+
124+
/**
125+
* Mock only file writing mechanism
126+
* @throws \Exception
127+
*/
128+
public function mockCopyFile()
129+
{
130+
AspectMock::double(AddUniqueAttachmentEvent::class, [
131+
"copyFile" => true
132+
]);
133+
}
97134
}

0 commit comments

Comments
 (0)