Skip to content

Commit c38622c

Browse files
author
Vadim Zubovich
committed
Merge branch 'MTO-78-new' of git.epam.com:magn-fat/magn-fat-ce into iteration2-pr-new
# Conflicts: # dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/OnePageCheckoutTest.php # dev/tests/functional/tests/app/Magento/Checkout/Test/TestStep/SelectCheckoutMethodStep.php # dev/tests/functional/tests/app/Magento/SalesRule/Test/TestCase/CreateSalesRuleEntityTest.xml
2 parents e8bc21d + cc90e72 commit c38622c

File tree

6 files changed

+80
-15
lines changed

6 files changed

+80
-15
lines changed
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<?xml version="1.0"?>
2+
<!--
3+
/**
4+
* Copyright © 2016 Magento. 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\Config\Test\Repository\ConfigData">
10+
<dataset name="disable_guest_checkout">
11+
<field name="checkout/options/guest_checkout" xsi:type="array">
12+
<item name="scope" xsi:type="string">checkout</item>
13+
<item name="scope_id" xsi:type="number">1</item>
14+
<item name="label" xsi:type="string">No</item>
15+
<item name="value" xsi:type="string">0</item>
16+
</field>
17+
</dataset>
18+
<dataset name="disable_guest_checkout_rollback">
19+
<field name="checkout/options/guest_checkout" xsi:type="array">
20+
<item name="scope" xsi:type="string">checkout</item>
21+
<item name="scope_id" xsi:type="number">1</item>
22+
<item name="label" xsi:type="string">Yes</item>
23+
<item name="value" xsi:type="string">1</item>
24+
</field>
25+
</dataset>
26+
<dataset name="disable_customer_redirect_after_logging">
27+
<field name="customer/startup/redirect_dashboard" xsi:type="array">
28+
<item name="scope" xsi:type="string">customer</item>
29+
<item name="scope_id" xsi:type="number">1</item>
30+
<item name="label" xsi:type="string">No</item>
31+
<item name="value" xsi:type="string">0</item>
32+
</field>
33+
</dataset>
34+
<dataset name="disable_customer_redirect_after_logging_rollback">
35+
<field name="customer/startup/redirect_dashboard" xsi:type="array">
36+
<item name="scope" xsi:type="string">customer</item>
37+
<item name="scope_id" xsi:type="number">1</item>
38+
<item name="label" xsi:type="string">Yes</item>
39+
<item name="value" xsi:type="string">1</item>
40+
</field>
41+
</dataset>
42+
</repository>
43+
</config>

dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/OnePageCheckoutTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@
3333
* 14. Perform assertions.
3434
*
3535
* @group One_Page_Checkout
36-
* @ZephyrId MAGETWO-27485, MAGETWO-12412, MAGETWO-12429, MAGETWO-42598, MAGETWO-42599
36+
* @ZephyrId MAGETWO-27485, MAGETWO-12412, MAGETWO-12429, MAGETWO-42598
3737
* @ZephyrId MAGETWO-12444, MAGETWO-12848, MAGETWO-12849, MAGETWO-12850
38-
* @ZephyrId MAGETWO-42547
38+
* @ZephyrId MAGETWO-42547, MAGETWO-42599, MAGETWO-49917, MAGETWO-27485
3939
*/
4040
class OnePageCheckoutTest extends Scenario
4141
{

dev/tests/functional/tests/app/Magento/Checkout/Test/TestStep/SelectCheckoutMethodStep.php

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -91,19 +91,25 @@ public function __construct(
9191
*/
9292
public function run()
9393
{
94-
if ($this->checkoutMethod === 'login') {
94+
$this->processLogin();
95+
$this->processRegister();
96+
}
97+
98+
/**
99+
* Process login action.
100+
*
101+
* @return void
102+
*/
103+
private function processLogin()
104+
{
105+
if ($this->checkoutMethod == 'login') {
95106
if ($this->checkoutOnepage->getAuthenticationPopupBlock()->isVisible()) {
96107
$this->checkoutOnepage->getAuthenticationPopupBlock()->loginCustomer($this->customer);
97108
$this->clickProceedToCheckoutStep->run();
98109
} else {
99110
$this->checkoutOnepage->getLoginBlock()->loginCustomer($this->customer);
100111
}
101112
}
102-
103-
if ($this->checkoutMethod === 'sign_in') {
104-
$this->checkoutOnepage->getAuthenticationWrapperBlock()->signInLinkClick();
105-
$this->checkoutOnepage->getAuthenticationWrapperBlock()->loginCustomer($this->customer);
106-
}
107113
}
108114

109115
/**
@@ -120,16 +126,13 @@ private function processRegister()
120126
}
121127

122128
/**
123-
* Logout customer on frontend.
129+
* Logout customer on fronted.
124130
*
125131
* @return void
126132
*/
127133
public function cleanup()
128134
{
129-
if ($this->checkoutMethod === 'login'
130-
|| $this->checkoutMethod === 'sign_in'
131-
|| $this->checkoutMethod === 'register_before_checkout'
132-
) {
135+
if ($this->checkoutMethod === 'login' || $this->checkoutMethod === 'register_before_checkout') {
133136
$this->logoutCustomerOnFrontend->run();
134137
}
135138
}

dev/tests/functional/tests/app/Magento/Customer/Test/Block/Account/AuthenticationPopup.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,23 @@ class AuthenticationPopup extends Form
2727
*/
2828
private $loadingMask = '.loading-mask';
2929

30+
/**
31+
* 'Create an Account' button.
32+
*
33+
* @var string
34+
*/
35+
protected $createAccountButton = '.action.action-register.primary';
36+
37+
/**
38+
* Click 'Create an Account' button.
39+
*
40+
* @return void
41+
*/
42+
public function createAccount()
43+
{
44+
$this->_rootElement->find($this->createAccountButton)->click();
45+
}
46+
3047
/**
3148
* Login customer on authentication popup.
3249
*

dev/tests/functional/tests/app/Magento/Customer/Test/TestStep/CreateCustomerStep.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,9 @@ public function __construct(LogoutCustomerOnFrontendStep $logout, Customer $cust
4646
{
4747
$this->logoutCustomerOnFrontend = $logout;
4848
$this->customer = $customer;
49-
if ($checkoutMethod === 'register' || $checkoutMethod === 'guest') {
49+
if ($checkoutMethod === 'register'
50+
|| $checkoutMethod === 'guest'
51+
|| $checkoutMethod === 'register_before_checkout') {
5052
$this->persistCustomer = false;
5153
}
5254
}

dev/tests/functional/tests/app/Magento/SalesRule/Test/TestCase/CreateSalesRuleEntityTest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,12 +418,12 @@
418418
<data name="address/data/country_id" xsi:type="string">United States</data>
419419
<data name="address/data/region_id" xsi:type="string">California</data>
420420
<data name="address/data/postcode" xsi:type="string">95814</data>
421+
<data name="shipping/shipping_service" xsi:type="string">Flat Rate</data>
421422
<data name="productForSalesRule1/dataset" xsi:type="string">simple_for_salesrule_1</data>
422423
<data name="productQuantity/productForSalesRule1" xsi:type="string">1</data>
423424
<constraint name="Magento\SalesRule\Test\Constraint\AssertCartPriceRuleSuccessSaveMessage" />
424425
<constraint name="Magento\SalesRule\Test\Constraint\AssertCartPriceRuleConditionIsApplied" />
425426
<constraint name="Magento\SalesRule\Test\Constraint\AssertCartPriceRuleFreeShippingIsApplied" />
426-
<data name="tag" xsi:type="string">test_type:current</data>
427427
</variation>
428428
</testCase>
429429
</config>

0 commit comments

Comments
 (0)