Skip to content

Commit 0cd23b1

Browse files
authored
Merge pull request #901 from magento-qmt/qmt-pr
[Mavericks] Extend functional tests coverage and bugfixes - MAGETWO-64945: [FT] PaymentMethodsBlock is absent on checkout - MAGETWO-63775: [FT] Magento\Catalog\Test\TestCase\Category\CreateCategoryEntityTest fails on Jenkins - MTA-4096: Ignore functional test failures caused by Magento issues - MTA-4097: Ignore functional test failures caused by Magento issues - MAGETWO-63738: [FT] Incorrect integration resources comparison - MAGETWO-64878: [FT] Incorrect error message on customer login page - MAGETWO-64891: [FT] Magento\Catalog\Test\TestCase\Product\CreateSimpleProductEntityTest fails on CI - MTA-3902: Create auto test to Accepting transactions with "Authorize and hold for review" + "Authorize and Capture" options - MTA-3975: Add variation for Place order via eWAY Responsive Shared Pages with Payment Action = Authorize Only - MTA-4003: Refactor CreateInvoiceEntityTest in Sales module - MTA-4058: Create auto test to Refund for Order Paid with PayPal Payflow Link
2 parents 3f75fac + fd954d4 commit 0cd23b1

File tree

135 files changed

+1906
-486
lines changed

Some content is hidden

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

135 files changed

+1906
-486
lines changed

dev/tests/functional/credentials.xml.dist

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,13 @@
2828
<field replace="carriers_dhl_password_eu" value="" />
2929
<field replace="carriers_dhl_account_eu" value="" />
3030

31-
<field path="payment/authorizenet_directpost/login" value="" />
32-
<field path="payment/authorizenet_directpost/trans_key" value="" />
33-
<field path="payment/authorizenet_directpost/trans_md5" value="" />
31+
<field replace="payment_authorizenet_login" value="" />
32+
<field replace="payment_authorizenet_trans_key" value="" />
33+
<field replace="payment_authorizenet_trans_md5" value="" />
34+
35+
<field replace="authorizenet_fraud_review_login" value="" />
36+
<field replace="authorizenet_fraud_review_trans_key" value="" />
37+
<field replace="authorizenet_fraud_review_md5" value="" />
3438

3539
<field replace="braintree_enabled_fraud_merchant_account_id" value="" />
3640
<field replace="braintree_enabled_fraud_merchant_id" value="" />

dev/tests/functional/etc/repository_replacer_payments.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,11 @@
1414
<field name="privateKey" xsi:type="string">BRAINTREE_PRIVATE_KEY</field>
1515
</dataset>
1616
</repository>
17+
18+
<repository class="Magento\Authorizenet\Test\Repository\AuthorizenetSandboxCustomer">
19+
<dataset name="sandbox_fraud_hold_review">
20+
<field name="login_id" xsi:type="string">AUTHORIZENET_LOGIN_ID</field>
21+
<field name="password" xsi:type="string">AUTHORIZENET_PASSWORD</field>
22+
</dataset>
23+
</repository>
1724
</config>

dev/tests/functional/lib/Magento/Mtf/App/State/AbstractState.php

Lines changed: 5 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,12 @@
33
* Copyright © 2013-2017 Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6-
76
namespace Magento\Mtf\App\State;
87

9-
use Magento\Framework\App\Filesystem\DirectoryList;
10-
use Magento\Framework\Config\ConfigOptionsListConstants;
11-
use Magento\Framework\App\DeploymentConfig\Reader;
12-
use Magento\Framework\App\DeploymentConfig;
138
use Magento\Mtf\ObjectManager;
149

1510
/**
16-
* Abstract class AbstractState
17-
*
11+
* Provides abstract implementation for Application State Interface.
1812
*/
1913
abstract class AbstractState implements StateInterface
2014
{
@@ -26,22 +20,20 @@ abstract class AbstractState implements StateInterface
2620
protected $objectManager;
2721

2822
/**
29-
* List of handlers
23+
* List of handlers.
3024
*
3125
* @var string[]
3226
*/
3327
private $arguments;
3428

3529
/**
36-
* Specifies whether to clean instance under test
30+
* Specifies whether to clean instance under test.
3731
*
3832
* @var bool
3933
*/
4034
protected $isCleanInstance = false;
4135

4236
/**
43-
* AbstractState constructor.
44-
*
4537
* @param ObjectManager $objectManager
4638
* @param array $arguments
4739
*/
@@ -68,64 +60,10 @@ public function apply()
6860
}
6961

7062
/**
71-
* Clear Magento instance: remove all tables in DB and use dump to load new ones, clear Magento cache
72-
*
73-
* @throws \Exception
63+
* @inheritdoc
7464
*/
7565
public function clearInstance()
7666
{
77-
$dirList = \Magento\Mtf\ObjectManagerFactory::getObjectManager()
78-
->get(\Magento\Framework\Filesystem\DirectoryList::class);
79-
80-
$configFilePool = \Magento\Mtf\ObjectManagerFactory::getObjectManager()
81-
->get(\Magento\Framework\Config\File\ConfigFilePool::class);
82-
83-
$driverPool = \Magento\Mtf\ObjectManagerFactory::getObjectManager()
84-
->get(\Magento\Framework\Filesystem\DriverPool::class);
85-
86-
$reader = new Reader($dirList, $driverPool, $configFilePool);
87-
$deploymentConfig = new DeploymentConfig($reader);
88-
$host = $deploymentConfig->get(
89-
ConfigOptionsListConstants::CONFIG_PATH_DB_CONNECTION_DEFAULT . '/' . ConfigOptionsListConstants::KEY_HOST
90-
);
91-
$user = $deploymentConfig->get(
92-
ConfigOptionsListConstants::CONFIG_PATH_DB_CONNECTION_DEFAULT . '/' . ConfigOptionsListConstants::KEY_USER
93-
);
94-
$password = $deploymentConfig->get(
95-
ConfigOptionsListConstants::CONFIG_PATH_DB_CONNECTION_DEFAULT .
96-
'/' . ConfigOptionsListConstants::KEY_PASSWORD
97-
);
98-
$database = $deploymentConfig->get(
99-
ConfigOptionsListConstants::CONFIG_PATH_DB_CONNECTION_DEFAULT . '/' . ConfigOptionsListConstants::KEY_NAME
100-
);
101-
102-
$fileName = MTF_BP . '/' . $database . '.sql';
103-
if (!file_exists($fileName)) {
104-
echo('Database dump was not found by path: ' . $fileName);
105-
return;
106-
}
107-
108-
// Drop all tables in database
109-
$mysqli = new \mysqli($host, $user, $password, $database);
110-
$mysqli->query('SET foreign_key_checks = 0');
111-
if ($result = $mysqli->query("SHOW TABLES")) {
112-
while ($row = $result->fetch_row()) {
113-
$mysqli->query('DROP TABLE ' . $row[0]);
114-
}
115-
}
116-
$mysqli->query('SET foreign_key_checks = 1');
117-
$mysqli->close();
118-
119-
// Load database dump
120-
exec("mysql -u{$user} -p{$password} {$database} < {$fileName}", $output, $result);
121-
if ($result) {
122-
throw new \Exception('Database dump loading has been failed: ' . $output);
123-
}
124-
125-
// Clear cache
126-
exec("rm -rf {$dirList->getPath(DirectoryList::VAR_DIR)}/*", $output, $result);
127-
if ($result) {
128-
throw new \Exception('Cleaning Magento cache has been failed: ' . $output);
129-
}
67+
//
13068
}
13169
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?xml version="1.0" ?>
2+
<!--
3+
/**
4+
* Copyright © 2013-2017 Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/Magento/Mtf/Repository/etc/repository.xsd">
9+
<repository class="Magento\Integration\Test\Repository\Integration">
10+
<dataset name="default_with_all_resources">
11+
<field name="resources" xsi:type="array">
12+
<item name="100" xsi:type="string">Analytics</item>
13+
</field>
14+
</dataset>
15+
</repository>
16+
</config>

dev/tests/functional/tests/app/Magento/Analytics/Test/TestCase/FreeTierButtonTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* 2. Click on page actions button.
1515
* 3. Perform asserts.
1616
*
17-
* @ZephyrId MAGETWO-34874
17+
* @ZephyrId MAGETWO-63715
1818
*/
1919
class FreeTierButtonTest extends Injectable
2020
{

dev/tests/functional/tests/app/Magento/Analytics/Test/TestCase/FreeTierButtonTest.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd">
99
<testCase name="Magento\Analytics\Test\TestCase\FreeTierButtonTest" summary="Navigate through Free Tier button on dashboard to Sign Up page" ticketId="MAGETWO-63715">
1010
<variation name="FreeTierButtonTest">
11+
<data name="issue" xsi:type="string">MAGETWO-65653: [FT] Incorrect URL for FreeTierButtonTest</data>
1112
<data name="advancedReportingLink" xsi:type="string">https://advancedreporting.rjmetrics.com/report</data>
1213
<constraint name="Magento\Analytics\Test\Constraint\AssertFreeTierLink" />
1314
</variation>

dev/tests/functional/tests/app/Magento/Analytics/Test/TestCase/NavigateMenuTest.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd">
99
<testCase name="Magento\Backend\Test\TestCase\NavigateMenuTest">
1010
<variation name="NavigateMenuTestBasicTier" summary="Navigate through Basic Tier admin menu to Sign Up page" ticketId="MAGETWO-63700">
11+
<data name="issue" xsi:type="string">MAGETWO-65634: [FT] Incorrect URL for NavigateMenuTestBasicTier</data>
1112
<data name="menuItem" xsi:type="string">Reports > Basic Tier</data>
1213
<data name="waitMenuItemNotVisible" xsi:type="boolean">false</data>
1314
<data name="businessIntelligenceLink" xsi:type="string">https://dashboard.rjmetrics.com/v2/magento/signup</data>
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
<?php
2+
/**
3+
* Copyright © 2013-2017 Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
namespace Magento\Authorizenet\Test\Block\Sandbox;
7+
8+
use Magento\Mtf\Block\Form;
9+
use Magento\Mtf\Client\Element\SimpleElement;
10+
use Magento\Mtf\Fixture\FixtureInterface;
11+
12+
/**
13+
* Login form.
14+
*/
15+
class AuthorizenetLogin extends Form
16+
{
17+
/**
18+
* Login button on Authorize.Net Sandbox.
19+
*
20+
* @var string
21+
*/
22+
private $loginButton = '[type=submit]';
23+
24+
/**
25+
* Switch to the form frame and fill form. {@inheritdoc}
26+
*
27+
* @param FixtureInterface $fixture
28+
* @param SimpleElement|null $element
29+
* @return $this
30+
*/
31+
public function fill(FixtureInterface $fixture, SimpleElement $element = null)
32+
{
33+
parent::fill($fixture, $element);
34+
return $this;
35+
}
36+
37+
/**
38+
* Login to Authorize.Net Sandbox.
39+
*
40+
* @return void
41+
*/
42+
public function login()
43+
{
44+
$this->_rootElement->find($this->loginButton)->click();
45+
}
46+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0" ?>
2+
<!--
3+
/**
4+
* Copyright © 2013-2017 Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
<mapping strict="1">
9+
<fields>
10+
<login_id>
11+
<selector>[name=MerchantLogin]</selector>
12+
</login_id>
13+
<password>
14+
<selector>[name=Password]</selector>
15+
</password>
16+
</fields>
17+
</mapping>
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<?php
2+
/**
3+
* Copyright © 2013-2017 Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
namespace Magento\Authorizenet\Test\Block\Sandbox;
7+
8+
use Magento\Mtf\Block\Block;
9+
10+
/**
11+
* 'Get started accepting payments' modal window on Authorize.Net sandbox.
12+
*/
13+
class GetStartedModal extends Block
14+
{
15+
/**
16+
* 'Got It' button selector.
17+
* This button is located in notification window which may appear immediately after login.
18+
*
19+
* @var string
20+
*/
21+
private $gotItButton = '#btnGetStartedGotIt';
22+
23+
/**
24+
* Accept notification if it appears after login.
25+
*
26+
* @return $this
27+
*/
28+
public function acceptNotification()
29+
{
30+
$element = $this->browser->find($this->gotItButton);
31+
if ($element->isVisible()) {
32+
$element->click();
33+
}
34+
return $this;
35+
}
36+
}

0 commit comments

Comments
 (0)