Skip to content

Commit a9a65c7

Browse files
authored
Merge pull request #604 from magento-mpi/MAGETWO-60453
MAGETWO-60453 DeleteSavedCreditCardTest fails on bamboo MAGETWO-60572 [GitHub] PayPal.js error on checkout downloadable product #7000
2 parents 3a8df23 + c2404ae commit a9a65c7

File tree

9 files changed

+114
-4
lines changed

9 files changed

+114
-4
lines changed

app/code/Magento/Braintree/view/frontend/web/js/view/payment/method-renderer/paypal.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ define([
296296
getShippingAddress: function () {
297297
var address = quote.shippingAddress();
298298

299-
if (address.postcode === null) {
299+
if (_.isNull(address.postcode) || _.isUndefined(address.postcode)) {
300300

301301
return {};
302302
}

dev/tests/functional/tests/app/Magento/Braintree/Test/TestCase/OnePageCheckoutWithBraintreePaypalTest.xml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,5 +50,21 @@
5050
<constraint name="Magento\Sales\Test\Constraint\AssertOrderStatusIsCorrect" />
5151
<constraint name="Magento\Sales\Test\Constraint\AssertCaptureInCommentsHistory" />
5252
</variation>
53+
<variation name="OnePageCheckoutWithBraintreePaypalTestVariation3" summary="Guest Checkout virtual quote with Braintree PayPal from Cart" ticketId="MAGETWO-41559">
54+
<data name="products/0" xsi:type="string">catalogProductVirtual::product_50_dollar</data>
55+
<data name="customer/dataset" xsi:type="string">default</data>
56+
<data name="checkoutMethod" xsi:type="string">guest</data>
57+
<data name="prices" xsi:type="array">
58+
<item name="grandTotal" xsi:type="string">50.00</item>
59+
</data>
60+
<data name="payment/method" xsi:type="string">braintree_paypal</data>
61+
<data name="configData" xsi:type="string">braintree, braintree_paypal, braintree_paypal_skip_order_review</data>
62+
<data name="status" xsi:type="string">Processing</data>
63+
<data name="tag" xsi:type="string">test_type:3rd_party_test, severity:S2</data>
64+
<constraint name="Magento\Checkout\Test\Constraint\AssertOrderSuccessPlacedMessage" />
65+
<constraint name="Magento\Sales\Test\Constraint\AssertOrderGrandTotal" />
66+
<constraint name="Magento\Sales\Test\Constraint\AssertOrderStatusIsCorrect" />
67+
<constraint name="Magento\Sales\Test\Constraint\AssertAuthorizationInCommentsHistory" />
68+
</variation>
5369
</testCase>
5470
</config>

dev/tests/functional/tests/app/Magento/Braintree/Test/TestStep/PlaceOrderWithPaypalStep.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
namespace Magento\Braintree\Test\TestStep;
77

88
use Magento\Checkout\Test\Constraint\AssertGrandTotalOrderReview;
9+
use Magento\Checkout\Test\Constraint\AssertBillingAddressAbsentInPayment;
910
use Magento\Checkout\Test\Page\CheckoutOnepage;
1011
use Magento\Checkout\Test\Page\CheckoutOnepageSuccess;
1112
use Magento\Mtf\Fixture\FixtureFactory;
@@ -26,6 +27,11 @@ class PlaceOrderWithPaypalStep implements TestStepInterface
2627
*/
2728
private $assertGrandTotalOrderReview;
2829

30+
/**
31+
* @var AssertBillingAddressAbsentInPayment
32+
*/
33+
private $assertBillingAddressAbsentInPayment;
34+
2935
/**
3036
* @var CheckoutOnepageSuccess
3137
*/
@@ -49,6 +55,7 @@ class PlaceOrderWithPaypalStep implements TestStepInterface
4955
/**
5056
* @param CheckoutOnepage $checkoutOnepage
5157
* @param AssertGrandTotalOrderReview $assertGrandTotalOrderReview
58+
* @param AssertBillingAddressAbsentInPayment $assertBillingAddressAbsentInPayment
5259
* @param CheckoutOnepageSuccess $checkoutOnepageSuccess
5360
* @param FixtureFactory $fixtureFactory
5461
* @param array $products
@@ -57,13 +64,15 @@ class PlaceOrderWithPaypalStep implements TestStepInterface
5764
public function __construct(
5865
CheckoutOnepage $checkoutOnepage,
5966
AssertGrandTotalOrderReview $assertGrandTotalOrderReview,
67+
AssertBillingAddressAbsentInPayment $assertBillingAddressAbsentInPayment,
6068
CheckoutOnepageSuccess $checkoutOnepageSuccess,
6169
FixtureFactory $fixtureFactory,
6270
array $products,
6371
array $prices = []
6472
) {
6573
$this->checkoutOnepage = $checkoutOnepage;
6674
$this->assertGrandTotalOrderReview = $assertGrandTotalOrderReview;
75+
$this->assertBillingAddressAbsentInPayment = $assertBillingAddressAbsentInPayment;
6776
$this->checkoutOnepageSuccess = $checkoutOnepageSuccess;
6877
$this->fixtureFactory = $fixtureFactory;
6978
$this->products = $products;
@@ -78,6 +87,9 @@ public function run()
7887
if (isset($this->prices['grandTotal'])) {
7988
$this->assertGrandTotalOrderReview->processAssert($this->checkoutOnepage, $this->prices['grandTotal']);
8089
}
90+
91+
$this->assertBillingAddressAbsentInPayment->processAssert($this->checkoutOnepage);
92+
8193
$parentWindow = $this->checkoutOnepage->getPaymentBlock()
8294
->getSelectedPaymentMethodBlock()
8395
->clickPayWithPaypal();

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,19 @@ public function loginCustomer(FixtureInterface $customer)
9090
$this->waitForElementNotVisible($this->loadingMask);
9191
}
9292

93+
/**
94+
* Fill required fields for guest checkout.
95+
*
96+
* @param FixtureInterface $customer
97+
* @return void
98+
*/
99+
public function fillGuestFields(FixtureInterface $customer)
100+
{
101+
$mapping = $this->dataMapping();
102+
$this->_rootElement->find($mapping['email']['selector'], $mapping['email']['strategy'])
103+
->setValue($customer->getEmail());
104+
}
105+
93106
/**
94107
* Click continue on checkout method block.
95108
*
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<?php
2+
/**
3+
* Copyright © 2016 Magento. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
namespace Magento\Checkout\Test\Constraint;
8+
9+
use Magento\Checkout\Test\Page\CheckoutOnepage;
10+
use Magento\Mtf\Constraint\AbstractConstraint;
11+
12+
/**
13+
* Assert billing address is not present in selected payment method.
14+
*/
15+
class AssertBillingAddressAbsentInPayment extends AbstractConstraint
16+
{
17+
/**
18+
* Assert billing address is not present in selected payment method.
19+
*
20+
* @param CheckoutOnepage $checkoutOnepage
21+
* @return void
22+
*/
23+
public function processAssert(CheckoutOnepage $checkoutOnepage)
24+
{
25+
\PHPUnit_Framework_Assert::assertFalse(
26+
$checkoutOnepage->getPaymentBlock()
27+
->getSelectedPaymentMethodBlock()
28+
->getBillingBlock()
29+
->isVisible(),
30+
'Billing address is present in payment method'
31+
);
32+
}
33+
34+
/**
35+
* Returns string representation of successful assertion
36+
*
37+
* @return string
38+
*/
39+
public function toString()
40+
{
41+
return 'Billing address is absent in payment method';
42+
}
43+
}

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

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,26 +51,36 @@ class SelectCheckoutMethodStep implements TestStepInterface
5151
*/
5252
private $clickProceedToCheckoutStep;
5353

54+
/**
55+
* Shipping carrier and method.
56+
*
57+
* @var array
58+
*/
59+
protected $shipping;
60+
5461
/**
5562
* @constructor
5663
* @param CheckoutOnepage $checkoutOnepage
5764
* @param Customer $customer
5865
* @param LogoutCustomerOnFrontendStep $logoutCustomerOnFrontend
5966
* @param ClickProceedToCheckoutStep $clickProceedToCheckoutStep
6067
* @param string $checkoutMethod
68+
* @param array $shipping
6169
*/
6270
public function __construct(
6371
CheckoutOnepage $checkoutOnepage,
6472
Customer $customer,
6573
LogoutCustomerOnFrontendStep $logoutCustomerOnFrontend,
6674
ClickProceedToCheckoutStep $clickProceedToCheckoutStep,
67-
$checkoutMethod
75+
$checkoutMethod,
76+
array $shipping = []
6877
) {
6978
$this->checkoutOnepage = $checkoutOnepage;
7079
$this->customer = $customer;
7180
$this->logoutCustomerOnFrontend = $logoutCustomerOnFrontend;
7281
$this->clickProceedToCheckoutStep = $clickProceedToCheckoutStep;
7382
$this->checkoutMethod = $checkoutMethod;
83+
$this->shipping = $shipping;
7484
}
7585

7686
/**
@@ -87,6 +97,10 @@ public function run()
8797
} else {
8898
$this->checkoutOnepage->getLoginBlock()->loginCustomer($this->customer);
8999
}
100+
} elseif ($this->checkoutMethod === 'guest') {
101+
if (empty($this->shipping)) {
102+
$this->checkoutOnepage->getLoginBlock()->fillGuestFields($this->customer);
103+
}
90104
}
91105
}
92106

dev/tests/functional/tests/app/Magento/Checkout/Test/etc/di.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@
1212
<argument name="severity" xsi:type="string">middle</argument>
1313
</arguments>
1414
</type>
15+
<type name="Magento\Checkout\Test\Constraint\AssertBillingAddressAbsentInPayment">
16+
<arguments>
17+
<argument name="severity" xsi:type="string">S2</argument>
18+
</arguments>
19+
</type>
1520
<type name="Magento\Checkout\Test\Constraint\AssertOrderSuccessPlacedMessage">
1621
<arguments>
1722
<argument name="severity" xsi:type="string">S0</argument>

dev/tests/functional/tests/app/Magento/Payment/Test/Repository/CreditCard.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,13 @@
1414
<field name="cc_cid" xsi:type="string">123</field>
1515
</dataset>
1616

17+
<dataset name="visa_alt">
18+
<field name="cc_number" xsi:type="string">4012888888881881</field>
19+
<field name="cc_exp_month" xsi:type="string">02 - February</field>
20+
<field name="cc_exp_year" xsi:type="string">2021</field>
21+
<field name="cc_cid" xsi:type="string">123</field>
22+
</dataset>
23+
1724
<dataset name="amex_default">
1825
<field name="cc_number" xsi:type="string">378282246310005</field>
1926
<field name="cc_exp_month" xsi:type="string">02 - February</field>

dev/tests/functional/tests/app/Magento/Vault/Test/TestCase/DeleteSavedCreditCardTest.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
<item name="method" xsi:type="string">payflowpro</item>
2727
<item name="creditCardClass" xsi:type="string">credit_card</item>
2828
<item name="creditCard" xsi:type="array">
29-
<item name="dataset" xsi:type="string">amex_default</item>
29+
<item name="dataset" xsi:type="string">visa_alt</item>
3030
</item>
3131
</item>
3232
<item name="2" xsi:type="array">
@@ -43,7 +43,7 @@
4343
<item name="method" xsi:type="string">payflowpro</item>
4444
<item name="creditCardClass" xsi:type="string">credit_card</item>
4545
<item name="creditCard" xsi:type="array">
46-
<item name="dataset" xsi:type="string">amex_default</item>
46+
<item name="dataset" xsi:type="string">visa_alt</item>
4747
</item>
4848
<item name="vault" xsi:type="array">
4949
<item name="method" xsi:type="string">payflowpro_cc_vault</item>

0 commit comments

Comments
 (0)