Skip to content
Snippets Groups Projects
Commit c71c8757 authored by Vasyl Kozyrenko's avatar Vasyl Kozyrenko
Browse files

MTA-3900: Create auto test to Refund an order placed through Braintree with full capture

parent 9d1f863f
Branches
No related merge requests found
......@@ -8,16 +8,21 @@
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd">
<testCase name="Magento\Braintree\Test\TestCase\CreateOnlineCreditMemoBraintreeTest" summary="Create online credit memo for Braintree credit card" ticketId="MAGETWO-38324">
<variation name="CreateOnlineCreditMemoBraintreeTestVariation1" summary="Refund an order placed through Braintree with full capture" ticketId="MAGETWO-38324">
<data name="products/0" xsi:type="string">catalogProductSimple::product_10_dollar</data>
<data name="products/1" xsi:type="string">configurableProduct::with_one_option</data>
<data name="products/2" xsi:type="string">bundleProduct::bundle_fixed_100_dollar_product</data>
<data name="tag" xsi:type="string">test_type:3rd_party_test, severity:S1</data>
<data name="products" xsi:type="array">
<item name="0" xsi:type="string">catalogProductSimple::product_10_dollar</item>
<item name="1" xsi:type="string">configurableProduct::with_one_option</item>
<item name="2" xsi:type="string">bundleProduct::bundle_fixed_100_dollar_product</item>
</data>
<data name="customer/dataset" xsi:type="string">default</data>
<data name="braintreeSandboxCustomer/dataset" xsi:type="string">braintree_sandbox_default</data>
<data name="taxRule" xsi:type="string">us_ca_ny_rule</data>
<data name="shippingAddress/dataset" xsi:type="string">US_address_1_without_email</data>
<data name="checkoutMethod" xsi:type="string">guest</data>
<data name="shipping/shipping_service" xsi:type="string">Flat Rate</data>
<data name="shipping/shipping_method" xsi:type="string">Fixed</data>
<data name="shipping" xsi:type="array">
<item name="shipping_service" xsi:type="string">Flat Rate</item>
<item name="shipping_method" xsi:type="string">Fixed</item>
</data>
<data name="payment/method" xsi:type="string">braintree</data>
<data name="creditCard/dataset" xsi:type="string">visa_default</data>
<data name="creditCard/data/payment_code" xsi:type="string">braintree</data>
......@@ -26,12 +31,11 @@
<data name="refundedPrices" xsi:type="array">
<item name="0" xsi:type="string">145.98</item>
</data>
<data name="transactions/Refund" xsi:type="array">
<data name="transactions/refund" xsi:type="array">
<item name="transactionType" xsi:type="string">Refund</item>
<item name="statusIsClosed" xsi:type="string">Yes</item>
</data>
<data name="data/items_data/0/qty" xsi:type="string">-</data>
<data name="tag" xsi:type="string">test_type:3rd_party_test, severity:S1</data>
<constraint name="Magento\Sales\Test\Constraint\AssertRefundSuccessCreateMessage" />
<constraint name="Magento\Sales\Test\Constraint\AssertRefundInCommentsHistory" />
<constraint name="Magento\Sales\Test\Constraint\AssertOrderStatusIsCorrect" />
......
......@@ -8,6 +8,7 @@ namespace Magento\Braintree\Test\TestStep;
use Magento\Braintree\Test\Fixture\BraintreeSandboxCustomer;
use Magento\Sales\Test\Page\Adminhtml\OrderIndex;
use Magento\Sales\Test\Page\Adminhtml\SalesOrderView;
use Magento\Mtf\ObjectManagerFactory;
use Braintree\Gateway;
use Magento\Mtf\TestStep\TestStepInterface;
......@@ -70,7 +71,7 @@ class SettleTransactionStep implements TestStepInterface
public function run()
{
$credentials = $this->braintreeSandboxCustomer->getData();
$gateway = new Gateway($credentials);
$gateway = ObjectManagerFactory::getObjectManager()->create(Gateway::class, ['config' => $credentials]);
$transactionId = $this->getTransactionId();
$gateway->testing()->settle($transactionId);
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment