Skip to content

Commit debfdae

Browse files
author
Vadim Zubovich
committed
MTO-95: PRs stabilization
- Added part of MTO-63 test - Added issue tag for MAGETWO-60470
1 parent 846c193 commit debfdae

File tree

13 files changed

+128
-12
lines changed

13 files changed

+128
-12
lines changed

dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateSimpleProductEntityTest.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,7 @@
317317
<constraint name="Magento\Catalog\Test\Constraint\AssertProductTierPriceOnProductPage" />
318318
</variation>
319319
<variation name="CreateSimpleProductEntityTestVariation18">
320+
<data name="issue" xsi:type="string">MAGETWO-60470: [Import Custom options] An error occurs on attempt to save the product with imported options</data>
320321
<data name="description" xsi:type="string">Create product wit suite of custom options</data>
321322
<data name="product/data/url_key" xsi:type="string">simple-product-%isolation%</data>
322323
<data name="product/data/name" xsi:type="string">Simple Product %isolation%</data>

dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Onepage/Payment/Method/Billing.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,20 @@ class Billing extends Form
3636
*/
3737
protected $sameAsShippingCheckbox = '[name="billing-address-same-as-shipping"]';
3838

39+
/**
40+
* New address select selector.
41+
*
42+
* @var string
43+
*/
44+
private $newAddressSelect = '[name="billing_address_id"]';
45+
46+
/**
47+
* New address option value.
48+
*
49+
* @var string
50+
*/
51+
private $newAddressOption = 'New Address';
52+
3953
/**
4054
* Fill billing address.
4155
*
@@ -44,6 +58,10 @@ class Billing extends Form
4458
*/
4559
public function fillBilling(Address $billingAddress)
4660
{
61+
$select = $this->_rootElement->find($this->newAddressSelect, Locator::SELECTOR_CSS, 'select');
62+
if ($select && $select->isVisible()) {
63+
$select->setValue($this->newAddressOption);
64+
}
4765
$this->fill($billingAddress);
4866
$this->clickUpdate();
4967
$this->waitForElementNotVisible($this->waitElement);

dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Onepage/Shipping.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,17 @@ public function isAddressSelected($address)
141141
return $text == $address;
142142
}
143143

144+
/**
145+
* Checks if new address button is visible.
146+
*
147+
* @return bool
148+
*/
149+
public function isPopupNewAddressButtonVisible()
150+
{
151+
$button = $this->_rootElement->find($this->popupSelector);
152+
return $button->isVisible();
153+
}
154+
144155
/**
145156
* Clicks new address button.
146157
*
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?php
2+
/**
3+
* Copyright © 2016 Magento. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
namespace Magento\Checkout\Test\Block\Onepage;
8+
9+
use Magento\Mtf\Block\Form;
10+
11+
/**
12+
* Checkout new shipping address popup block.
13+
*/
14+
class ShippingPopup extends Form
15+
{
16+
/**
17+
* Save address button selector.
18+
*
19+
* @var string
20+
*/
21+
private $saveAddressButton = '.action-save-address';
22+
23+
/**
24+
* Click on save address button.
25+
*
26+
* @return void
27+
*/
28+
public function clickSaveAddressButton()
29+
{
30+
$this->browser->find($this->saveAddressButton)->click();
31+
}
32+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?xml version="1.0" ?>
2+
<!--
3+
/**
4+
* Copyright © 2016 Magento. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
<mapping strict="0">
9+
<fields>
10+
<firstname />
11+
<lastname />
12+
<company />
13+
<street>
14+
<selector>input[name="street[0]"]</selector>
15+
</street>
16+
<city />
17+
<region_id>
18+
<input>select</input>
19+
</region_id>
20+
<country_id>
21+
<input>select</input>
22+
</country_id>
23+
<telephone />
24+
<postcode />
25+
</fields>
26+
</mapping>

dev/tests/functional/tests/app/Magento/Checkout/Test/Page/CheckoutOnepage.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
<block name="loginBlock" class="Magento\Checkout\Test\Block\Onepage\Login" locator="[data-role='email-with-possible-login']" strategy="css selector" />
1313
<block name="linksBlock" class="Magento\Theme\Test\Block\Links" locator=".header .links" strategy="css selector" />
1414
<block name="shippingBlock" class="Magento\Checkout\Test\Block\Onepage\Shipping" locator="#checkout-step-shipping" strategy="css selector" />
15+
<block name="shippingAddressPopupBlock" class="Magento\Checkout\Test\Block\Onepage\ShippingPopup" locator="#opc-new-shipping-address" strategy="css selector" />
1516
<block name="shippingMethodBlock" class="Magento\Checkout\Test\Block\Onepage\Shipping\Method" locator="#checkout-step-shipping_method" strategy="css selector" />
1617
<block name="paymentBlock" class="Magento\Checkout\Test\Block\Onepage\Payment" locator="#checkout-step-payment" strategy="css selector" />
1718
<block name="discountCodesBlock" class="Magento\Checkout\Test\Block\Onepage\Payment\DiscountCodes" locator=".discount-code" strategy="css selector" />

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

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

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,15 @@ public function run()
9494
{
9595
$shippingAddress = null;
9696
if ($this->shippingAddress) {
97-
$this->checkoutOnepage->getShippingBlock()->fill($this->shippingAddress);
97+
$shippingBlock = $this->checkoutOnepage->getShippingBlock();
98+
if ($shippingBlock->isPopupNewAddressButtonVisible()) {
99+
$shippingBlock->clickPopupNewAddressButton();
100+
$this->checkoutOnepage->getShippingAddressPopupBlock()
101+
->fill($this->shippingAddress)
102+
->clickSaveAddressButton();
103+
} else {
104+
$shippingBlock->fill($this->shippingAddress);
105+
}
98106
$shippingAddress = $this->shippingAddress;
99107
}
100108
if (isset($this->shippingAddressCustomer['new'])) {

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

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,11 @@ private function processLogin()
110110
$this->checkoutOnepage->getLoginBlock()->loginCustomer($this->customer);
111111
}
112112
}
113+
114+
if ($this->checkoutMethod === 'sign_in') {
115+
$this->checkoutOnepage->getAuthenticationWrapperBlock()->signInLinkClick();
116+
$this->checkoutOnepage->getAuthenticationWrapperBlock()->loginCustomer($this->customer);
117+
}
113118
}
114119

115120
/**
@@ -126,13 +131,15 @@ private function processRegister()
126131
}
127132

128133
/**
129-
* Logout customer on fronted.
134+
* Logout customer on frontend.
130135
*
131136
* @return void
132137
*/
133138
public function cleanup()
134139
{
135-
if ($this->checkoutMethod === 'login' || $this->checkoutMethod === 'register_before_checkout') {
140+
if ($this->checkoutMethod === 'login' ||
141+
$this->checkoutMethod === 'sign_in' ||
142+
$this->checkoutMethod === 'register_before_checkout') {
136143
$this->logoutCustomerOnFrontend->run();
137144
}
138145
}

dev/tests/functional/tests/app/Magento/Customer/Test/Repository/Address.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@
237237
<field name="street" xsi:type="string">Augsburger Strabe 41</field>
238238
<field name="postcode" xsi:type="string">10789</field>
239239
<field name="country_id" xsi:type="string">Germany</field>
240-
<field name="region_id" xsi:type="string">Berlin</field>
240+
<field name="region" xsi:type="string">Berlin</field>
241241
<field name="telephone" xsi:type="string">333-33-333-33</field>
242242
</dataset>
243243

0 commit comments

Comments
 (0)