Skip to content

[Pangolins] Sprint 13 #15

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 39 commits into from
Nov 21, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
b3bf4eb
MQE-388: Write store settings before tests
imeron2433 Oct 26, 2017
541a42b
MQE-388: Write store settings before tests
imeron2433 Oct 27, 2017
5a60dec
Merge remote-tracking branch 'origin/sprint-develop' into MQE-448
jilu1 Nov 1, 2017
942eaf0
MQE-472: refactored entity update mechanism and removed path param type.
jilu1 Nov 2, 2017
4acbb80
MQE-508: before and after tags should have their own group/type in th…
imeron2433 Nov 6, 2017
284ec7b
MQE-483: Sanitize test naming to prevent Jenkins build failure
imeron2433 Nov 6, 2017
44428ad
MQE-483: Sanitize test naming to prevent Jenkins build failure
imeron2433 Nov 8, 2017
26a59c7
MQE-483: Sanitize test naming to prevent Jenkins build failure
imeron2433 Nov 8, 2017
42b677d
MQE-432: Create variable reference verification tests
KevinBKozan Nov 9, 2017
e041473
Merge branch 'develop' of github.com:magento-pangolin/magento2-functi…
okolesnyk Nov 10, 2017
8a112cd
MQE-421: Create Unit Tests for the object model
tomreece Nov 10, 2017
b4ecb1f
MQE-235: added codeception Asserts module functions in framework.
jilu1 Nov 9, 2017
ff6d257
MQE-336: [Generator] Add support for Codeception "Locator" selectors
KevinBKozan Nov 10, 2017
91cc434
MQE-448: created a utility script to generate mftf metadata from mage…
jilu1 Nov 1, 2017
687a87a
Merge remote-tracking branch 'origin/MQE-448' into sprint-develop
jilu1 Nov 10, 2017
3b6581b
MQE-531: Unit and Verification tests do not run with MFTF PR
imeron2433 Nov 8, 2017
4ea5fe2
MQE-531: Unit and Verification tests do not run with MFTF PR
imeron2433 Nov 9, 2017
6a17e5e
MQE-531: Unit and Verification tests do not run with MFTF PR
okolesnyk Nov 9, 2017
e87c464
Merge branch 'sprint-develop' into MQE-421
tomreece Nov 13, 2017
f3848f1
MQE-421: Create Unit Tests for the object model
tomreece Nov 13, 2017
33a862f
MQE-462: Update waitForLoadingMaskToDisappear to handle duplicated masks
KevinBKozan Nov 13, 2017
a053dd0
MQE-421: Create Unit Tests for the object model
tomreece Nov 13, 2017
60a7244
MQE-544: Fixed verification test filenames.
jilu1 Nov 13, 2017
a25b568
Merge branch 'MQE-421' into sprint-develop
tomreece Nov 13, 2017
71607e3
Merge branch 'MQE-472-new' into sprint-develop
jilu1 Nov 13, 2017
c475f52
Merge remote-tracking branch 'origin/MQE-544' into sprint-develop
jilu1 Nov 13, 2017
730f063
MQE-516: Duplicated $data.key$ references are not replaced correctly
KevinBKozan Nov 13, 2017
a464b25
MQE-516: Duplicated $data.key$ references are not replaced correctly
KevinBKozan Nov 14, 2017
cd4ac24
MQE-544: Fixed verification test filenames and set assertFileEquals()…
jilu1 Nov 14, 2017
dceff25
Merge remote-tracking branch 'origin/MQE-544' into sprint-develop
jilu1 Nov 14, 2017
2e966be
MQE-497: Add useCaseId annotation
KevinBKozan Nov 15, 2017
356db16
Merge branch 'MQE-235' into sprint-develop
jilu1 Nov 15, 2017
cef7b0b
MQE-235: Fixed additional merge conflict.
jilu1 Nov 15, 2017
00af5c9
MQE-235: added codeception Asserts module functions in framework.
jilu1 Nov 16, 2017
4feb793
MQE-235: added codeception Asserts module functions in framework.
jilu1 Nov 16, 2017
76f9cdc
MQE-434: Create operation api unit tests
imeron2433 Nov 20, 2017
0665f5a
MQE-434: Create operation api unit tests
imeron2433 Nov 20, 2017
10f1683
Merge branch 'develop' of github.com:magento-pangolin/magento2-functi…
okolesnyk Nov 21, 2017
053c01f
MQE-406: Omitting defaultValue for actionGroup argument causes error
okolesnyk Nov 21, 2017
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
16 changes: 8 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ language: php
php:
- 7.0
- 7.1
install:
- composer install --no-interaction --prefer-source
before_script:
- composer require codacy/coverage --dev
install: composer install --no-interaction --prefer-source
env:
matrix:
- VERIFICATION_TOOL=copyright-check
- VERIFICATION_TOOL=phpunit-checks
- VERIFICATION_TOOL=static-checks
script:
- bin/all-checks
- bin/$VERIFICATION_TOOL
after_script:
- php vendor/bin/codacycoverage phpunit


- if [ $VERIFICATION_TOOL == "phpunit-checks" ]; then php vendor/bin/codacycoverage phpunit; fi
2 changes: 2 additions & 0 deletions bin/static-checks
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

echo "===============================PHP CODE SNIFFER REPORT==============================="
vendor/bin/phpcs ./src --standard=./dev/tests/static/Magento
vendor/bin/phpcs ./dev/tests/unit --standard=./dev/tests/static/Magento
vendor/bin/phpcs ./dev/tests/verification --standard=./dev/tests/static/Magento

echo "===============================COPY PASTE DETECTOR REPORT==============================="
vendor/bin/phpcpd ./src
Expand Down
16 changes: 12 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,30 @@
"description": "Magento2 Functional Testing Framework",
"keywords": ["magento", "automation", "functional", "testing"],
"require": {
"php": "~7.0",
"codeception/codeception": "2.2|2.3",
"php": "7.0.2|7.0.4|~7.0.6|~7.1.0",
"codeception/codeception": "~2.3.4",
"flow/jsonpath": ">0.2",
"fzaninotto/faker": "^1.6",
"mustache/mustache": "~2.5"
"mustache/mustache": "~2.5",
"epfremme/swagger-php": "^2.0"
},
"require-dev": {
"squizlabs/php_codesniffer": "1.5.3",
"sebastian/phpcpd": "~3.0",
"brainmaestro/composer-git-hooks": "^2.3"
"brainmaestro/composer-git-hooks": "^2.3",
"codeception/aspect-mock": "^2.0",
"codacy/coverage": "^1.4"
},
"autoload": {
"psr-4": {
"Magento\\FunctionalTestingFramework\\": ["src/Magento/FunctionalTestingFramework"]
}
},
"autoload-dev": {
"psr-4": {
"tests\\unit\\Magento\\FunctionalTestingFramework\\": ["dev/tests/unit/Magento/FunctionalTestingFramework"]
}
},
"extra": {
"hooks": {
"pre-push": "bin/copyright-check"
Expand Down
8 changes: 7 additions & 1 deletion dev/tests/_bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@
define('PROJECT_ROOT', dirname(dirname(__DIR__)));
require_once PROJECT_ROOT . '/vendor/autoload.php';

// Set up AspectMock
$kernel = \AspectMock\Kernel::getInstance();
$kernel->init([
'debug' => true,
'includePaths' => [PROJECT_ROOT . '/src']
]);

// Load needed framework env params
$TEST_ENVS = [
'MAGENTO_BASE_URL' => 'http://baseurl:8080',
Expand All @@ -23,7 +30,6 @@
// Add our test module to the whitelist
putenv('MODULE_WHITELIST=Magento_TestModule');


// Define our own set of paths for the tests
defined('FW_BP') || define('FW_BP', PROJECT_ROOT);

Expand Down
5 changes: 3 additions & 2 deletions dev/tests/phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/6.3/phpunit.xsd"
convertNoticesToExceptions="false"
bootstrap="_bootstrap.php">
bootstrap="_bootstrap.php"
backupGlobals="false">
<testsuites>
<testsuite name="verification">
<directory>verification</directory>
Expand All @@ -27,4 +28,4 @@
<directory suffix=".php">../../src/Magento/FunctionalTestingFramework/Util</directory>
</whitelist>
</filter>
</phpunit>
</phpunit>
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/

namespace tests\unit\Magento\FunctionalTestFramework\DataGenerator\Handlers;

use AspectMock\Test as AspectMock;
use Magento\FunctionalTestingFramework\DataGenerator\Handlers\DataObjectHandler;
use Magento\FunctionalTestingFramework\DataGenerator\Objects\EntityDataObject;
use Magento\FunctionalTestingFramework\DataGenerator\Parsers\DataProfileSchemaParser;
use Magento\FunctionalTestingFramework\ObjectManager;
use Magento\FunctionalTestingFramework\ObjectManagerFactory;
use PHPUnit\Framework\TestCase;

/**
* Class DataObjectHandlerTest
*/
class DataObjectHandlerTest extends TestCase
{
// All tests share this array, feel free to add but be careful modifying or removing
const PARSER_OUTPUT = [
'entity' => [
'EntityOne' => [
'type' => 'testType',
'data' => [
0 => [
'key' => 'testKey',
'value' => 'testValue'
]
]
]
]
];

/**
* Set up everything required to mock DataObjectHander::getInstance()
* The first call to getInstance() uses these mocks to emulate the parser, initializing internal state
* according to the PARSER_OUTPUT value
*/
public static function setUpBeforeClass()
{
$mockDataProfileSchemaParser = AspectMock::double(DataProfileSchemaParser::class, [
'readDataProfiles' => self::PARSER_OUTPUT
])->make();

$mockObjectManager = AspectMock::double(ObjectManager::class, [
'create' => $mockDataProfileSchemaParser
])->make();

AspectMock::double(ObjectManagerFactory::class, [
'getObjectManager' => $mockObjectManager
]);
}

/**
* getAllObjects should contain the expected data object
*/
public function testGetAllObjects()
{
// Call the method under test

$actual = DataObjectHandler::getInstance()->getAllObjects();

// Assert

$expected = new EntityDataObject('EntityOne', 'testType', ['testkey' => 'testValue'], [], null, []);
$this->assertArrayHasKey('EntityOne', $actual);
$this->assertEquals($expected, $actual['EntityOne']);
}

/**
* getObject should return the expected data object if it exists
*/
public function testGetObject()
{
// Call the method under test

$actual = DataObjectHandler::getInstance()->getObject('EntityOne');

// Assert

$expected = new EntityDataObject('EntityOne', 'testType', ['testkey' => 'testValue'], [], null, []);
$this->assertEquals($expected, $actual);
}

/**
* getObject should return null if the data object does not exist
*/
public function testGetObjectNull()
{
$actual = DataObjectHandler::getInstance()->getObject('h953u789h0g73t521'); // doesnt exist
$this->assertNull($actual);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/

namespace tests\unit\Magento\FunctionalTestFramework\DataGenerator\Handlers;

use PHPUnit\Framework\TestCase;

/**
* Class OperationDefinitionObjectHandlerTest
*/
class OperationDefinitionObjectHandlerTest extends TestCase
{
public function testTodo()
{
$this->markTestIncomplete('TODO');
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/

namespace tests\unit\Magento\FunctionalTestFramework\DataGenerator\Objects;

use PHPUnit\Framework\TestCase;

/**
* Class EntityDataObjectTest
*/
class EntityDataObjectTest extends TestCase
{
public function testTodo()
{
$this->markTestIncomplete('TODO');
}
}
Loading