From d4eb7453c274467dd539d87e89be080fc59921a3 Mon Sep 17 00:00:00 2001 From: Vasyl Kozyrenko Date: Mon, 26 Dec 2016 15:20:12 +0200 Subject: [PATCH 01/32] MTA-3896: Add variation for Place order via Payflow Pro with success AVS ZIP verification --- .../Customer/Test/Repository/Address.xml | 12 ++++++++ .../Paypal/Test/Repository/ConfigData.xml | 30 +++++++++++++++++++ .../TestCase/OnePageCheckoutDeclinedTest.xml | 26 ++++++++++++++++ .../Test/TestCase/OnePageCheckoutTest.xml | 20 +++++++++++++ 4 files changed, 88 insertions(+) create mode 100644 dev/tests/functional/tests/app/Magento/Paypal/Test/TestCase/OnePageCheckoutDeclinedTest.xml diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Repository/Address.xml b/dev/tests/functional/tests/app/Magento/Customer/Test/Repository/Address.xml index 2edc328b5c5df..701dad14dcca1 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Repository/Address.xml +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Repository/Address.xml @@ -297,5 +297,17 @@ California 90230 + + + John + Doe + Magento %isolation% + Culver City + 49 Main + 555-55-555-55 + United States + California + 00382 + diff --git a/dev/tests/functional/tests/app/Magento/Paypal/Test/Repository/ConfigData.xml b/dev/tests/functional/tests/app/Magento/Paypal/Test/Repository/ConfigData.xml index 1669352dc026e..90384fc3dd150 100644 --- a/dev/tests/functional/tests/app/Magento/Paypal/Test/Repository/ConfigData.xml +++ b/dev/tests/functional/tests/app/Magento/Paypal/Test/Repository/ConfigData.xml @@ -477,6 +477,7 @@ 0 + payment @@ -493,5 +494,34 @@ 0 + + + + payment + 1 + AVS Zip Does Not Match + 1 + + + payment + 1 + Card Security Code Does Not Match + 0 + + + + + payment + 1 + AVS Zip Does Not Match + 0 + + + payment + 1 + Card Security Code Does Not Match + 1 + + diff --git a/dev/tests/functional/tests/app/Magento/Paypal/Test/TestCase/OnePageCheckoutDeclinedTest.xml b/dev/tests/functional/tests/app/Magento/Paypal/Test/TestCase/OnePageCheckoutDeclinedTest.xml new file mode 100644 index 0000000000000..28a7a45c17adf --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Paypal/Test/TestCase/OnePageCheckoutDeclinedTest.xml @@ -0,0 +1,26 @@ + + + + + + catalogProductSimple::product_10_dollar + default + US_address_1_without_email + guest + Flat Rate + Fixed + payflowpro + visa_default + An error occurred on the server. Please try to place the order again. + payflowpro, payflowpro_use_avs_zip + Processing + test_type:3rd_party_test, severity:S1 + + + + diff --git a/dev/tests/functional/tests/app/Magento/Paypal/Test/TestCase/OnePageCheckoutTest.xml b/dev/tests/functional/tests/app/Magento/Paypal/Test/TestCase/OnePageCheckoutTest.xml index 655b2f5f9d3fb..0d6b5976c206a 100644 --- a/dev/tests/functional/tests/app/Magento/Paypal/Test/TestCase/OnePageCheckoutTest.xml +++ b/dev/tests/functional/tests/app/Magento/Paypal/Test/TestCase/OnePageCheckoutTest.xml @@ -80,5 +80,25 @@ + + catalogProductSimple::product_10_dollar + default + AVS_zip_match_address + guest + Flat Rate + Fixed + payflowpro + visa_default + + #Y: Yes. Matched Address and five-didgit ZIP + + payflowpro, payflowpro_use_avs_zip + Processing + test_type:3rd_party_test, severity:S1 + + + + + From efcc1dee167c90e7b8040b593ca2f9b9e7a1797c Mon Sep 17 00:00:00 2001 From: Vasyl Kozyrenko Date: Mon, 26 Dec 2016 15:52:03 +0200 Subject: [PATCH 02/32] MTA-3896: Add variation for Place order via Payflow Pro with success AVS ZIP verification --- .../tests/app/Magento/Paypal/Test/Repository/ConfigData.xml | 4 ++-- .../Paypal/Test/TestCase/OnePageCheckoutDeclinedTest.xml | 1 - .../app/Magento/Paypal/Test/TestCase/OnePageCheckoutTest.xml | 1 - 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/dev/tests/functional/tests/app/Magento/Paypal/Test/Repository/ConfigData.xml b/dev/tests/functional/tests/app/Magento/Paypal/Test/Repository/ConfigData.xml index 90384fc3dd150..30be9621c55b1 100644 --- a/dev/tests/functional/tests/app/Magento/Paypal/Test/Repository/ConfigData.xml +++ b/dev/tests/functional/tests/app/Magento/Paypal/Test/Repository/ConfigData.xml @@ -505,7 +505,7 @@ payment 1 - Card Security Code Does Not Match + Card Security Code Does Not Match 0 @@ -519,7 +519,7 @@ payment 1 - Card Security Code Does Not Match + Card Security Code Does Not Match 1 diff --git a/dev/tests/functional/tests/app/Magento/Paypal/Test/TestCase/OnePageCheckoutDeclinedTest.xml b/dev/tests/functional/tests/app/Magento/Paypal/Test/TestCase/OnePageCheckoutDeclinedTest.xml index 28a7a45c17adf..a589919814a83 100644 --- a/dev/tests/functional/tests/app/Magento/Paypal/Test/TestCase/OnePageCheckoutDeclinedTest.xml +++ b/dev/tests/functional/tests/app/Magento/Paypal/Test/TestCase/OnePageCheckoutDeclinedTest.xml @@ -18,7 +18,6 @@ visa_default An error occurred on the server. Please try to place the order again. payflowpro, payflowpro_use_avs_zip - Processing test_type:3rd_party_test, severity:S1 diff --git a/dev/tests/functional/tests/app/Magento/Paypal/Test/TestCase/OnePageCheckoutTest.xml b/dev/tests/functional/tests/app/Magento/Paypal/Test/TestCase/OnePageCheckoutTest.xml index 0d6b5976c206a..103033355de5f 100644 --- a/dev/tests/functional/tests/app/Magento/Paypal/Test/TestCase/OnePageCheckoutTest.xml +++ b/dev/tests/functional/tests/app/Magento/Paypal/Test/TestCase/OnePageCheckoutTest.xml @@ -96,7 +96,6 @@ Processing test_type:3rd_party_test, severity:S1 - From dd4b9e72ac8ccd822a18e950feefc4f7fa9ddfd6 Mon Sep 17 00:00:00 2001 From: Ostap Smolyar Date: Mon, 26 Dec 2016 16:54:22 +0200 Subject: [PATCH 03/32] MTA-3898: Add variation for Place order via Payflow Pro with success CVV verification --- .../Payment/Test/Repository/CreditCard.xml | 7 ++++++ .../Paypal/Test/Repository/ConfigData.xml | 17 ++++++++++++++ .../TestCase/OnePageCheckoutDeclinedTest.xml | 14 +++++++++++ .../Test/TestCase/OnePageCheckoutTest.xml | 23 +++++++++++++++++++ 4 files changed, 61 insertions(+) diff --git a/dev/tests/functional/tests/app/Magento/Payment/Test/Repository/CreditCard.xml b/dev/tests/functional/tests/app/Magento/Payment/Test/Repository/CreditCard.xml index 80c337d0a8578..7c87abf1db8ab 100644 --- a/dev/tests/functional/tests/app/Magento/Payment/Test/Repository/CreditCard.xml +++ b/dev/tests/functional/tests/app/Magento/Payment/Test/Repository/CreditCard.xml @@ -50,5 +50,12 @@ + + + 4111111111111111 + 01 - January + 2020 + 306 + diff --git a/dev/tests/functional/tests/app/Magento/Paypal/Test/Repository/ConfigData.xml b/dev/tests/functional/tests/app/Magento/Paypal/Test/Repository/ConfigData.xml index f1d041f0a5b34..1026b15b4d2ab 100644 --- a/dev/tests/functional/tests/app/Magento/Paypal/Test/Repository/ConfigData.xml +++ b/dev/tests/functional/tests/app/Magento/Paypal/Test/Repository/ConfigData.xml @@ -236,6 +236,23 @@ + + + payment + 1 + Yes + 1 + + + + + payment + 1 + No + 0 + + + payment diff --git a/dev/tests/functional/tests/app/Magento/Paypal/Test/TestCase/OnePageCheckoutDeclinedTest.xml b/dev/tests/functional/tests/app/Magento/Paypal/Test/TestCase/OnePageCheckoutDeclinedTest.xml index 34a122f4a55c1..7d85106016705 100644 --- a/dev/tests/functional/tests/app/Magento/Paypal/Test/TestCase/OnePageCheckoutDeclinedTest.xml +++ b/dev/tests/functional/tests/app/Magento/Paypal/Test/TestCase/OnePageCheckoutDeclinedTest.xml @@ -21,5 +21,19 @@ An error occurred on the server. Please try to place the order again. + + test_type:3rd_party_test, severity:S1 + catalogProductSimple::product_10_dollar + default + US_address_1_without_email + guest + Flat Rate + Fixed + payflowpro + visa_cvv_mismatch + payflowpro, payflowpro_avs_security_code_does_not_match + An error occurred on the server. Please try to place the order again. + + diff --git a/dev/tests/functional/tests/app/Magento/Paypal/Test/TestCase/OnePageCheckoutTest.xml b/dev/tests/functional/tests/app/Magento/Paypal/Test/TestCase/OnePageCheckoutTest.xml index 896d0de63e3a5..aa9c6117f6a3f 100644 --- a/dev/tests/functional/tests/app/Magento/Paypal/Test/TestCase/OnePageCheckoutTest.xml +++ b/dev/tests/functional/tests/app/Magento/Paypal/Test/TestCase/OnePageCheckoutTest.xml @@ -99,5 +99,28 @@ + + test_type:3rd_party_test, severity:S1 + catalogProductSimple::product_10_dollar + default + US_address_1_without_email + guest + Flat Rate + Fixed + payflowpro + + 15.00 + + visa_default + false + payflowpro, payflowpro_avs_security_code_does_not_match + + #Y: Matched (CVV2CSC) + + + + + + From 7fd703c1731dbc1cef021d096c5213236059fe85 Mon Sep 17 00:00:00 2001 From: Vasyl Kozyrenko Date: Mon, 26 Dec 2016 17:51:47 +0200 Subject: [PATCH 04/32] MTA-3895: Add variation to CreateOnlineCreditmemoTest with PayPal Payflow Pro --- .../TestCase/CreateOnlineCreditMemoTest.xml | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 dev/tests/functional/tests/app/Magento/Paypal/Test/TestCase/CreateOnlineCreditMemoTest.xml diff --git a/dev/tests/functional/tests/app/Magento/Paypal/Test/TestCase/CreateOnlineCreditMemoTest.xml b/dev/tests/functional/tests/app/Magento/Paypal/Test/TestCase/CreateOnlineCreditMemoTest.xml new file mode 100644 index 0000000000000..81b0d8ef17182 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Paypal/Test/TestCase/CreateOnlineCreditMemoTest.xml @@ -0,0 +1,46 @@ + + + + + + catalogProductSimple::product_10_dollar + default + guest + + 15.00 + + US_address_1_without_email + Flat Rate + Fixed + payflowpro + payflowpro + visa_default + - + Yes + Closed + + Authorization + Yes + + + Refund + Yes + + + Capture + Yes + + test_type:3rd_party_test, severity:S0 + + + + + + + + From 5fbd27b2fe1ea14e25af39ac82e32398bfba37b0 Mon Sep 17 00:00:00 2001 From: Vasyl Kozyrenko Date: Mon, 26 Dec 2016 17:55:45 +0200 Subject: [PATCH 05/32] MTA-3896: Add variation for Place order via Payflow Pro with success AVS ZIP verification --- .../app/Magento/Paypal/Test/Repository/ConfigData.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dev/tests/functional/tests/app/Magento/Paypal/Test/Repository/ConfigData.xml b/dev/tests/functional/tests/app/Magento/Paypal/Test/Repository/ConfigData.xml index 30be9621c55b1..679155854d5d6 100644 --- a/dev/tests/functional/tests/app/Magento/Paypal/Test/Repository/ConfigData.xml +++ b/dev/tests/functional/tests/app/Magento/Paypal/Test/Repository/ConfigData.xml @@ -499,13 +499,13 @@ payment 1 - AVS Zip Does Not Match + Yes 1 payment 1 - Card Security Code Does Not Match + No 0 @@ -513,13 +513,13 @@ payment 1 - AVS Zip Does Not Match + No 0 payment 1 - Card Security Code Does Not Match + Yes 1 From e84e5dcf748d07516f0d8a9834daf8e58a3994a8 Mon Sep 17 00:00:00 2001 From: Vasyl Kozyrenko Date: Tue, 27 Dec 2016 10:26:03 +0200 Subject: [PATCH 06/32] MTA-3895: Add variation to CreateOnlineCreditmemoTest with PayPal Payflow Pro --- .../Magento/Paypal/Test/TestCase/CreateOnlineCreditMemoTest.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/dev/tests/functional/tests/app/Magento/Paypal/Test/TestCase/CreateOnlineCreditMemoTest.xml b/dev/tests/functional/tests/app/Magento/Paypal/Test/TestCase/CreateOnlineCreditMemoTest.xml index 81b0d8ef17182..123ed68a0d7be 100644 --- a/dev/tests/functional/tests/app/Magento/Paypal/Test/TestCase/CreateOnlineCreditMemoTest.xml +++ b/dev/tests/functional/tests/app/Magento/Paypal/Test/TestCase/CreateOnlineCreditMemoTest.xml @@ -21,7 +21,6 @@ payflowpro visa_default - - Yes Closed Authorization From e3d9f6f41e8b0135954599f0402a099a33438a7a Mon Sep 17 00:00:00 2001 From: Ostap Smolyar Date: Tue, 27 Dec 2016 10:28:00 +0200 Subject: [PATCH 07/32] MTA-3898: Add variation for Place order via Payflow Pro with success CVV verification --- .../app/Magento/Paypal/Test/Repository/ConfigData.xml | 8 -------- .../Magento/Paypal/Test/TestCase/OnePageCheckoutTest.xml | 1 - 2 files changed, 9 deletions(-) diff --git a/dev/tests/functional/tests/app/Magento/Paypal/Test/Repository/ConfigData.xml b/dev/tests/functional/tests/app/Magento/Paypal/Test/Repository/ConfigData.xml index 1026b15b4d2ab..d0fcea285cd33 100644 --- a/dev/tests/functional/tests/app/Magento/Paypal/Test/Repository/ConfigData.xml +++ b/dev/tests/functional/tests/app/Magento/Paypal/Test/Repository/ConfigData.xml @@ -244,14 +244,6 @@ 1 - - - payment - 1 - No - 0 - - diff --git a/dev/tests/functional/tests/app/Magento/Paypal/Test/TestCase/OnePageCheckoutTest.xml b/dev/tests/functional/tests/app/Magento/Paypal/Test/TestCase/OnePageCheckoutTest.xml index aa9c6117f6a3f..eb854a9f8c7c1 100644 --- a/dev/tests/functional/tests/app/Magento/Paypal/Test/TestCase/OnePageCheckoutTest.xml +++ b/dev/tests/functional/tests/app/Magento/Paypal/Test/TestCase/OnePageCheckoutTest.xml @@ -112,7 +112,6 @@ 15.00 visa_default - false payflowpro, payflowpro_avs_security_code_does_not_match #Y: Matched (CVV2CSC) From 12521ae8ac0634077412e9de1666e89a28607952 Mon Sep 17 00:00:00 2001 From: Vasyl Kozyrenko Date: Wed, 28 Dec 2016 18:28:27 +0200 Subject: [PATCH 08/32] MTA-3900: Create auto test to Refund an order placed through Braintree with full capture --- .../functional/etc/repository_replacer.xml | 9 ++ .../Test/Fixture/BraintreeSandboxCustomer.xml | 19 ++++ .../Repository/BraintreeSandboxCustomer.xml | 17 ++++ .../CreateOnlineCreditMemoBraintreeTest.php | 40 ++++++++ .../CreateOnlineCreditMemoBraintreeTest.xml | 41 +++++++++ .../Test/TestStep/SettleTransactionStep.php | 92 +++++++++++++++++++ .../Magento/Braintree/Test/etc/testcase.xml | 18 ++++ 7 files changed, 236 insertions(+) create mode 100644 dev/tests/functional/tests/app/Magento/Braintree/Test/Fixture/BraintreeSandboxCustomer.xml create mode 100644 dev/tests/functional/tests/app/Magento/Braintree/Test/Repository/BraintreeSandboxCustomer.xml create mode 100644 dev/tests/functional/tests/app/Magento/Braintree/Test/TestCase/CreateOnlineCreditMemoBraintreeTest.php create mode 100644 dev/tests/functional/tests/app/Magento/Braintree/Test/TestCase/CreateOnlineCreditMemoBraintreeTest.xml create mode 100644 dev/tests/functional/tests/app/Magento/Braintree/Test/TestStep/SettleTransactionStep.php diff --git a/dev/tests/functional/etc/repository_replacer.xml b/dev/tests/functional/etc/repository_replacer.xml index 61046fbac44c4..12536a123a2ab 100644 --- a/dev/tests/functional/etc/repository_replacer.xml +++ b/dev/tests/functional/etc/repository_replacer.xml @@ -144,4 +144,13 @@ 1 + + + + sandbox + v6cfgg6s452yc2ys + s7gr9jbddsyfhgj7 + 996440dc0e9d611fc2db5f48f610b674 + + diff --git a/dev/tests/functional/tests/app/Magento/Braintree/Test/Fixture/BraintreeSandboxCustomer.xml b/dev/tests/functional/tests/app/Magento/Braintree/Test/Fixture/BraintreeSandboxCustomer.xml new file mode 100644 index 0000000000000..6628e4d741eb5 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Braintree/Test/Fixture/BraintreeSandboxCustomer.xml @@ -0,0 +1,19 @@ + + + + + + + + + + diff --git a/dev/tests/functional/tests/app/Magento/Braintree/Test/Repository/BraintreeSandboxCustomer.xml b/dev/tests/functional/tests/app/Magento/Braintree/Test/Repository/BraintreeSandboxCustomer.xml new file mode 100644 index 0000000000000..fa68a4adf6dc8 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Braintree/Test/Repository/BraintreeSandboxCustomer.xml @@ -0,0 +1,17 @@ + + + + + + BRAINTREEE_ENVIRONMENT + BRAINTREEE_MERCHANT_ID + BRAINTREE_PUBLIC_KEY + BRAINTREE_PRIVATE_KEY + + + diff --git a/dev/tests/functional/tests/app/Magento/Braintree/Test/TestCase/CreateOnlineCreditMemoBraintreeTest.php b/dev/tests/functional/tests/app/Magento/Braintree/Test/TestCase/CreateOnlineCreditMemoBraintreeTest.php new file mode 100644 index 0000000000000..de41d9e6ca1bd --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Braintree/Test/TestCase/CreateOnlineCreditMemoBraintreeTest.php @@ -0,0 +1,40 @@ +executeScenario(); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Braintree/Test/TestCase/CreateOnlineCreditMemoBraintreeTest.xml b/dev/tests/functional/tests/app/Magento/Braintree/Test/TestCase/CreateOnlineCreditMemoBraintreeTest.xml new file mode 100644 index 0000000000000..beba54e1abee8 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Braintree/Test/TestCase/CreateOnlineCreditMemoBraintreeTest.xml @@ -0,0 +1,41 @@ + + + + + + catalogProductSimple::product_10_dollar + configurableProduct::with_one_option + bundleProduct::bundle_fixed_100_dollar_product + default + braintree_sandbox_default + us_ca_ny_rule + US_address_1_without_email + guest + Flat Rate + Fixed + braintree + visa_default + braintree + braintree + Closed + + 145.98 + + + Refund + Yes + + - + test_type:3rd_party_test, severity:S1 + + + + + + + diff --git a/dev/tests/functional/tests/app/Magento/Braintree/Test/TestStep/SettleTransactionStep.php b/dev/tests/functional/tests/app/Magento/Braintree/Test/TestStep/SettleTransactionStep.php new file mode 100644 index 0000000000000..b6b659c3b0760 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Braintree/Test/TestStep/SettleTransactionStep.php @@ -0,0 +1,92 @@ +braintreeSandboxCustomer = $braintreeSandboxCustomer; + $this->salesOrder = $salesOrder; + $this->salesOrderView = $salesOrderView; + $this->orderId = $orderId; + } + + /** + * Settle transaction for Braintree Credit Card. + * + * @return void + */ + public function run() + { + $credentials = $this->braintreeSandboxCustomer->getData(); + $gateway = new Gateway($credentials); + $transactionId = $this->getTransactionId(); + $gateway->testing()->settle($transactionId); + } + + /** + * Get transaction id. + * + * @return string + */ + private function getTransactionId() + { + $this->salesOrder->open(); + $this->salesOrder->getSalesOrderGrid()->searchAndOpen(['id' => $this->orderId]); + $this->salesOrderView->getOrderForm()->openTab('transactions'); + $actualTransactions = $this->salesOrderView->getOrderForm()->getTab('transactions')->getGridBlock()->getIds(); + + return current(array_keys($actualTransactions)); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Braintree/Test/etc/testcase.xml b/dev/tests/functional/tests/app/Magento/Braintree/Test/etc/testcase.xml index 6ad46774f0f76..0f3aeae6e9a4a 100644 --- a/dev/tests/functional/tests/app/Magento/Braintree/Test/etc/testcase.xml +++ b/dev/tests/functional/tests/app/Magento/Braintree/Test/etc/testcase.xml @@ -188,4 +188,22 @@ + + + + + + + + + + + + + + + + + + From 9d1f863f3e99c31745c33299135f0822f274d3bd Mon Sep 17 00:00:00 2001 From: Vasyl Kozyrenko Date: Wed, 28 Dec 2016 18:31:48 +0200 Subject: [PATCH 09/32] MTA-3900: Create auto test to Refund an order placed through Braintree with full capture --- dev/tests/functional/etc/repository_replacer.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dev/tests/functional/etc/repository_replacer.xml b/dev/tests/functional/etc/repository_replacer.xml index 12536a123a2ab..793dffec4f35f 100644 --- a/dev/tests/functional/etc/repository_replacer.xml +++ b/dev/tests/functional/etc/repository_replacer.xml @@ -147,10 +147,10 @@ - sandbox - v6cfgg6s452yc2ys - s7gr9jbddsyfhgj7 - 996440dc0e9d611fc2db5f48f610b674 + BRAINTREEE_ENVIRONMENT + BRAINTREEE_MERCHANT_ID + BRAINTREE_PUBLIC_KEY + BRAINTREE_PRIVATE_KEY From c71c8757d6fe9c0ce3aedb6d8428af120a2e048d Mon Sep 17 00:00:00 2001 From: Vasyl Kozyrenko Date: Thu, 29 Dec 2016 11:49:36 +0200 Subject: [PATCH 10/32] MTA-3900: Create auto test to Refund an order placed through Braintree with full capture --- .../CreateOnlineCreditMemoBraintreeTest.xml | 18 +++++++++++------- .../Test/TestStep/SettleTransactionStep.php | 3 ++- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/dev/tests/functional/tests/app/Magento/Braintree/Test/TestCase/CreateOnlineCreditMemoBraintreeTest.xml b/dev/tests/functional/tests/app/Magento/Braintree/Test/TestCase/CreateOnlineCreditMemoBraintreeTest.xml index beba54e1abee8..8eeec7908c78d 100644 --- a/dev/tests/functional/tests/app/Magento/Braintree/Test/TestCase/CreateOnlineCreditMemoBraintreeTest.xml +++ b/dev/tests/functional/tests/app/Magento/Braintree/Test/TestCase/CreateOnlineCreditMemoBraintreeTest.xml @@ -8,16 +8,21 @@ - catalogProductSimple::product_10_dollar - configurableProduct::with_one_option - bundleProduct::bundle_fixed_100_dollar_product + test_type:3rd_party_test, severity:S1 + + catalogProductSimple::product_10_dollar + configurableProduct::with_one_option + bundleProduct::bundle_fixed_100_dollar_product + default braintree_sandbox_default us_ca_ny_rule US_address_1_without_email guest - Flat Rate - Fixed + + Flat Rate + Fixed + braintree visa_default braintree @@ -26,12 +31,11 @@ 145.98 - + Refund Yes - - test_type:3rd_party_test, severity:S1 diff --git a/dev/tests/functional/tests/app/Magento/Braintree/Test/TestStep/SettleTransactionStep.php b/dev/tests/functional/tests/app/Magento/Braintree/Test/TestStep/SettleTransactionStep.php index b6b659c3b0760..23fab32688a5a 100644 --- a/dev/tests/functional/tests/app/Magento/Braintree/Test/TestStep/SettleTransactionStep.php +++ b/dev/tests/functional/tests/app/Magento/Braintree/Test/TestStep/SettleTransactionStep.php @@ -8,6 +8,7 @@ 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 @@ public function __construct( 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); } From e52994d617708d0310216a6081c4f4d5e3c36881 Mon Sep 17 00:00:00 2001 From: Ostap Smolyar Date: Thu, 29 Dec 2016 19:53:21 +0200 Subject: [PATCH 11/32] MTA-3952: Refactoring comments history block in Order module --- .../Block/Adminhtml/Order/View/Tab/Info.php | 21 ++++ .../View/Tab/Info/CommentHistoryBlock.php | 119 ++++++++++++++++++ .../AssertAuthorizationInCommentsHistory.php | 10 +- 3 files changed, 148 insertions(+), 2 deletions(-) create mode 100644 dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/View/Tab/Info/CommentHistoryBlock.php diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/View/Tab/Info.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/View/Tab/Info.php index 146e3facccb61..5000bbed56f3d 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/View/Tab/Info.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/View/Tab/Info.php @@ -7,6 +7,7 @@ namespace Magento\Sales\Test\Block\Adminhtml\Order\View\Tab; use Magento\Backend\Test\Block\Widget\Tab; +use Magento\Sales\Test\Block\Adminhtml\Order\View\Tab\Info\CommentHistoryBlock; use Magento\Sales\Test\Block\Adminhtml\Order\View\Tab\Info\PaymentInfoBlock; /** @@ -28,6 +29,13 @@ class Info extends Tab */ private $paymentInfoBlockSelector = '.order-payment-method'; + /** + * Selector for Comment history block. + * + * @var string + */ + private $commentHistoryBlockSelector = '#order_history_block'; + /** * Get order status from info block. * @@ -50,4 +58,17 @@ public function getPaymentInfoBlock() ['element' => $this->_rootElement->find($this->paymentInfoBlockSelector)] ); } + + /** + * Returns Comment history block. + * + * @return CommentHistoryBlock + */ + public function getCommentHistoryBlock() + { + return $this->blockFactory->create( + CommentHistoryBlock::class, + ['element' => $this->_rootElement->find($this->commentHistoryBlockSelector)] + ); + } } diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/View/Tab/Info/CommentHistoryBlock.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/View/Tab/Info/CommentHistoryBlock.php new file mode 100644 index 0000000000000..c9223d75115ec --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/View/Tab/Info/CommentHistoryBlock.php @@ -0,0 +1,119 @@ +_rootElement->getElements($this->commentHistory); + foreach ($elements as $item) { + $result['date'] = $item->find($this->commentHistoryDate)->getText(); + $result['time'] = $item->find($this->commentHistoryTime)->getText(); + $result['status'] = $item->find($this->commentHistoryStatus)->getText(); + $result['is_customer_notified'] = $item->find($this->commentHistoryNotifiedStatus)->getText(); + $result['authorized_amount'] = $item->find($this->authorizedAmount)->getText(); + $result['captured_amount'] = $item->find($this->capturedAmount)->getText(); + $result['refunded_amount'] = $item->find($this->refundedAmount)->getText(); + $result['voided_amount'] = $item->find($this->voidedAmount)->getText(); + } + + return $result; + } + + /** + * Get last comment. + * + * @return array + */ + public function getLatestComment() + { + $comments = $this->getComments(); + return end($comments); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertAuthorizationInCommentsHistory.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertAuthorizationInCommentsHistory.php index 8b34837bc8df3..2b03f14d3f9c3 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertAuthorizationInCommentsHistory.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertAuthorizationInCommentsHistory.php @@ -37,11 +37,17 @@ public function processAssert( ) { $salesOrder->open(); $salesOrder->getSalesOrderGrid()->searchAndOpen(['id' => $orderId]); - $actualAuthorizedAmount = $salesOrderView->getOrderHistoryBlock()->getAuthorizedAmount(); + + /** @var \Magento\Sales\Test\Block\Adminhtml\Order\View\Tab\Info $infoTab */ + $infoTab = $salesOrderView->getOrderForm()->openTab('info')->getTab('info'); + $historyBlock = $infoTab->getCommentHistoryBlock(); + $lastComment = $historyBlock->getLatestComment(); + + //$actualAuthorizedAmount = $salesOrderView->getOrderHistoryBlock()->getAuthorizedAmount(); \PHPUnit_Framework_Assert::assertRegExp( sprintf(self::AUTHORIZED_AMOUNT_PATTERN, $prices['grandTotal']), - $actualAuthorizedAmount, + $lastComment['authorized_amount'], 'Incorrect authorized amount value for the order #' . $orderId ); } From 75e00f5a50a07fed9a76eb3445d9dfa5fc87c813 Mon Sep 17 00:00:00 2001 From: Vasyl Kozyrenko Date: Thu, 29 Dec 2016 21:04:25 +0200 Subject: [PATCH 12/32] MTA-3901: Add variation for Partial Refund an order placed through Braintree with Partial capture --- ...ateOnlineCreditMemoBraintreePaypalTest.xml | 12 ++-- .../CreateOnlineCreditMemoBraintreeTest.xml | 66 ++++++++++++++++++- .../Checkout/Test/Fixture/Cart/Items.php | 25 +++++-- .../Checkout/Test/TestStep/PlaceOrderStep.php | 23 +++++-- .../TestCase/CreateOnlineCreditMemoTest.xml | 6 +- .../Block/Adminhtml/Order/AbstractForm.php | 4 +- .../Adminhtml/Order/Creditmemo/Form/Items.php | 2 +- .../AssertRefundInCommentsHistory.php | 11 ++-- .../Sales/Test/Fixture/OrderInjectable.xml | 1 + .../TestStep/CreateOnlineCreditMemoStep.php | 27 +++++--- .../Sales/Test/TestStep/SubmitOrderStep.php | 30 ++++++--- 11 files changed, 159 insertions(+), 48 deletions(-) diff --git a/dev/tests/functional/tests/app/Magento/Braintree/Test/TestCase/CreateOnlineCreditMemoBraintreePaypalTest.xml b/dev/tests/functional/tests/app/Magento/Braintree/Test/TestCase/CreateOnlineCreditMemoBraintreePaypalTest.xml index 2f14871eda96e..de243f9f1b243 100644 --- a/dev/tests/functional/tests/app/Magento/Braintree/Test/TestCase/CreateOnlineCreditMemoBraintreePaypalTest.xml +++ b/dev/tests/functional/tests/app/Magento/Braintree/Test/TestCase/CreateOnlineCreditMemoBraintreePaypalTest.xml @@ -13,8 +13,10 @@ default login us_ca_ny_rule - - 139.90 + + + 139.90 + US_address_1_without_email Flat Rate @@ -33,8 +35,10 @@ default login us_ca_ny_rule - - 621.20 + + + 621.20 + US_address_1_without_email Flat Rate diff --git a/dev/tests/functional/tests/app/Magento/Braintree/Test/TestCase/CreateOnlineCreditMemoBraintreeTest.xml b/dev/tests/functional/tests/app/Magento/Braintree/Test/TestCase/CreateOnlineCreditMemoBraintreeTest.xml index 8eeec7908c78d..c8cf3920902f7 100644 --- a/dev/tests/functional/tests/app/Magento/Braintree/Test/TestCase/CreateOnlineCreditMemoBraintreeTest.xml +++ b/dev/tests/functional/tests/app/Magento/Braintree/Test/TestCase/CreateOnlineCreditMemoBraintreeTest.xml @@ -28,8 +28,10 @@ braintree braintree Closed - - 145.98 + + + 145.98 + Refund @@ -41,5 +43,65 @@ + + test_type:3rd_party_test, severity:S1 + + catalogProductSimple::product_10_dollar + configurableProduct::with_one_option + bundleProduct::bundle_fixed_100_dollar_product + + default + braintree_sandbox_default + us_ca_ny_rule + US_address_1_without_email + guest + + Flat Rate + Fixed + + braintree + visa_default + braintree + braintree + Processing + + + 0 + + + 0 + + + + + 0 + + + + + 1.08 + + + 134.07 + + + + Refund + Yes + + + Capture + Yes + + + + 0 + + + + + + + diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/Fixture/Cart/Items.php b/dev/tests/functional/tests/app/Magento/Checkout/Test/Fixture/Cart/Items.php index 6b270efcb011e..4a30bee726571 100644 --- a/dev/tests/functional/tests/app/Magento/Checkout/Test/Fixture/Cart/Items.php +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/Fixture/Cart/Items.php @@ -34,13 +34,6 @@ public function __construct(array $params, array $data = []) { $this->params = $params; $this->products = isset($data['products']) ? $data['products'] : []; - - foreach ($this->products as $product) { - $classItem = 'Magento\\' . $this->getModuleName($product) . '\Test\Fixture\Cart\Item'; - $item = ObjectManager::getInstance()->create($classItem, ['product' => $product]); - - $this->data[] = $item; - } } /** @@ -55,6 +48,24 @@ protected function getModuleName(FixtureInterface $product) return isset($match[1]) ? $match[1] : ''; } + /** + * Return prepared dataset. + * + * @param null|string $key + * @return array + */ + public function getData($key = null) + { + foreach ($this->products as $product) { + $classItem = 'Magento\\' . $this->getModuleName($product) . '\Test\Fixture\Cart\Item'; + $item = ObjectManager::getInstance()->create($classItem, ['product' => $product]); + $item->getData(); + $this->data[] = $item; + } + + return $this->data; + } + /** * Get source products. * diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestStep/PlaceOrderStep.php b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestStep/PlaceOrderStep.php index 8beada29036b8..e1eed665851e4 100644 --- a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestStep/PlaceOrderStep.php +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestStep/PlaceOrderStep.php @@ -11,6 +11,7 @@ use Magento\Checkout\Test\Page\CheckoutOnepageSuccess; use Magento\Mtf\Fixture\FixtureFactory; use Magento\Mtf\TestStep\TestStepInterface; +use Magento\Sales\Test\Fixture\OrderInjectable; /** * Place order in one page checkout. @@ -59,11 +60,19 @@ class PlaceOrderStep implements TestStepInterface */ private $products; + /** + * Fixture OrderInjectable. + * + * @var OrderInjectable + */ + private $order; + /** * @param CheckoutOnepage $checkoutOnepage * @param AssertGrandTotalOrderReview $assertGrandTotalOrderReview * @param CheckoutOnepageSuccess $checkoutOnepageSuccess * @param FixtureFactory $fixtureFactory + * @param OrderInjectable $order * @param array $products * @param array $prices */ @@ -72,6 +81,7 @@ public function __construct( AssertGrandTotalOrderReview $assertGrandTotalOrderReview, CheckoutOnepageSuccess $checkoutOnepageSuccess, FixtureFactory $fixtureFactory, + OrderInjectable $order = null, array $products = [], array $prices = [] ) { @@ -79,6 +89,7 @@ public function __construct( $this->assertGrandTotalOrderReview = $assertGrandTotalOrderReview; $this->checkoutOnepageSuccess = $checkoutOnepageSuccess; $this->fixtureFactory = $fixtureFactory; + $this->order = $order; $this->products = $products; $this->prices = $prices; } @@ -95,14 +106,14 @@ public function run() } $this->checkoutOnepage->getPaymentBlock()->getSelectedPaymentMethodBlock()->clickPlaceOrder(); $orderId = $this->checkoutOnepageSuccess->getSuccessBlock()->getGuestOrderId(); + $data = [ + 'id' => $orderId, + 'entity_id' => ['products' => $this->products] + ]; + $orderData = $this->order !== null ? $this->order->getData() : []; $order = $this->fixtureFactory->createByCode( 'orderInjectable', - [ - 'data' => [ - 'id' => $orderId, - 'entity_id' => ['products' => $this->products], - ] - ] + ['data' => array_merge($data, $orderData)] ); return [ diff --git a/dev/tests/functional/tests/app/Magento/Paypal/Test/TestCase/CreateOnlineCreditMemoTest.xml b/dev/tests/functional/tests/app/Magento/Paypal/Test/TestCase/CreateOnlineCreditMemoTest.xml index f859f579ecea4..10cf09870eec6 100644 --- a/dev/tests/functional/tests/app/Magento/Paypal/Test/TestCase/CreateOnlineCreditMemoTest.xml +++ b/dev/tests/functional/tests/app/Magento/Paypal/Test/TestCase/CreateOnlineCreditMemoTest.xml @@ -11,8 +11,10 @@ catalogProductSimple::product_10_dollar default guest - - 15.00 + + + 15.00 + US_address_1_without_email Flat Rate diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/AbstractForm.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/AbstractForm.php index a309aa871934f..4860b076b41d3 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/AbstractForm.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/AbstractForm.php @@ -68,8 +68,8 @@ public function fillProductData(array $data, $products = null) { $data = $this->prepareData($data); if (isset($data['items_data']) && $products !== null) { - foreach ($products as $key => $product) { - $this->getItemsBlock()->getItemProductBlock($product)->fillProduct($data['items_data'][$key]); + foreach ($data['items_data'] as $key => $item) { + $this->getItemsBlock()->getItemProductBlock($products[$key])->fillProduct($item); } } } diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Creditmemo/Form/Items.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Creditmemo/Form/Items.php index 52ff585cc43d6..977742315b572 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Creditmemo/Form/Items.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Creditmemo/Form/Items.php @@ -38,7 +38,7 @@ class Items extends Block */ public function getItemProductBlock(FixtureInterface $product) { - $selector = sprintf($this->productItems, $product->getSku()); + $selector = sprintf($this->productItems, $product->getData()['sku']); return $this->blockFactory->create( \Magento\Sales\Test\Block\Adminhtml\Order\Creditmemo\Form\Items\Product::class, ['element' => $this->_rootElement->find($selector, Locator::SELECTOR_XPATH)] diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertRefundInCommentsHistory.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertRefundInCommentsHistory.php index c0ce2a87fc1c3..e7c98aa0f7cb6 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertRefundInCommentsHistory.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertRefundInCommentsHistory.php @@ -6,6 +6,7 @@ namespace Magento\Sales\Test\Constraint; +use Magento\Sales\Test\Fixture\OrderInjectable; use Magento\Sales\Test\Page\Adminhtml\SalesOrderView; use Magento\Sales\Test\Page\Adminhtml\OrderIndex; use Magento\Mtf\Constraint\AbstractConstraint; @@ -23,25 +24,25 @@ class AssertRefundInCommentsHistory extends AbstractConstraint /** * Assert that comment about refunded amount exist in Comments History section on order page in Admin. * + * @param OrderInjectable $order * @param SalesOrderView $salesOrderView * @param OrderIndex $salesOrder * @param string $orderId - * @param array $refundedPrices * @return void */ public function processAssert( + OrderInjectable $order, SalesOrderView $salesOrderView, OrderIndex $salesOrder, - $orderId, - array $refundedPrices + $orderId ) { $salesOrder->open(); $salesOrder->getSalesOrderGrid()->searchAndOpen(['id' => $orderId]); - + $refundedPrices = $order->getPrice()['refund']; $actualRefundedAmount = $salesOrderView->getOrderHistoryBlock()->getRefundedAmount(); foreach ($refundedPrices as $key => $refundedPrice) { \PHPUnit_Framework_Assert::assertRegExp( - sprintf(self::REFUNDED_AMOUNT_PATTERN, $refundedPrice), + sprintf(self::REFUNDED_AMOUNT_PATTERN, $refundedPrice['grand_refund_total']), $actualRefundedAmount[$key], 'Incorrect refunded amount value for the order #' . $orderId ); diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Fixture/OrderInjectable.xml b/dev/tests/functional/tests/app/Magento/Sales/Test/Fixture/OrderInjectable.xml index 115ec14741aba..056fcc7f9e6de 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Fixture/OrderInjectable.xml +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Fixture/OrderInjectable.xml @@ -206,5 +206,6 @@ + diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/TestStep/CreateOnlineCreditMemoStep.php b/dev/tests/functional/tests/app/Magento/Sales/Test/TestStep/CreateOnlineCreditMemoStep.php index 84491c1992e5d..7a8aa189310a5 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/TestStep/CreateOnlineCreditMemoStep.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/TestStep/CreateOnlineCreditMemoStep.php @@ -6,6 +6,7 @@ namespace Magento\Sales\Test\TestStep; +use Magento\Checkout\Test\Fixture\Cart; use Magento\Mtf\TestStep\TestStepInterface; use Magento\Sales\Test\Fixture\OrderInjectable; use Magento\Sales\Test\Page\Adminhtml\OrderCreditMemoNew; @@ -59,9 +60,14 @@ class CreateOnlineCreditMemoStep implements TestStepInterface * @var OrderInvoiceView */ private $orderInvoiceView; + /** + * @var Cart + */ + private $cart; /** * @construct + * @param Cart $cart * @param OrderIndex $orderIndex * @param SalesOrderView $salesOrderView * @param OrderInjectable $order @@ -70,6 +76,7 @@ class CreateOnlineCreditMemoStep implements TestStepInterface * @param array|null refundData [optional] */ public function __construct( + Cart $cart, OrderIndex $orderIndex, SalesOrderView $salesOrderView, OrderInjectable $order, @@ -83,6 +90,7 @@ public function __construct( $this->orderCreditMemoNew = $orderCreditMemoNew; $this->refundData = $refundData; $this->orderInvoiceView = $orderInvoiceView; + $this->cart = $cart; } /** @@ -94,19 +102,20 @@ public function run() { $this->orderIndex->open(); $this->orderIndex->getSalesOrderGrid()->searchAndOpen(['id' => $this->order->getId()]); - /** @var \Magento\Sales\Test\Block\Adminhtml\Order\View\Tab\Invoices\Grid $invoicesGrid */ - $invoicesGrid = $this->salesOrderView->getOrderForm()->getTab('invoices')->getGridBlock(); - $this->salesOrderView->getOrderForm()->openTab('invoices'); - $invoicesGrid->viewInvoice(); - $this->salesOrderView->getPageActions()->orderInvoiceCreditMemo(); - if (!empty($this->refundData)) { + $refundsData = $this->order->getRefund(); + foreach ($refundsData as $refundData) { + /** @var \Magento\Sales\Test\Block\Adminhtml\Order\View\Tab\Invoices\Grid $invoicesGrid */ + $invoicesGrid = $this->salesOrderView->getOrderForm()->getTab('invoices')->getGridBlock(); + $this->salesOrderView->getOrderForm()->openTab('invoices'); + $invoicesGrid->viewInvoice(); + $this->salesOrderView->getPageActions()->orderInvoiceCreditMemo(); $this->orderCreditMemoNew->getFormBlock()->fillProductData( - $this->refundData, - $this->order->getEntityId()['products'] + $refundData, + $this->cart->getItems() ); $this->orderCreditMemoNew->getFormBlock()->updateQty(); + $this->orderCreditMemoNew->getFormBlock()->submit(); } - $this->orderCreditMemoNew->getFormBlock()->submit(); return ['ids' => ['creditMemoIds' => $this->getCreditMemoIds()]]; } diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/TestStep/SubmitOrderStep.php b/dev/tests/functional/tests/app/Magento/Sales/Test/TestStep/SubmitOrderStep.php index 0a82770fab38b..182d37c800f28 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/TestStep/SubmitOrderStep.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/TestStep/SubmitOrderStep.php @@ -8,6 +8,7 @@ use Magento\Customer\Test\Fixture\Address; use Magento\Customer\Test\Fixture\Customer; +use Magento\Sales\Test\Fixture\OrderInjectable; use Magento\Sales\Test\Page\Adminhtml\OrderCreateIndex; use Magento\Sales\Test\Page\Adminhtml\SalesOrderView; use Magento\Mtf\Fixture\FixtureFactory; @@ -61,13 +62,20 @@ class SubmitOrderStep implements TestStepInterface private $products; /** - * @constructor + * Fixture OrderInjectable. + * + * @var OrderInjectable + */ + private $order; + + /** * @param OrderCreateIndex $orderCreateIndex * @param SalesOrderView $salesOrderView * @param FixtureFactory $fixtureFactory * @param Customer $customer * @param Address $billingAddress * @param \Magento\Mtf\Fixture\FixtureInterface[] $products + * @param OrderInjectable $order */ public function __construct( OrderCreateIndex $orderCreateIndex, @@ -75,7 +83,8 @@ public function __construct( FixtureFactory $fixtureFactory, Customer $customer, Address $billingAddress, - array $products + array $products, + OrderInjectable $order = null ) { $this->orderCreateIndex = $orderCreateIndex; $this->salesOrderView = $salesOrderView; @@ -83,6 +92,7 @@ public function __construct( $this->customer = $customer; $this->billingAddress = $billingAddress; $this->products = $products; + $this->order = $order; } /** @@ -95,16 +105,16 @@ public function run() $this->orderCreateIndex->getCreateBlock()->submitOrder(); $this->salesOrderView->getMessagesBlock()->waitSuccessMessage(); $orderId = trim($this->salesOrderView->getTitleBlock()->getTitle(), '#'); + $data = [ + 'id' => $orderId, + 'customer_id' => ['customer' => $this->customer], + 'entity_id' => ['products' => $this->products], + 'billing_address_id' => ['billingAddress' => $this->billingAddress], + ]; + $orderData = $this->order !== null ? $this->order->getData() : []; $order = $this->fixtureFactory->createByCode( 'orderInjectable', - [ - 'data' => [ - 'id' => $orderId, - 'customer_id' => ['customer' => $this->customer], - 'entity_id' => ['products' => $this->products], - 'billing_address_id' => ['billingAddress' => $this->billingAddress], - ] - ] + ['data' => array_merge($data, $orderData)] ); return ['orderId' => $orderId, 'order' => $order]; From 66a4b145eb6b6d220687eb5a13abd7eac5e4faf6 Mon Sep 17 00:00:00 2001 From: Vasyl Kozyrenko Date: Thu, 29 Dec 2016 21:16:04 +0200 Subject: [PATCH 13/32] MTA-3901: Add variation for Partial Refund an order placed through Braintree with Partial capture --- .../tests/app/Magento/Sales/Test/TestStep/SubmitOrderStep.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/TestStep/SubmitOrderStep.php b/dev/tests/functional/tests/app/Magento/Sales/Test/TestStep/SubmitOrderStep.php index e7d67d5c5d9d6..ef35728207a4e 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/TestStep/SubmitOrderStep.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/TestStep/SubmitOrderStep.php @@ -74,7 +74,7 @@ class SubmitOrderStep implements TestStepInterface * @param FixtureFactory $fixtureFactory * @param Customer $customer * @param \Magento\Mtf\Fixture\FixtureInterface[] $products - * @param OrderInjectable $order + * @param OrderInjectable|null $order * @param Address|null $billingAddress */ public function __construct( @@ -90,9 +90,9 @@ public function __construct( $this->salesOrderView = $salesOrderView; $this->fixtureFactory = $fixtureFactory; $this->customer = $customer; - $this->billingAddress = $billingAddress; $this->products = $products; $this->order = $order; + $this->billingAddress = $billingAddress; } /** From 1e6babcce75bb8cc4cd97a4298f0fc3ea85df3dd Mon Sep 17 00:00:00 2001 From: Vasyl Kozyrenko Date: Fri, 30 Dec 2016 10:59:49 +0200 Subject: [PATCH 14/32] MTA-3901: Add variation for Partial Refund an order placed through Braintree with Partial capture --- .../functional/etc/repository_replacer.xml | 9 --------- .../etc/repository_replacer_payments.xml | 17 +++++++++++++++++ 2 files changed, 17 insertions(+), 9 deletions(-) create mode 100644 dev/tests/functional/etc/repository_replacer_payments.xml diff --git a/dev/tests/functional/etc/repository_replacer.xml b/dev/tests/functional/etc/repository_replacer.xml index 793dffec4f35f..61046fbac44c4 100644 --- a/dev/tests/functional/etc/repository_replacer.xml +++ b/dev/tests/functional/etc/repository_replacer.xml @@ -144,13 +144,4 @@ 1 - - - - BRAINTREEE_ENVIRONMENT - BRAINTREEE_MERCHANT_ID - BRAINTREE_PUBLIC_KEY - BRAINTREE_PRIVATE_KEY - - diff --git a/dev/tests/functional/etc/repository_replacer_payments.xml b/dev/tests/functional/etc/repository_replacer_payments.xml new file mode 100644 index 0000000000000..2045f3d02661b --- /dev/null +++ b/dev/tests/functional/etc/repository_replacer_payments.xml @@ -0,0 +1,17 @@ + + + + + + BRAINTREEE_ENVIRONMENT + BRAINTREEE_MERCHANT_ID + BRAINTREE_PUBLIC_KEY + BRAINTREE_PRIVATE_KEY + + + From 86b593a7cdfa3fed42521eca035b07b5e524c6aa Mon Sep 17 00:00:00 2001 From: Vasyl Kozyrenko Date: Fri, 30 Dec 2016 12:26:54 +0200 Subject: [PATCH 15/32] MTA-3901: Add variation for Partial Refund an order placed through Braintree with Partial capture --- .../Test/Block/Adminhtml/Order/AbstractForm.php | 3 ++- .../Adminhtml/Order/AbstractItemsNewBlock.php | 16 +++++++--------- .../Adminhtml/Order/Creditmemo/Form/Items.php | 7 +++---- .../Block/Adminhtml/Order/Invoice/Form/Items.php | 12 +++++------- .../Test/TestStep/CreateOnlineCreditMemoStep.php | 8 +++++--- .../Shipping/Test/Block/Adminhtml/Form/Items.php | 7 +++---- 6 files changed, 25 insertions(+), 28 deletions(-) diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/AbstractForm.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/AbstractForm.php index 4860b076b41d3..8d93b7c18a7ca 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/AbstractForm.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/AbstractForm.php @@ -69,7 +69,8 @@ public function fillProductData(array $data, $products = null) $data = $this->prepareData($data); if (isset($data['items_data']) && $products !== null) { foreach ($data['items_data'] as $key => $item) { - $this->getItemsBlock()->getItemProductBlock($products[$key])->fillProduct($item); + $productSku = $products[$key]->getData()['sku']; + $this->getItemsBlock()->getItemProductBlock($productSku)->fillProduct($item); } } } diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/AbstractItemsNewBlock.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/AbstractItemsNewBlock.php index 2ba8fe00f1e71..981101ee74927 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/AbstractItemsNewBlock.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/AbstractItemsNewBlock.php @@ -8,38 +8,36 @@ use Magento\Sales\Test\Block\Adminhtml\Order\AbstractForm\Product; use Magento\Mtf\Block\Block; -use Magento\Mtf\Fixture\FixtureInterface; /** - * Class AbstractItemsNewBlock - * Items block on Credit Memo, Invoice, Shipment new pages + * Items block on Credit Memo, Invoice, Shipment new pages. */ abstract class AbstractItemsNewBlock extends Block { /** - * Item product row selector + * Item product row selector. * * @var string */ protected $productItem = '//tr[contains(.,"%s")]'; /** - * 'Update Qty's' button css selector + * 'Update Qty's' button css selector. * * @var string */ protected $updateQty = '.update-button'; /** - * Get item product block + * Get item product block. * - * @param FixtureInterface $product + * @param string $productSku * @return Product */ - abstract public function getItemProductBlock(FixtureInterface $product); + abstract public function getItemProductBlock($productSku); /** - * Click update qty button + * Click update qty button. * * @return void */ diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Creditmemo/Form/Items.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Creditmemo/Form/Items.php index 977742315b572..a01805e85c74e 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Creditmemo/Form/Items.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Creditmemo/Form/Items.php @@ -9,7 +9,6 @@ use Magento\Sales\Test\Block\Adminhtml\Order\Creditmemo\Form\Items\Product; use Magento\Mtf\Block\Block; use Magento\Mtf\Client\Locator; -use Magento\Mtf\Fixture\FixtureInterface; /** * Credit Memo Items block on Credit Memo new page. @@ -33,12 +32,12 @@ class Items extends Block /** * Get item product block. * - * @param FixtureInterface $product + * @param string $productSku * @return Product */ - public function getItemProductBlock(FixtureInterface $product) + public function getItemProductBlock($productSku) { - $selector = sprintf($this->productItems, $product->getData()['sku']); + $selector = sprintf($this->productItems, $productSku); return $this->blockFactory->create( \Magento\Sales\Test\Block\Adminhtml\Order\Creditmemo\Form\Items\Product::class, ['element' => $this->_rootElement->find($selector, Locator::SELECTOR_XPATH)] diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Invoice/Form/Items.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Invoice/Form/Items.php index baee80abd72df..bb41662eadd83 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Invoice/Form/Items.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Invoice/Form/Items.php @@ -9,23 +9,21 @@ use Magento\Sales\Test\Block\Adminhtml\Order\AbstractItemsNewBlock; use Magento\Sales\Test\Block\Adminhtml\Order\Invoice\Form\Items\Product; use Magento\Mtf\Client\Locator; -use Magento\Mtf\Fixture\FixtureInterface; /** - * Class Items - * Block for items to invoice on new invoice page + * Block for items to invoice on new invoice page. */ class Items extends AbstractItemsNewBlock { /** - * Get item product block + * Get item product block. * - * @param FixtureInterface $product + * @param string $productSku * @return Product */ - public function getItemProductBlock(FixtureInterface $product) + public function getItemProductBlock($productSku) { - $selector = sprintf($this->productItem, $product->getSku()); + $selector = sprintf($this->productItem, $productSku); return $this->blockFactory->create( \Magento\Sales\Test\Block\Adminhtml\Order\Invoice\Form\Items\Product::class, ['element' => $this->_rootElement->find($selector, Locator::SELECTOR_XPATH)] diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/TestStep/CreateOnlineCreditMemoStep.php b/dev/tests/functional/tests/app/Magento/Sales/Test/TestStep/CreateOnlineCreditMemoStep.php index 7a8aa189310a5..39c1caf03caa4 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/TestStep/CreateOnlineCreditMemoStep.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/TestStep/CreateOnlineCreditMemoStep.php @@ -60,13 +60,15 @@ class CreateOnlineCreditMemoStep implements TestStepInterface * @var OrderInvoiceView */ private $orderInvoiceView; + /** + * Checkout Cart fixture. + * * @var Cart */ private $cart; /** - * @construct * @param Cart $cart * @param OrderIndex $orderIndex * @param SalesOrderView $salesOrderView @@ -84,13 +86,13 @@ public function __construct( OrderCreditMemoNew $orderCreditMemoNew, $refundData = null ) { + $this->cart = $cart; $this->orderIndex = $orderIndex; $this->salesOrderView = $salesOrderView; $this->order = $order; + $this->orderInvoiceView = $orderInvoiceView; $this->orderCreditMemoNew = $orderCreditMemoNew; $this->refundData = $refundData; - $this->orderInvoiceView = $orderInvoiceView; - $this->cart = $cart; } /** diff --git a/dev/tests/functional/tests/app/Magento/Shipping/Test/Block/Adminhtml/Form/Items.php b/dev/tests/functional/tests/app/Magento/Shipping/Test/Block/Adminhtml/Form/Items.php index 132c56c7d9c3e..9ff65b75ffcce 100644 --- a/dev/tests/functional/tests/app/Magento/Shipping/Test/Block/Adminhtml/Form/Items.php +++ b/dev/tests/functional/tests/app/Magento/Shipping/Test/Block/Adminhtml/Form/Items.php @@ -9,7 +9,6 @@ use Magento\Sales\Test\Block\Adminhtml\Order\AbstractItemsNewBlock; use Magento\Shipping\Test\Block\Adminhtml\Form\Items\Product; use Magento\Mtf\Client\Locator; -use Magento\Mtf\Fixture\FixtureInterface; /** * Adminhtml items to ship block. @@ -19,12 +18,12 @@ class Items extends AbstractItemsNewBlock /** * Get item product block. * - * @param FixtureInterface $product + * @param string $productSku * @return Product */ - public function getItemProductBlock(FixtureInterface $product) + public function getItemProductBlock($productSku) { - $selector = sprintf($this->productItem, $product->getSku()); + $selector = sprintf($this->productItem, $productSku); return $this->blockFactory->create( \Magento\Shipping\Test\Block\Adminhtml\Form\Items\Product::class, ['element' => $this->_rootElement->find($selector, Locator::SELECTOR_XPATH)] From d0bc9d91d9596dd5c431244b7e1c289e6603e989 Mon Sep 17 00:00:00 2001 From: Ostap Smolyar Date: Fri, 30 Dec 2016 13:36:11 +0200 Subject: [PATCH 16/32] MTA-3952: Refactoring comments history block in Order module --- ...TransactionIsPresentInSettlementReport.php | 6 +- .../Test/Block/Adminhtml/Order/History.php | 175 ------------------ .../View/Tab/Info/CommentHistoryBlock.php | 43 +---- ...tAcceptPaymentMessageInCommentsHistory.php | 12 +- .../AssertAuthorizationInCommentsHistory.php | 7 +- .../AssertCaptureInCommentsHistory.php | 7 +- ...ertDenyPaymentMessageInCommentsHistory.php | 12 +- ...AssertOrderCommentsHistoryNotifyStatus.php | 7 +- .../AssertRefundInCommentsHistory.php | 7 +- ...sertRefundOrderStatusInCommentsHistory.php | 4 +- .../AssertVoidInCommentsHistory.php | 6 +- 11 files changed, 52 insertions(+), 234 deletions(-) delete mode 100644 dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/History.php diff --git a/dev/tests/functional/tests/app/Magento/Braintree/Test/Constraint/AssertTransactionIsPresentInSettlementReport.php b/dev/tests/functional/tests/app/Magento/Braintree/Test/Constraint/AssertTransactionIsPresentInSettlementReport.php index 96f84e4d3ef0f..be67cd524cf9b 100644 --- a/dev/tests/functional/tests/app/Magento/Braintree/Test/Constraint/AssertTransactionIsPresentInSettlementReport.php +++ b/dev/tests/functional/tests/app/Magento/Braintree/Test/Constraint/AssertTransactionIsPresentInSettlementReport.php @@ -71,10 +71,12 @@ public function toString() */ private function getTransactionId() { - $comments = $this->salesOrderView->getOrderHistoryBlock()->getCommentsHistory(); + /** @var \Magento\Sales\Test\Block\Adminhtml\Order\View\Tab\Info $infoTab */ + $infoTab = $this->salesOrderView->getOrderForm()->openTab('info')->getTab('info'); + $latestComment = $infoTab->getCommentHistoryBlock()->getLatestComment(); $transactionId = null; - preg_match('/(\w+-*\w+)"/', $comments, $matches); + preg_match('/(\w+-*\w+)"/', $latestComment['comment'], $matches); if (!empty($matches[1])) { $transactionId = $matches[1]; } diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/History.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/History.php deleted file mode 100644 index 8ae8bbb31584e..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/History.php +++ /dev/null @@ -1,175 +0,0 @@ -waitCommentsHistory(); - return $this->_rootElement->find($this->commentHistory, Locator::SELECTOR_CSS)->getText(); - } - - /** - * Get the authorized amount from the comments history. - * - * @return string - */ - public function getAuthorizedAmount() - { - $this->waitCommentsHistory(); - return $this->_rootElement->find($this->authorizedAmount, Locator::SELECTOR_XPATH)->getText(); - } - - /** - * Get the captured amount from the comments history. - * - * @return array - */ - public function getCapturedAmount() - { - $result = []; - $this->waitCommentsHistory(); - $captureComments = $this->_rootElement->getElements($this->capturedAmount, Locator::SELECTOR_XPATH); - foreach ($captureComments as $captureComment) { - $result[] = $captureComment->getText(); - } - return $result; - } - - /** - * Get the refunded amount from the comments history. - * - * @return array - */ - public function getRefundedAmount() - { - $result = []; - $this->waitCommentsHistory(); - $refundedComments = $this->_rootElement->getElements($this->refundedAmount, Locator::SELECTOR_XPATH); - foreach ($refundedComments as $refundedComment) { - $result[] = $refundedComment->getText(); - } - return $result; - } - - /** - * Get the voided amount from the comments history. - * - * @return string - */ - public function getVoidedAmount() - { - $this->waitCommentsHistory(); - return $this->_rootElement->find($this->voidedAmount, Locator::SELECTOR_XPATH)->getText(); - } - - /** - * Gets the status which presented in comment - * - * @return string - */ - public function getStatus() - { - $this->waitCommentsHistory(); - return $this->_rootElement->find($this->commentHistoryStatus, Locator::SELECTOR_CSS)->getText(); - } - - /** - * Gets the is customer notified status which presented in comment - * - * @return string - */ - public function getNotifiedStatus() - { - $this->waitCommentsHistory(); - return $this->_rootElement->find($this->commentHistoryNotifiedStatus, Locator::SELECTOR_CSS)->getText(); - } - - /** - * Wait for comments history is visible. - * - * @return void - */ - protected function waitCommentsHistory() - { - $element = $this->_rootElement; - $selector = $this->noteList; - $element->waitUntil( - function () use ($element, $selector) { - return $element->find($selector)->isVisible() ? true : null; - } - ); - } -} diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/View/Tab/Info/CommentHistoryBlock.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/View/Tab/Info/CommentHistoryBlock.php index c9223d75115ec..b86f923f612de 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/View/Tab/Info/CommentHistoryBlock.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/View/Tab/Info/CommentHistoryBlock.php @@ -55,34 +55,6 @@ class CommentHistoryBlock extends Block */ protected $comment = '.note-list-comment'; - /** - * Authorized Amount. - * - * @var string - */ - protected $authorizedAmount = '//div[@class="note-list-comment"][contains(text(), "Authorized amount of")]'; - - /** - * Captured Amount from IPN. - * - * @var string - */ - protected $capturedAmount = '//div[@class="note-list-comment"][contains(text(), "Captured amount of")]'; - - /** - * Refunded Amount. - * - * @var string - */ - protected $refundedAmount = '//div[@class="note-list-comment"][contains(text(), "We refunded")]'; - - /** - * Voided Amount. - * - * @var string - */ - protected $voidedAmount = '//div[@class="note-list-comment"][contains(text(), "Voided authorization")]'; - /** * Get comment history block data. * @@ -92,15 +64,12 @@ public function getComments() { $result = []; $elements = $this->_rootElement->getElements($this->commentHistory); - foreach ($elements as $item) { - $result['date'] = $item->find($this->commentHistoryDate)->getText(); - $result['time'] = $item->find($this->commentHistoryTime)->getText(); - $result['status'] = $item->find($this->commentHistoryStatus)->getText(); - $result['is_customer_notified'] = $item->find($this->commentHistoryNotifiedStatus)->getText(); - $result['authorized_amount'] = $item->find($this->authorizedAmount)->getText(); - $result['captured_amount'] = $item->find($this->capturedAmount)->getText(); - $result['refunded_amount'] = $item->find($this->refundedAmount)->getText(); - $result['voided_amount'] = $item->find($this->voidedAmount)->getText(); + foreach ($elements as $key => $item) { + $result[$key]['date'] = $item->find($this->commentHistoryDate)->getText(); + $result[$key]['time'] = $item->find($this->commentHistoryTime)->getText(); + $result[$key]['status'] = $item->find($this->commentHistoryStatus)->getText(); + $result[$key]['is_customer_notified'] = $item->find($this->commentHistoryNotifiedStatus)->getText(); + $result[$key]['comment'] = $item->find($this->comment)->getText(); } return $result; diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertAcceptPaymentMessageInCommentsHistory.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertAcceptPaymentMessageInCommentsHistory.php index 1871a12ee2ce4..d6958ff5698ae 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertAcceptPaymentMessageInCommentsHistory.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertAcceptPaymentMessageInCommentsHistory.php @@ -23,17 +23,21 @@ class AssertAcceptPaymentMessageInCommentsHistory extends AbstractConstraint private static $message = 'Approved the payment online.'; /** - * @param SalesOrderView $orderView + * @param SalesOrderView $salesOrderView * @param OrderIndex $orderIndex * @param $orderId + * @internal param SalesOrderView $orderView */ - public function processAssert(SalesOrderView $orderView, OrderIndex $orderIndex, $orderId) + public function processAssert(SalesOrderView $salesOrderView, OrderIndex $orderIndex, $orderId) { $orderIndex->open(); $orderIndex->getSalesOrderGrid()->searchAndOpen(['id' => $orderId]); - $history = $orderView->getOrderHistoryBlock()->getCommentsHistory(); - \PHPUnit_Framework_Assert::assertContains(self::$message, $history); + /** @var \Magento\Sales\Test\Block\Adminhtml\Order\View\Tab\Info $infoTab */ + $infoTab = $salesOrderView->getOrderForm()->openTab('info')->getTab('info'); + $latestComment = $infoTab->getCommentHistoryBlock()->getLatestComment(); + + \PHPUnit_Framework_Assert::assertContains(self::$message, $latestComment['comment']); } /** diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertAuthorizationInCommentsHistory.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertAuthorizationInCommentsHistory.php index 2b03f14d3f9c3..60e00991404ce 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertAuthorizationInCommentsHistory.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertAuthorizationInCommentsHistory.php @@ -40,14 +40,11 @@ public function processAssert( /** @var \Magento\Sales\Test\Block\Adminhtml\Order\View\Tab\Info $infoTab */ $infoTab = $salesOrderView->getOrderForm()->openTab('info')->getTab('info'); - $historyBlock = $infoTab->getCommentHistoryBlock(); - $lastComment = $historyBlock->getLatestComment(); - - //$actualAuthorizedAmount = $salesOrderView->getOrderHistoryBlock()->getAuthorizedAmount(); + $latestComment = $infoTab->getCommentHistoryBlock()->getLatestComment(); \PHPUnit_Framework_Assert::assertRegExp( sprintf(self::AUTHORIZED_AMOUNT_PATTERN, $prices['grandTotal']), - $lastComment['authorized_amount'], + $latestComment['comment'], 'Incorrect authorized amount value for the order #' . $orderId ); } diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertCaptureInCommentsHistory.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertCaptureInCommentsHistory.php index 90e0e7b091a11..ffcea34ef03b2 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertCaptureInCommentsHistory.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertCaptureInCommentsHistory.php @@ -39,11 +39,14 @@ public function processAssert( $salesOrder->open(); $salesOrder->getSalesOrderGrid()->searchAndOpen(['id' => $orderId]); - $actualCapturedAmount = $salesOrderView->getOrderHistoryBlock()->getCapturedAmount(); + /** @var \Magento\Sales\Test\Block\Adminhtml\Order\View\Tab\Info $infoTab */ + $infoTab = $salesOrderView->getOrderForm()->openTab('info')->getTab('info'); + $comments = $infoTab->getCommentHistoryBlock()->getComments(); + foreach ($capturedPrices as $key => $capturedPrice) { \PHPUnit_Framework_Assert::assertRegExp( sprintf(self::CAPTURED_AMOUNT_PATTERN, $capturedPrice), - $actualCapturedAmount[$key], + $comments[$key]['comment'], 'Incorrect captured amount value for the order #' . $orderId ); } diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertDenyPaymentMessageInCommentsHistory.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertDenyPaymentMessageInCommentsHistory.php index 87cac1c38232b..ed2a469d97044 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertDenyPaymentMessageInCommentsHistory.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertDenyPaymentMessageInCommentsHistory.php @@ -22,17 +22,21 @@ class AssertDenyPaymentMessageInCommentsHistory extends AbstractConstraint private static $message = 'Denied the payment online'; /** - * @param SalesOrderView $orderView + * @param SalesOrderView $salesOrderView * @param OrderIndex $orderIndex * @param $orderId + * @internal param SalesOrderView $orderView */ - public function processAssert(SalesOrderView $orderView, OrderIndex $orderIndex, $orderId) + public function processAssert(SalesOrderView $salesOrderView, OrderIndex $orderIndex, $orderId) { $orderIndex->open(); $orderIndex->getSalesOrderGrid()->searchAndOpen(['id' => $orderId]); - $history = $orderView->getOrderHistoryBlock()->getCommentsHistory(); - \PHPUnit_Framework_Assert::assertContains(self::$message, $history); + /** @var \Magento\Sales\Test\Block\Adminhtml\Order\View\Tab\Info $infoTab */ + $infoTab = $salesOrderView->getOrderForm()->openTab('info')->getTab('info'); + $latestComment = $infoTab->getCommentHistoryBlock()->getLatestComment(); + + \PHPUnit_Framework_Assert::assertContains(self::$message, $latestComment['comment']); } /** diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderCommentsHistoryNotifyStatus.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderCommentsHistoryNotifyStatus.php index 013c3562b7090..e8a4797fb1b11 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderCommentsHistoryNotifyStatus.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderCommentsHistoryNotifyStatus.php @@ -35,8 +35,13 @@ public function processAssert( $data['form_data']['send_email'], FILTER_VALIDATE_BOOLEAN ) : false; + + /** @var \Magento\Sales\Test\Block\Adminhtml\Order\View\Tab\Info $infoTab */ + $infoTab = $salesOrderView->getOrderForm()->openTab('info')->getTab('info'); + $latestComment = $infoTab->getCommentHistoryBlock()->getLatestComment(); + \PHPUnit_Framework_Assert::assertContains( - $salesOrderView->getOrderHistoryBlock()->getNotifiedStatus(), + $latestComment['is_customer_notified'], (bool)$sendMail ? 'Customer Notified' : 'Customer Not Notified' ); } diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertRefundInCommentsHistory.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertRefundInCommentsHistory.php index c0ce2a87fc1c3..ce242eab12a01 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertRefundInCommentsHistory.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertRefundInCommentsHistory.php @@ -38,11 +38,14 @@ public function processAssert( $salesOrder->open(); $salesOrder->getSalesOrderGrid()->searchAndOpen(['id' => $orderId]); - $actualRefundedAmount = $salesOrderView->getOrderHistoryBlock()->getRefundedAmount(); + /** @var \Magento\Sales\Test\Block\Adminhtml\Order\View\Tab\Info $infoTab */ + $infoTab = $salesOrderView->getOrderForm()->openTab('info')->getTab('info'); + $comments = $infoTab->getCommentHistoryBlock()->getComments(); + foreach ($refundedPrices as $key => $refundedPrice) { \PHPUnit_Framework_Assert::assertRegExp( sprintf(self::REFUNDED_AMOUNT_PATTERN, $refundedPrice), - $actualRefundedAmount[$key], + $comments[$key]['comment'], 'Incorrect refunded amount value for the order #' . $orderId ); } diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertRefundOrderStatusInCommentsHistory.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertRefundOrderStatusInCommentsHistory.php index 557e29a0b9830..bfdfec027f745 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertRefundOrderStatusInCommentsHistory.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertRefundOrderStatusInCommentsHistory.php @@ -33,9 +33,11 @@ public function processAssert( /** @var \Magento\Sales\Test\Block\Adminhtml\Order\View\Tab\Info $infoTab */ $infoTab = $salesOrderView->getOrderForm()->openTab('info')->getTab('info'); + $latestComment = $infoTab->getCommentHistoryBlock()->getLatestComment(); + \PHPUnit_Framework_Assert::assertContains( $infoTab->getOrderStatus(), - $salesOrderView->getOrderHistoryBlock()->getStatus() + $latestComment['status'] ); } diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertVoidInCommentsHistory.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertVoidInCommentsHistory.php index bc3e90ee7f776..c1e4db8ca0021 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertVoidInCommentsHistory.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertVoidInCommentsHistory.php @@ -38,9 +38,13 @@ public function processAssert( $salesOrder->open(); $salesOrder->getSalesOrderGrid()->searchAndOpen(['id' => $orderId]); + /** @var \Magento\Sales\Test\Block\Adminhtml\Order\View\Tab\Info $infoTab */ + $infoTab = $salesOrderView->getOrderForm()->openTab('info')->getTab('info'); + $latestComment = $infoTab->getCommentHistoryBlock()->getLatestComment(); + \PHPUnit_Framework_Assert::assertContains( self::VOIDED_AMOUNT . $prices['grandTotal'], - $salesOrderView->getOrderHistoryBlock()->getVoidedAmount(), + $latestComment['comment'], 'Incorrect voided amount value for the order #' . $orderId ); } From 53feff848e0e1ab2e8917de4decc221c34539e95 Mon Sep 17 00:00:00 2001 From: Ostap Smolyar Date: Fri, 30 Dec 2016 15:09:06 +0200 Subject: [PATCH 17/32] MTA-3952: Refactoring comments history block in Order module --- ...ertTransactionIsPresentInSettlementReport.php | 11 ++++++++--- .../Test/TestCase/InvoicePaypalBraintreeTest.xml | 12 ++++++------ .../Test/Block/Adminhtml/Order/View/Tab/Info.php | 16 ++++++++-------- ...HistoryBlock.php => CommentsHistoryBlock.php} | 4 ++-- ...sertAcceptPaymentMessageInCommentsHistory.php | 16 ++++++++++------ .../AssertAuthorizationInCommentsHistory.php | 2 +- .../AssertCaptureInCommentsHistory.php | 8 +++++++- ...AssertDenyPaymentMessageInCommentsHistory.php | 14 ++++++++++---- .../AssertOrderCommentsHistoryNotifyStatus.php | 6 +++--- .../Constraint/AssertRefundInCommentsHistory.php | 8 +++++++- .../AssertRefundOrderStatusInCommentsHistory.php | 6 +++--- .../Constraint/AssertVoidInCommentsHistory.php | 2 +- 12 files changed, 66 insertions(+), 39 deletions(-) rename dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/View/Tab/Info/{CommentHistoryBlock.php => CommentsHistoryBlock.php} (95%) diff --git a/dev/tests/functional/tests/app/Magento/Braintree/Test/Constraint/AssertTransactionIsPresentInSettlementReport.php b/dev/tests/functional/tests/app/Magento/Braintree/Test/Constraint/AssertTransactionIsPresentInSettlementReport.php index be67cd524cf9b..1a8f35587e5f3 100644 --- a/dev/tests/functional/tests/app/Magento/Braintree/Test/Constraint/AssertTransactionIsPresentInSettlementReport.php +++ b/dev/tests/functional/tests/app/Magento/Braintree/Test/Constraint/AssertTransactionIsPresentInSettlementReport.php @@ -11,7 +11,7 @@ use Magento\Sales\Test\Page\Adminhtml\SalesOrderView; /** - * Class AssertTransactionIsPresentInSettlementReport + * Assert that comment with transaction id exists in Comments History section on order page in Admin. */ class AssertTransactionIsPresentInSettlementReport extends AbstractConstraint { @@ -26,6 +26,8 @@ class AssertTransactionIsPresentInSettlementReport extends AbstractConstraint private $settlementReportIndex; /** + * Assert that comment with transaction id exists in Comments History section on order page in Admin. + * * @param $orderId * @param OrderIndex $orderIndex * @param SalesOrderView $salesOrderView @@ -58,7 +60,9 @@ public function processAssert( } /** - * @inheritdoc + * Returns a string representation of the object. + * + * @return string */ public function toString() { @@ -67,13 +71,14 @@ public function toString() /** * Get transaction id from order comments + * * @return mixed */ private function getTransactionId() { /** @var \Magento\Sales\Test\Block\Adminhtml\Order\View\Tab\Info $infoTab */ $infoTab = $this->salesOrderView->getOrderForm()->openTab('info')->getTab('info'); - $latestComment = $infoTab->getCommentHistoryBlock()->getLatestComment(); + $latestComment = $infoTab->getCommentsHistoryBlock()->getLatestComment(); $transactionId = null; preg_match('/(\w+-*\w+)"/', $latestComment['comment'], $matches); diff --git a/dev/tests/functional/tests/app/Magento/Braintree/Test/TestCase/InvoicePaypalBraintreeTest.xml b/dev/tests/functional/tests/app/Magento/Braintree/Test/TestCase/InvoicePaypalBraintreeTest.xml index 1d98e2d792a3e..46bd1eff5c05e 100644 --- a/dev/tests/functional/tests/app/Magento/Braintree/Test/TestCase/InvoicePaypalBraintreeTest.xml +++ b/dev/tests/functional/tests/app/Magento/Braintree/Test/TestCase/InvoicePaypalBraintreeTest.xml @@ -7,7 +7,7 @@ --> - + Partial capture for order placed within Braintree PayPal catalogProductSimple::product_100_dollar @@ -56,12 +56,12 @@ No test_type:3rd_party_test, severity:S0 - - + - + diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/View/Tab/Info.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/View/Tab/Info.php index 5000bbed56f3d..414d6fdbc1b06 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/View/Tab/Info.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/View/Tab/Info.php @@ -7,7 +7,7 @@ namespace Magento\Sales\Test\Block\Adminhtml\Order\View\Tab; use Magento\Backend\Test\Block\Widget\Tab; -use Magento\Sales\Test\Block\Adminhtml\Order\View\Tab\Info\CommentHistoryBlock; +use Magento\Sales\Test\Block\Adminhtml\Order\View\Tab\Info\CommentsHistoryBlock; use Magento\Sales\Test\Block\Adminhtml\Order\View\Tab\Info\PaymentInfoBlock; /** @@ -30,11 +30,11 @@ class Info extends Tab private $paymentInfoBlockSelector = '.order-payment-method'; /** - * Selector for Comment history block. + * Selector for Comments history block. * * @var string */ - private $commentHistoryBlockSelector = '#order_history_block'; + private $commentsHistoryBlockSelector = '#order_history_block'; /** * Get order status from info block. @@ -60,15 +60,15 @@ public function getPaymentInfoBlock() } /** - * Returns Comment history block. + * Returns Comments history block. * - * @return CommentHistoryBlock + * @return CommentsHistoryBlock */ - public function getCommentHistoryBlock() + public function getCommentsHistoryBlock() { return $this->blockFactory->create( - CommentHistoryBlock::class, - ['element' => $this->_rootElement->find($this->commentHistoryBlockSelector)] + CommentsHistoryBlock::class, + ['element' => $this->_rootElement->find($this->commentsHistoryBlockSelector)] ); } } diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/View/Tab/Info/CommentHistoryBlock.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/View/Tab/Info/CommentsHistoryBlock.php similarity index 95% rename from dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/View/Tab/Info/CommentHistoryBlock.php rename to dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/View/Tab/Info/CommentsHistoryBlock.php index b86f923f612de..2ddde20539479 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/View/Tab/Info/CommentHistoryBlock.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/View/Tab/Info/CommentsHistoryBlock.php @@ -11,14 +11,14 @@ /** * Order comments history block. */ -class CommentHistoryBlock extends Block +class CommentsHistoryBlock extends Block { /** * Comment history list locator. * * @var string */ - protected $commentHistory = '.note-list'; + protected $commentHistory = '.note-list-item'; /** * Comment date. diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertAcceptPaymentMessageInCommentsHistory.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertAcceptPaymentMessageInCommentsHistory.php index d6958ff5698ae..0b041c8c11952 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertAcceptPaymentMessageInCommentsHistory.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertAcceptPaymentMessageInCommentsHistory.php @@ -10,23 +10,25 @@ use Magento\Sales\Test\Page\Adminhtml\SalesOrderView; /** - * Class AssertAcceptPaymentMessageInCommentsHistory + * Assert that accept payment message exist in Comments History section on order page in Admin. * - * Constraint checks accept payment message in order comments history */ class AssertAcceptPaymentMessageInCommentsHistory extends AbstractConstraint { - /** + * Accept payment message. + * * @var string */ private static $message = 'Approved the payment online.'; /** + * Assert that accept payment message exist in Comments History section on order page in Admin. + * * @param SalesOrderView $salesOrderView * @param OrderIndex $orderIndex * @param $orderId - * @internal param SalesOrderView $orderView + * @return void */ public function processAssert(SalesOrderView $salesOrderView, OrderIndex $orderIndex, $orderId) { @@ -35,13 +37,15 @@ public function processAssert(SalesOrderView $salesOrderView, OrderIndex $orderI /** @var \Magento\Sales\Test\Block\Adminhtml\Order\View\Tab\Info $infoTab */ $infoTab = $salesOrderView->getOrderForm()->openTab('info')->getTab('info'); - $latestComment = $infoTab->getCommentHistoryBlock()->getLatestComment(); + $latestComment = $infoTab->getCommentsHistoryBlock()->getLatestComment(); \PHPUnit_Framework_Assert::assertContains(self::$message, $latestComment['comment']); } /** - * @inheritdoc + * Returns a string representation of the object. + * + * @return string */ public function toString() { diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertAuthorizationInCommentsHistory.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertAuthorizationInCommentsHistory.php index 60e00991404ce..13ceba996e989 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertAuthorizationInCommentsHistory.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertAuthorizationInCommentsHistory.php @@ -40,7 +40,7 @@ public function processAssert( /** @var \Magento\Sales\Test\Block\Adminhtml\Order\View\Tab\Info $infoTab */ $infoTab = $salesOrderView->getOrderForm()->openTab('info')->getTab('info'); - $latestComment = $infoTab->getCommentHistoryBlock()->getLatestComment(); + $latestComment = $infoTab->getCommentsHistoryBlock()->getLatestComment(); \PHPUnit_Framework_Assert::assertRegExp( sprintf(self::AUTHORIZED_AMOUNT_PATTERN, $prices['grandTotal']), diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertCaptureInCommentsHistory.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertCaptureInCommentsHistory.php index ffcea34ef03b2..5ca9c6ef9bc56 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertCaptureInCommentsHistory.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertCaptureInCommentsHistory.php @@ -41,7 +41,13 @@ public function processAssert( /** @var \Magento\Sales\Test\Block\Adminhtml\Order\View\Tab\Info $infoTab */ $infoTab = $salesOrderView->getOrderForm()->openTab('info')->getTab('info'); - $comments = $infoTab->getCommentHistoryBlock()->getComments(); + $comments = $infoTab->getCommentsHistoryBlock()->getComments(); + + foreach ($comments as $key => $comment) { + if (stristr($comment['comment'], 'captured') === false) { + unset($comments[$key]); + } + } foreach ($capturedPrices as $key => $capturedPrice) { \PHPUnit_Framework_Assert::assertRegExp( diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertDenyPaymentMessageInCommentsHistory.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertDenyPaymentMessageInCommentsHistory.php index ed2a469d97044..8e95790dd857a 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertDenyPaymentMessageInCommentsHistory.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertDenyPaymentMessageInCommentsHistory.php @@ -10,22 +10,26 @@ use Magento\Sales\Test\Page\Adminhtml\SalesOrderView; /** - * Class AssertDenyPaymentMessageInCommentsHistory + * Assert that deny payment message exist in Comments History section on order page in Admin. * * Constraint checks deny payment message in order comments history */ class AssertDenyPaymentMessageInCommentsHistory extends AbstractConstraint { /** + * Deny payment message. + * * @var string */ private static $message = 'Denied the payment online'; /** + * Assert that deny payment message exist in Comments History section on order page in Admin. + * * @param SalesOrderView $salesOrderView * @param OrderIndex $orderIndex * @param $orderId - * @internal param SalesOrderView $orderView + * @return void */ public function processAssert(SalesOrderView $salesOrderView, OrderIndex $orderIndex, $orderId) { @@ -34,13 +38,15 @@ public function processAssert(SalesOrderView $salesOrderView, OrderIndex $orderI /** @var \Magento\Sales\Test\Block\Adminhtml\Order\View\Tab\Info $infoTab */ $infoTab = $salesOrderView->getOrderForm()->openTab('info')->getTab('info'); - $latestComment = $infoTab->getCommentHistoryBlock()->getLatestComment(); + $latestComment = $infoTab->getCommentsHistoryBlock()->getLatestComment(); \PHPUnit_Framework_Assert::assertContains(self::$message, $latestComment['comment']); } /** - * @inheritdoc + * Returns a string representation of the object. + * + * @return string */ public function toString() { diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderCommentsHistoryNotifyStatus.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderCommentsHistoryNotifyStatus.php index e8a4797fb1b11..fba79572c570e 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderCommentsHistoryNotifyStatus.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderCommentsHistoryNotifyStatus.php @@ -11,12 +11,12 @@ use Magento\Sales\Test\Fixture\OrderInjectable; /** - * Class AssertOrderCommentsHistoryNotifyStatus + * Assert that comment has appropriate notification status in Comments History section on order page in Admin. */ class AssertOrderCommentsHistoryNotifyStatus extends AbstractConstraint { /** - * Assert that comment about refunded amount exist in Comments History section on order page in Admin. + * Assert that comment has appropriate notification status in Comments History section on order page in Admin. * * @param SalesOrderView $salesOrderView * @param OrderIndex $salesOrder @@ -38,7 +38,7 @@ public function processAssert( /** @var \Magento\Sales\Test\Block\Adminhtml\Order\View\Tab\Info $infoTab */ $infoTab = $salesOrderView->getOrderForm()->openTab('info')->getTab('info'); - $latestComment = $infoTab->getCommentHistoryBlock()->getLatestComment(); + $latestComment = $infoTab->getCommentsHistoryBlock()->getLatestComment(); \PHPUnit_Framework_Assert::assertContains( $latestComment['is_customer_notified'], diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertRefundInCommentsHistory.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertRefundInCommentsHistory.php index ce242eab12a01..5b035fc420a53 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertRefundInCommentsHistory.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertRefundInCommentsHistory.php @@ -40,7 +40,13 @@ public function processAssert( /** @var \Magento\Sales\Test\Block\Adminhtml\Order\View\Tab\Info $infoTab */ $infoTab = $salesOrderView->getOrderForm()->openTab('info')->getTab('info'); - $comments = $infoTab->getCommentHistoryBlock()->getComments(); + $comments = $infoTab->getCommentsHistoryBlock()->getComments(); + + foreach ($comments as $key => $comment) { + if (stristr($comment['comment'], 'refunded') === false) { + unset($comments[$key]); + } + } foreach ($refundedPrices as $key => $refundedPrice) { \PHPUnit_Framework_Assert::assertRegExp( diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertRefundOrderStatusInCommentsHistory.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertRefundOrderStatusInCommentsHistory.php index bfdfec027f745..c6f72f427d041 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertRefundOrderStatusInCommentsHistory.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertRefundOrderStatusInCommentsHistory.php @@ -11,12 +11,12 @@ use Magento\Sales\Test\Fixture\OrderInjectable; /** - * Assert that comment about refunded amount exist in Comments History section on order page in Admin. + * Assert that comment with correct order status exist in Comments History section on order page in Admin. */ class AssertRefundOrderStatusInCommentsHistory extends AbstractConstraint { /** - * Assert that comment about refunded amount exist in Comments History section on order page in Admin. + * Assert that comment with correct order status exist in Comments History section on order page in Admin. * * @param SalesOrderView $salesOrderView * @param OrderIndex $salesOrder @@ -33,7 +33,7 @@ public function processAssert( /** @var \Magento\Sales\Test\Block\Adminhtml\Order\View\Tab\Info $infoTab */ $infoTab = $salesOrderView->getOrderForm()->openTab('info')->getTab('info'); - $latestComment = $infoTab->getCommentHistoryBlock()->getLatestComment(); + $latestComment = $infoTab->getCommentsHistoryBlock()->getLatestComment(); \PHPUnit_Framework_Assert::assertContains( $infoTab->getOrderStatus(), diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertVoidInCommentsHistory.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertVoidInCommentsHistory.php index c1e4db8ca0021..1b9c48fdc4ab9 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertVoidInCommentsHistory.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertVoidInCommentsHistory.php @@ -40,7 +40,7 @@ public function processAssert( /** @var \Magento\Sales\Test\Block\Adminhtml\Order\View\Tab\Info $infoTab */ $infoTab = $salesOrderView->getOrderForm()->openTab('info')->getTab('info'); - $latestComment = $infoTab->getCommentHistoryBlock()->getLatestComment(); + $latestComment = $infoTab->getCommentsHistoryBlock()->getLatestComment(); \PHPUnit_Framework_Assert::assertContains( self::VOIDED_AMOUNT . $prices['grandTotal'], From 96d9e4abd36c1f178bec57bf97cc23b270aad6e2 Mon Sep 17 00:00:00 2001 From: Ostap Smolyar Date: Fri, 30 Dec 2016 15:09:56 +0200 Subject: [PATCH 18/32] MTA-3952: Refactoring comments history block in Order module --- .../Test/TestCase/InvoicePaypalBraintreeTest.xml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/dev/tests/functional/tests/app/Magento/Braintree/Test/TestCase/InvoicePaypalBraintreeTest.xml b/dev/tests/functional/tests/app/Magento/Braintree/Test/TestCase/InvoicePaypalBraintreeTest.xml index 46bd1eff5c05e..1d98e2d792a3e 100644 --- a/dev/tests/functional/tests/app/Magento/Braintree/Test/TestCase/InvoicePaypalBraintreeTest.xml +++ b/dev/tests/functional/tests/app/Magento/Braintree/Test/TestCase/InvoicePaypalBraintreeTest.xml @@ -7,7 +7,7 @@ --> - + Partial capture for order placed within Braintree PayPal catalogProductSimple::product_100_dollar @@ -56,12 +56,12 @@ No test_type:3rd_party_test, severity:S0 - + + - + From 0134d338f71c80174899915012b35f59e8e0a669 Mon Sep 17 00:00:00 2001 From: Vasyl Kozyrenko Date: Fri, 30 Dec 2016 15:19:01 +0200 Subject: [PATCH 19/32] MTA-3901: Add variation for Partial Refund an order placed through Braintree with Partial capture --- .../CreateOnlineCreditMemoBraintreePaypalTest.xml | 10 ++++++++++ .../TestCase/CreateOnlineCreditMemoBraintreeTest.xml | 5 +++++ .../Test/TestCase/CreateOnlineCreditMemoTest.xml | 5 +++++ 3 files changed, 20 insertions(+) diff --git a/dev/tests/functional/tests/app/Magento/Braintree/Test/TestCase/CreateOnlineCreditMemoBraintreePaypalTest.xml b/dev/tests/functional/tests/app/Magento/Braintree/Test/TestCase/CreateOnlineCreditMemoBraintreePaypalTest.xml index de243f9f1b243..90f77942815a3 100644 --- a/dev/tests/functional/tests/app/Magento/Braintree/Test/TestCase/CreateOnlineCreditMemoBraintreePaypalTest.xml +++ b/dev/tests/functional/tests/app/Magento/Braintree/Test/TestCase/CreateOnlineCreditMemoBraintreePaypalTest.xml @@ -13,6 +13,11 @@ default login us_ca_ny_rule + + + 0 + + 139.90 @@ -35,6 +40,11 @@ default login us_ca_ny_rule + + + 0 + + 621.20 diff --git a/dev/tests/functional/tests/app/Magento/Braintree/Test/TestCase/CreateOnlineCreditMemoBraintreeTest.xml b/dev/tests/functional/tests/app/Magento/Braintree/Test/TestCase/CreateOnlineCreditMemoBraintreeTest.xml index c8cf3920902f7..397d582c85e6b 100644 --- a/dev/tests/functional/tests/app/Magento/Braintree/Test/TestCase/CreateOnlineCreditMemoBraintreeTest.xml +++ b/dev/tests/functional/tests/app/Magento/Braintree/Test/TestCase/CreateOnlineCreditMemoBraintreeTest.xml @@ -28,6 +28,11 @@ braintree braintree Closed + + + 0 + + 145.98 diff --git a/dev/tests/functional/tests/app/Magento/Paypal/Test/TestCase/CreateOnlineCreditMemoTest.xml b/dev/tests/functional/tests/app/Magento/Paypal/Test/TestCase/CreateOnlineCreditMemoTest.xml index 10cf09870eec6..8b0c441772926 100644 --- a/dev/tests/functional/tests/app/Magento/Paypal/Test/TestCase/CreateOnlineCreditMemoTest.xml +++ b/dev/tests/functional/tests/app/Magento/Paypal/Test/TestCase/CreateOnlineCreditMemoTest.xml @@ -11,6 +11,11 @@ catalogProductSimple::product_10_dollar default guest + + + 0 + + 15.00 From 27e1d24bec170cba394500e150b838290de383d1 Mon Sep 17 00:00:00 2001 From: Ostap Smolyar Date: Fri, 30 Dec 2016 15:21:26 +0200 Subject: [PATCH 20/32] MTA-3952: Refactoring comments history block in Order module --- .../AssertTransactionIsPresentInSettlementReport.php | 4 ++-- .../AssertAcceptPaymentMessageInCommentsHistory.php | 4 ++-- .../Test/Constraint/AssertAuthorizationInCommentsHistory.php | 2 +- .../Sales/Test/Constraint/AssertCaptureInCommentsHistory.php | 2 +- .../Constraint/AssertDenyPaymentMessageInCommentsHistory.php | 4 ++-- .../Sales/Test/Constraint/AssertRefundInCommentsHistory.php | 2 +- .../Constraint/AssertRefundOrderStatusInCommentsHistory.php | 4 ++-- .../Sales/Test/Constraint/AssertVoidInCommentsHistory.php | 2 +- 8 files changed, 12 insertions(+), 12 deletions(-) diff --git a/dev/tests/functional/tests/app/Magento/Braintree/Test/Constraint/AssertTransactionIsPresentInSettlementReport.php b/dev/tests/functional/tests/app/Magento/Braintree/Test/Constraint/AssertTransactionIsPresentInSettlementReport.php index 1a8f35587e5f3..434e41bb50023 100644 --- a/dev/tests/functional/tests/app/Magento/Braintree/Test/Constraint/AssertTransactionIsPresentInSettlementReport.php +++ b/dev/tests/functional/tests/app/Magento/Braintree/Test/Constraint/AssertTransactionIsPresentInSettlementReport.php @@ -70,9 +70,9 @@ public function toString() } /** - * Get transaction id from order comments + * Get transaction id from order comments. * - * @return mixed + * @return null|string */ private function getTransactionId() { diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertAcceptPaymentMessageInCommentsHistory.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertAcceptPaymentMessageInCommentsHistory.php index 0b041c8c11952..d9c75b3c9dad0 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertAcceptPaymentMessageInCommentsHistory.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertAcceptPaymentMessageInCommentsHistory.php @@ -10,7 +10,7 @@ use Magento\Sales\Test\Page\Adminhtml\SalesOrderView; /** - * Assert that accept payment message exist in Comments History section on order page in Admin. + * Assert that accept payment message exists in Comments History section on order page in Admin. * */ class AssertAcceptPaymentMessageInCommentsHistory extends AbstractConstraint @@ -23,7 +23,7 @@ class AssertAcceptPaymentMessageInCommentsHistory extends AbstractConstraint private static $message = 'Approved the payment online.'; /** - * Assert that accept payment message exist in Comments History section on order page in Admin. + * Assert that accept payment message exists in Comments History section on order page in Admin. * * @param SalesOrderView $salesOrderView * @param OrderIndex $orderIndex diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertAuthorizationInCommentsHistory.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertAuthorizationInCommentsHistory.php index 13ceba996e989..309a3795e68ab 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertAuthorizationInCommentsHistory.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertAuthorizationInCommentsHistory.php @@ -21,7 +21,7 @@ class AssertAuthorizationInCommentsHistory extends AbstractConstraint const AUTHORIZED_AMOUNT_PATTERN = '/(IPN "Pending" )*Authorized amount of \w*\W{1,2}%s. Transaction ID: "[\w\-]*"/'; /** - * Assert that comment about authorized amount exist in Comments History section on order page in Admin. + * Assert that comment about authorized amount exists in Comments History section on order page in Admin. * * @param SalesOrderView $salesOrderView * @param OrderIndex $salesOrder diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertCaptureInCommentsHistory.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertCaptureInCommentsHistory.php index 5ca9c6ef9bc56..14379c279fedc 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertCaptureInCommentsHistory.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertCaptureInCommentsHistory.php @@ -22,7 +22,7 @@ class AssertCaptureInCommentsHistory extends AbstractConstraint const CAPTURED_AMOUNT_PATTERN = '/^Captured amount of \w*\W{1,2}%s online. Transaction ID: "[\w\-]*"/'; /** - * Assert that comment about captured amount exist in Comments History section on order page in Admin. + * Assert that comment about captured amount exists in Comments History section on order page in Admin. * * @param SalesOrderView $salesOrderView * @param OrderIndex $salesOrder diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertDenyPaymentMessageInCommentsHistory.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertDenyPaymentMessageInCommentsHistory.php index 8e95790dd857a..1fca0cc18869d 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertDenyPaymentMessageInCommentsHistory.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertDenyPaymentMessageInCommentsHistory.php @@ -10,7 +10,7 @@ use Magento\Sales\Test\Page\Adminhtml\SalesOrderView; /** - * Assert that deny payment message exist in Comments History section on order page in Admin. + * Assert that deny payment message exists in Comments History section on order page in Admin. * * Constraint checks deny payment message in order comments history */ @@ -24,7 +24,7 @@ class AssertDenyPaymentMessageInCommentsHistory extends AbstractConstraint private static $message = 'Denied the payment online'; /** - * Assert that deny payment message exist in Comments History section on order page in Admin. + * Assert that deny payment message exists in Comments History section on order page in Admin. * * @param SalesOrderView $salesOrderView * @param OrderIndex $orderIndex diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertRefundInCommentsHistory.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertRefundInCommentsHistory.php index 5b035fc420a53..db16052ed107f 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertRefundInCommentsHistory.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertRefundInCommentsHistory.php @@ -21,7 +21,7 @@ class AssertRefundInCommentsHistory extends AbstractConstraint const REFUNDED_AMOUNT_PATTERN = '/^We refunded \w*\W{1,2}%s online. Transaction ID: "[\w\-]*"/'; /** - * Assert that comment about refunded amount exist in Comments History section on order page in Admin. + * Assert that comment about refunded amount exists in Comments History section on order page in Admin. * * @param SalesOrderView $salesOrderView * @param OrderIndex $salesOrder diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertRefundOrderStatusInCommentsHistory.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertRefundOrderStatusInCommentsHistory.php index c6f72f427d041..c90bbf68531cc 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertRefundOrderStatusInCommentsHistory.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertRefundOrderStatusInCommentsHistory.php @@ -11,12 +11,12 @@ use Magento\Sales\Test\Fixture\OrderInjectable; /** - * Assert that comment with correct order status exist in Comments History section on order page in Admin. + * Assert that comment with correct order status exists in Comments History section on order page in Admin. */ class AssertRefundOrderStatusInCommentsHistory extends AbstractConstraint { /** - * Assert that comment with correct order status exist in Comments History section on order page in Admin. + * Assert that comment with correct order status exists in Comments History section on order page in Admin. * * @param SalesOrderView $salesOrderView * @param OrderIndex $salesOrder diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertVoidInCommentsHistory.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertVoidInCommentsHistory.php index 1b9c48fdc4ab9..b3df74ea74a20 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertVoidInCommentsHistory.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertVoidInCommentsHistory.php @@ -21,7 +21,7 @@ class AssertVoidInCommentsHistory extends AbstractConstraint const VOIDED_AMOUNT = 'Voided authorization. Amount: $'; /** - * Assert that comment about voided amount exist in Comments History section on order page in Admin. + * Assert that comment about voided amount exists in Comments History section on order page in Admin. * * @param SalesOrderView $salesOrderView * @param OrderIndex $salesOrder From 803e52b15c2b23fa615f956b0088ed6d78287c1a Mon Sep 17 00:00:00 2001 From: Ostap Smolyar Date: Fri, 30 Dec 2016 15:55:08 +0200 Subject: [PATCH 21/32] MTA-3952: Refactoring comments history block in Order module --- .../Order/View/Tab/Info/CommentsHistoryBlock.php | 14 ++++++++------ .../Constraint/AssertCaptureInCommentsHistory.php | 1 - 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/View/Tab/Info/CommentsHistoryBlock.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/View/Tab/Info/CommentsHistoryBlock.php index 2ddde20539479..ce36ae7324cac 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/View/Tab/Info/CommentsHistoryBlock.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/View/Tab/Info/CommentsHistoryBlock.php @@ -65,11 +65,13 @@ public function getComments() $result = []; $elements = $this->_rootElement->getElements($this->commentHistory); foreach ($elements as $key => $item) { - $result[$key]['date'] = $item->find($this->commentHistoryDate)->getText(); - $result[$key]['time'] = $item->find($this->commentHistoryTime)->getText(); - $result[$key]['status'] = $item->find($this->commentHistoryStatus)->getText(); - $result[$key]['is_customer_notified'] = $item->find($this->commentHistoryNotifiedStatus)->getText(); - $result[$key]['comment'] = $item->find($this->comment)->getText(); + $result[$key] = [ + 'date' => $item->find($this->commentHistoryDate)->getText(), + 'time' => $item->find($this->commentHistoryTime)->getText(), + 'status' => $item->find($this->commentHistoryStatus)->getText(), + 'is_customer_notified' => $item->find($this->commentHistoryNotifiedStatus)->getText(), + 'comment' => $item->find($this->comment)->getText() + ]; } return $result; @@ -83,6 +85,6 @@ public function getComments() public function getLatestComment() { $comments = $this->getComments(); - return end($comments); + return current($comments); } } diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertCaptureInCommentsHistory.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertCaptureInCommentsHistory.php index 14379c279fedc..246f440eb04f9 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertCaptureInCommentsHistory.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertCaptureInCommentsHistory.php @@ -6,7 +6,6 @@ namespace Magento\Sales\Test\Constraint; -use Magento\Sales\Test\Fixture\OrderInjectable; use Magento\Sales\Test\Page\Adminhtml\SalesOrderView; use Magento\Sales\Test\Page\Adminhtml\OrderIndex; use Magento\Mtf\Constraint\AbstractConstraint; From e934849fe40c8bd874be6b987d5f44114cf712c2 Mon Sep 17 00:00:00 2001 From: Ostap Smolyar Date: Tue, 3 Jan 2017 17:01:16 +0200 Subject: [PATCH 22/32] MTA-3952: Refactoring comments history block in Order module --- .../Sales/Test/Constraint/AssertCaptureInCommentsHistory.php | 1 + 1 file changed, 1 insertion(+) diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertCaptureInCommentsHistory.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertCaptureInCommentsHistory.php index 246f440eb04f9..cfaf95bbdeb1a 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertCaptureInCommentsHistory.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertCaptureInCommentsHistory.php @@ -47,6 +47,7 @@ public function processAssert( unset($comments[$key]); } } + $comments = array_values($comments); foreach ($capturedPrices as $key => $capturedPrice) { \PHPUnit_Framework_Assert::assertRegExp( From b1d546c5291ff7a6cd2db8bf8c7fea4fba7e36f2 Mon Sep 17 00:00:00 2001 From: Ostap Smolyar Date: Tue, 3 Jan 2017 17:02:38 +0200 Subject: [PATCH 23/32] MTA-3952: Refactoring comments history block in Order module --- .../Sales/Test/Constraint/AssertRefundInCommentsHistory.php | 1 + 1 file changed, 1 insertion(+) diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertRefundInCommentsHistory.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertRefundInCommentsHistory.php index db16052ed107f..80ab807441093 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertRefundInCommentsHistory.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertRefundInCommentsHistory.php @@ -47,6 +47,7 @@ public function processAssert( unset($comments[$key]); } } + $comments = array_values($comments); foreach ($refundedPrices as $key => $refundedPrice) { \PHPUnit_Framework_Assert::assertRegExp( From df4fbec6975fa10c75181fc3fe780e5ac5493701 Mon Sep 17 00:00:00 2001 From: Vasyl Kozyrenko Date: Wed, 4 Jan 2017 10:48:49 +0200 Subject: [PATCH 24/32] MTA-3901: Add variation for Partial Refund an order placed through Braintree with Partial capture --- ...ateOnlineCreditMemoBraintreePaypalTest.xml | 20 ++++---- .../CreateOnlineCreditMemoBraintreeTest.xml | 7 ++- .../TestStep/PlaceOrderWithPaypalStep.php | 47 +++++++++++++++---- .../Checkout/Test/TestStep/PlaceOrderStep.php | 6 +-- .../TestCase/CreateOnlineCreditMemoTest.xml | 2 +- .../Order/View/Tab/CreditMemos/Grid.php | 2 + .../AssertRefundInCommentsHistory.php | 2 +- .../AssertRefundInCreditMemoTab.php | 2 +- .../Constraint/AssertRefundInRefundsGrid.php | 9 ++-- .../AssertRefundNotInRefundsGrid.php | 2 +- .../AssertRefundedGrandTotalOnFrontend.php | 8 ++-- .../Test/Repository/OrderInjectable/Price.xml | 19 +++++--- 12 files changed, 82 insertions(+), 44 deletions(-) diff --git a/dev/tests/functional/tests/app/Magento/Braintree/Test/TestCase/CreateOnlineCreditMemoBraintreePaypalTest.xml b/dev/tests/functional/tests/app/Magento/Braintree/Test/TestCase/CreateOnlineCreditMemoBraintreePaypalTest.xml index 90f77942815a3..c0ffd06eb479f 100644 --- a/dev/tests/functional/tests/app/Magento/Braintree/Test/TestCase/CreateOnlineCreditMemoBraintreePaypalTest.xml +++ b/dev/tests/functional/tests/app/Magento/Braintree/Test/TestCase/CreateOnlineCreditMemoBraintreePaypalTest.xml @@ -11,7 +11,7 @@ catalogProductSimple::product_10_dollar bundleProduct::bundle_fixed_100_dollar_product default - login + guest us_ca_ny_rule @@ -20,7 +20,7 @@ - 139.90 + 139.90 US_address_1_without_email @@ -29,7 +29,6 @@ braintree_paypal braintree, braintree_paypal, braintree_paypal_sale, braintree_paypal_skip_order_review sale - - test_type:3rd_party_test, severity:S1 @@ -38,16 +37,24 @@ catalogProductSimple::simple_for_sales default - login + guest us_ca_ny_rule 0 + + + 1 + + + + + 0 - 621.20 + 606.20 US_address_1_without_email @@ -56,9 +63,6 @@ braintree_paypal braintree, braintree_paypal, braintree_paypal_skip_order_review 2 - 1 - default - Yes test_type:3rd_party_test, severity:S1 diff --git a/dev/tests/functional/tests/app/Magento/Braintree/Test/TestCase/CreateOnlineCreditMemoBraintreeTest.xml b/dev/tests/functional/tests/app/Magento/Braintree/Test/TestCase/CreateOnlineCreditMemoBraintreeTest.xml index 397d582c85e6b..fd4dd405ba084 100644 --- a/dev/tests/functional/tests/app/Magento/Braintree/Test/TestCase/CreateOnlineCreditMemoBraintreeTest.xml +++ b/dev/tests/functional/tests/app/Magento/Braintree/Test/TestCase/CreateOnlineCreditMemoBraintreeTest.xml @@ -35,14 +35,13 @@ - 145.98 + 145.98 Refund Yes - - @@ -84,10 +83,10 @@ - 1.08 + 1.08 - 134.07 + 134.07 diff --git a/dev/tests/functional/tests/app/Magento/Braintree/Test/TestStep/PlaceOrderWithPaypalStep.php b/dev/tests/functional/tests/app/Magento/Braintree/Test/TestStep/PlaceOrderWithPaypalStep.php index d61e2fff6337a..93b4ae77e7cbf 100644 --- a/dev/tests/functional/tests/app/Magento/Braintree/Test/TestStep/PlaceOrderWithPaypalStep.php +++ b/dev/tests/functional/tests/app/Magento/Braintree/Test/TestStep/PlaceOrderWithPaypalStep.php @@ -11,47 +11,69 @@ use Magento\Checkout\Test\Page\CheckoutOnepageSuccess; use Magento\Mtf\Fixture\FixtureFactory; use Magento\Mtf\TestStep\TestStepInterface; +use Magento\Sales\Test\Fixture\OrderInjectable; /** - * Class PlaceOrderWithPaypalStep + * Place order with Paypal in one page checkout. */ class PlaceOrderWithPaypalStep implements TestStepInterface { /** + * Onepage checkout page. + * * @var CheckoutOnepage */ private $checkoutOnepage; /** + * Assert that Order Grand Total is correct on checkout page review block. + * * @var AssertGrandTotalOrderReview */ private $assertGrandTotalOrderReview; /** + * Assert billing address is not present in selected payment method. + * * @var AssertBillingAddressAbsentInPayment */ private $assertBillingAddressAbsentInPayment; /** + * One page checkout success page. + * * @var CheckoutOnepageSuccess */ private $checkoutOnepageSuccess; /** + * Price array. + * * @var array */ private $prices; /** + * Factory for fixtures. + * * @var FixtureFactory */ private $fixtureFactory; /** + * Array of product entities. + * * @var array */ private $products; + /** + * Fixture OrderInjectable. + * + * @var OrderInjectable + */ + private $order; + /** * @param CheckoutOnepage $checkoutOnepage * @param AssertGrandTotalOrderReview $assertGrandTotalOrderReview @@ -59,7 +81,8 @@ class PlaceOrderWithPaypalStep implements TestStepInterface * @param CheckoutOnepageSuccess $checkoutOnepageSuccess * @param FixtureFactory $fixtureFactory * @param array $products - * @param array $prices + * @param array|null $prices + * @param OrderInjectable|null $order */ public function __construct( CheckoutOnepage $checkoutOnepage, @@ -68,7 +91,8 @@ public function __construct( CheckoutOnepageSuccess $checkoutOnepageSuccess, FixtureFactory $fixtureFactory, array $products, - array $prices = [] + array $prices = [], + OrderInjectable $order = null ) { $this->checkoutOnepage = $checkoutOnepage; $this->assertGrandTotalOrderReview = $assertGrandTotalOrderReview; @@ -77,10 +101,13 @@ public function __construct( $this->fixtureFactory = $fixtureFactory; $this->products = $products; $this->prices = $prices; + $this->order = $order; } /** - * @inheritdoc + * Place order after checking order totals on review step. + * + * @return array */ public function run() { @@ -94,15 +121,15 @@ public function run() ->getSelectedPaymentMethodBlock() ->clickPayWithPaypal(); $this->checkoutOnepage->getBraintreePaypalBlock()->process($parentWindow); - + $data = [ + 'entity_id' => ['products' => $this->products] + ]; + $orderData = $this->order !== null ? $this->order->getData() : []; $order = $this->fixtureFactory->createByCode( 'orderInjectable', - [ - 'data' => [ - 'entity_id' => ['products' => $this->products] - ] - ] + ['data' => array_merge($data, $orderData)] ); + return [ 'orderId' => $this->checkoutOnepageSuccess->getSuccessBlock()->getGuestOrderId(), 'order' => $order diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestStep/PlaceOrderStep.php b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestStep/PlaceOrderStep.php index e1eed665851e4..7da3383014c28 100644 --- a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestStep/PlaceOrderStep.php +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestStep/PlaceOrderStep.php @@ -72,9 +72,9 @@ class PlaceOrderStep implements TestStepInterface * @param AssertGrandTotalOrderReview $assertGrandTotalOrderReview * @param CheckoutOnepageSuccess $checkoutOnepageSuccess * @param FixtureFactory $fixtureFactory - * @param OrderInjectable $order - * @param array $products - * @param array $prices + * @param OrderInjectable|null $order + * @param array|null $products + * @param array|null $prices */ public function __construct( CheckoutOnepage $checkoutOnepage, diff --git a/dev/tests/functional/tests/app/Magento/Paypal/Test/TestCase/CreateOnlineCreditMemoTest.xml b/dev/tests/functional/tests/app/Magento/Paypal/Test/TestCase/CreateOnlineCreditMemoTest.xml index 8b0c441772926..6c8d7bdc2dc96 100644 --- a/dev/tests/functional/tests/app/Magento/Paypal/Test/TestCase/CreateOnlineCreditMemoTest.xml +++ b/dev/tests/functional/tests/app/Magento/Paypal/Test/TestCase/CreateOnlineCreditMemoTest.xml @@ -18,7 +18,7 @@ - 15.00 + 15.00 US_address_1_without_email diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/View/Tab/CreditMemos/Grid.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/View/Tab/CreditMemos/Grid.php index 1cfad8033bd57..495bd7bcdab29 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/View/Tab/CreditMemos/Grid.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/View/Tab/CreditMemos/Grid.php @@ -70,6 +70,7 @@ class Grid extends DataGrid */ public function getCreditMemoId() { + $this->resetFilter(); $this->waitForElementNotVisible($this->loader, Locator::SELECTOR_XPATH); return $this->_rootElement->find($this->creditMemoId)->getText(); } @@ -82,6 +83,7 @@ public function getCreditMemoId() public function getIds() { $result = []; + $this->resetFilter(); $this->waitForElementNotVisible($this->loader, Locator::SELECTOR_XPATH); $creditMemoIds = $this->_rootElement->getElements($this->creditMemoId); foreach ($creditMemoIds as $creditMemoId) { diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertRefundInCommentsHistory.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertRefundInCommentsHistory.php index e7c98aa0f7cb6..97e99eb9f7b36 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertRefundInCommentsHistory.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertRefundInCommentsHistory.php @@ -42,7 +42,7 @@ public function processAssert( $actualRefundedAmount = $salesOrderView->getOrderHistoryBlock()->getRefundedAmount(); foreach ($refundedPrices as $key => $refundedPrice) { \PHPUnit_Framework_Assert::assertRegExp( - sprintf(self::REFUNDED_AMOUNT_PATTERN, $refundedPrice['grand_refund_total']), + sprintf(self::REFUNDED_AMOUNT_PATTERN, $refundedPrice['grand_creditmemo_total']), $actualRefundedAmount[$key], 'Incorrect refunded amount value for the order #' . $orderId ); diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertRefundInCreditMemoTab.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertRefundInCreditMemoTab.php index f42e1de5ad13c..67f023784c6fb 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertRefundInCreditMemoTab.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertRefundInCreditMemoTab.php @@ -37,7 +37,7 @@ public function processAssert( $salesOrderView->getOrderForm()->openTab('creditmemos'); /** @var Grid $grid */ $grid = $salesOrderView->getOrderForm()->getTab('creditmemos')->getGridBlock(); - $amount = $order->getPrice(); + $amount = $order->getPrice()['refund']; foreach ($ids['creditMemoIds'] as $key => $creditMemoId) { $filter = [ 'id' => $creditMemoId, diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertRefundInRefundsGrid.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertRefundInRefundsGrid.php index 5b63d92a17e8e..bf61d1018be03 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertRefundInRefundsGrid.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertRefundInRefundsGrid.php @@ -11,13 +11,12 @@ use Magento\Mtf\Constraint\AbstractConstraint; /** - * Class AssertRefundInRefundsGrid - * Assert that refund is present in the 'Refunds' grid with correct ID, order ID, refunded amount + * Assert that refund is present in the 'Refunds' grid with correct ID, order ID, refunded amount. */ class AssertRefundInRefundsGrid extends AbstractConstraint { /** - * Assert that refund is present in the 'Refunds' grid with correct ID, order ID, refunded amount + * Assert that refund is present in the 'Refunds' grid with correct ID, order ID, refunded amount. * * @param CreditMemoIndex $creditMemoIndex * @param OrderInjectable $order @@ -27,7 +26,7 @@ class AssertRefundInRefundsGrid extends AbstractConstraint public function processAssert(CreditMemoIndex $creditMemoIndex, OrderInjectable $order, array $ids) { $creditMemoIndex->open(); - $amount = $order->getPrice(); + $amount = $order->getPrice()['refund']; $orderId = $order->getId(); foreach ($ids['creditMemoIds'] as $key => $creditMemoId) { $filter = [ @@ -47,7 +46,7 @@ public function processAssert(CreditMemoIndex $creditMemoIndex, OrderInjectable } /** - * Returns a string representation of the object + * Returns a string representation of the object. * * @return string */ diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertRefundNotInRefundsGrid.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertRefundNotInRefundsGrid.php index c754d6529c0ef..ffd6e10e8aa0a 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertRefundNotInRefundsGrid.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertRefundNotInRefundsGrid.php @@ -26,7 +26,7 @@ class AssertRefundNotInRefundsGrid extends AbstractConstraint public function processAssert(CreditMemoIndex $creditMemoIndex, OrderInjectable $order, array $ids) { $creditMemoIndex->open(); - $amount = $order->getPrice(); + $amount = $order->getPrice()['refund']; $orderId = $order->getId(); foreach ($ids['creditMemoIds'] as $key => $creditMemoId) { $filter = [ diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertRefundedGrandTotalOnFrontend.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertRefundedGrandTotalOnFrontend.php index 83e6082f1054d..a6437c64dfdaa 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertRefundedGrandTotalOnFrontend.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertRefundedGrandTotalOnFrontend.php @@ -12,12 +12,12 @@ use Magento\Sales\Test\Page\CustomerOrderView; /** - * Assert that refunded grand total is equal to data from fixture on My Account page + * Assert that refunded grand total is equal to data from fixture on My Account page. */ class AssertRefundedGrandTotalOnFrontend extends AbstractAssertOrderOnFrontend { /** - * Assert that refunded grand total is equal to data from fixture on My Account page + * Assert that refunded grand total is equal to data from fixture on My Account page. * * @param OrderHistory $orderHistory * @param OrderInjectable $order @@ -38,14 +38,14 @@ public function processAssert( $customerOrderView->getOrderViewBlock()->openLinkByName('Refunds'); foreach ($ids['creditMemoIds'] as $key => $creditMemoId) { \PHPUnit_Framework_Assert::assertEquals( - number_format($order->getPrice()[$key]['grand_creditmemo_total'], 2), + number_format($order->getPrice()['refund'][$key]['grand_creditmemo_total'], 2), $creditMemoView->getCreditMemoBlock()->getItemBlock($creditMemoId)->getGrandTotal() ); } } /** - * Returns a string representation of the object + * Returns a string representation of the object. * * @return string */ diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Repository/OrderInjectable/Price.xml b/dev/tests/functional/tests/app/Magento/Sales/Test/Repository/OrderInjectable/Price.xml index 64e2f88081724..8c3f31343a918 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Repository/OrderInjectable/Price.xml +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Repository/OrderInjectable/Price.xml @@ -34,20 +34,27 @@ - - 565 + + + 565 + - - 555 + + + 555 + + - - 110 + + + 110 + From 87d9218c0985c5d97dd586a99a78ffdec71c9220 Mon Sep 17 00:00:00 2001 From: Vasyl Kozyrenko Date: Wed, 4 Jan 2017 14:45:38 +0200 Subject: [PATCH 25/32] MTA-3901: Add variation for Partial Refund an order placed through Braintree with Partial capture --- ...ateOnlineCreditMemoBraintreePaypalTest.xml | 3 ++ .../CreateOnlineCreditMemoBraintreeTest.xml | 4 +-- .../Block/Adminhtml/Order/AbstractItems.php | 4 +-- .../Adminhtml/Order/Shipment/View/Items.php | 10 +++---- .../AssertRefundInCommentsHistory.php | 2 +- .../Sales/Test/TestStep/SubmitOrderStep.php | 28 ++++++------------- .../Shipping/Test/Block/Adminhtml/Form.php | 2 +- 7 files changed, 23 insertions(+), 30 deletions(-) diff --git a/dev/tests/functional/tests/app/Magento/Braintree/Test/TestCase/CreateOnlineCreditMemoBraintreePaypalTest.xml b/dev/tests/functional/tests/app/Magento/Braintree/Test/TestCase/CreateOnlineCreditMemoBraintreePaypalTest.xml index c0ffd06eb479f..c791dfb10b63d 100644 --- a/dev/tests/functional/tests/app/Magento/Braintree/Test/TestCase/CreateOnlineCreditMemoBraintreePaypalTest.xml +++ b/dev/tests/functional/tests/app/Magento/Braintree/Test/TestCase/CreateOnlineCreditMemoBraintreePaypalTest.xml @@ -54,6 +54,9 @@ + 621.20 + + 606.20 diff --git a/dev/tests/functional/tests/app/Magento/Braintree/Test/TestCase/CreateOnlineCreditMemoBraintreeTest.xml b/dev/tests/functional/tests/app/Magento/Braintree/Test/TestCase/CreateOnlineCreditMemoBraintreeTest.xml index fd4dd405ba084..2c1deb13024e2 100644 --- a/dev/tests/functional/tests/app/Magento/Braintree/Test/TestCase/CreateOnlineCreditMemoBraintreeTest.xml +++ b/dev/tests/functional/tests/app/Magento/Braintree/Test/TestCase/CreateOnlineCreditMemoBraintreeTest.xml @@ -83,10 +83,10 @@ - 1.08 + 134.07 - 134.07 + 1.08 diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/AbstractItems.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/AbstractItems.php index 38ad9139d4fdb..012cac3848a8e 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/AbstractItems.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/AbstractItems.php @@ -111,7 +111,7 @@ public function getData() * @param ElementInterface $item * @return null|int */ - private function getQty(ElementInterface $item) + protected function getQty(ElementInterface $item) { $qty = null; $elements = $item->getElements($this->qty); @@ -127,7 +127,7 @@ private function getQty(ElementInterface $item) * @param ElementInterface $item * @return string */ - private function getSku(ElementInterface $item) + protected function getSku(ElementInterface $item) { $itemContent = $item->find($this->sku)->getText(); $itemContent = preg_replace('/\n|\r/', '', $itemContent); diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Shipment/View/Items.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Shipment/View/Items.php index 0988649b5df2b..8ba05c57137ec 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Shipment/View/Items.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Shipment/View/Items.php @@ -9,13 +9,12 @@ use Magento\Sales\Test\Block\Adminhtml\Order\AbstractItems; /** - * Class Items - * Shipment Items block on Shipment view page + * Shipment Items block on Shipment view page. */ class Items extends AbstractItems { /** - * Get items data + * Get items data. * * @return array */ @@ -27,8 +26,9 @@ public function getData() foreach ($items as $item) { $itemData = []; - $itemData += $this->parseProductName($item->find($this->product)->getText()); - $itemData['qty'] = $item->find($this->qty)->getText(); + $itemData['product'] = preg_replace('/\n|\r/', '', $item->find($this->title)->getText()); + $itemData['sku'] = $this->getSku($item); + $itemData['qty'] = $this->getQty($item); $data[] = $itemData; } diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertRefundInCommentsHistory.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertRefundInCommentsHistory.php index 97e99eb9f7b36..17bc5332f3d62 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertRefundInCommentsHistory.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertRefundInCommentsHistory.php @@ -39,7 +39,7 @@ public function processAssert( $salesOrder->open(); $salesOrder->getSalesOrderGrid()->searchAndOpen(['id' => $orderId]); $refundedPrices = $order->getPrice()['refund']; - $actualRefundedAmount = $salesOrderView->getOrderHistoryBlock()->getRefundedAmount(); + $actualRefundedAmount = array_reverse($salesOrderView->getOrderHistoryBlock()->getRefundedAmount()); foreach ($refundedPrices as $key => $refundedPrice) { \PHPUnit_Framework_Assert::assertRegExp( sprintf(self::REFUNDED_AMOUNT_PATTERN, $refundedPrice['grand_creditmemo_total']), diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/TestStep/SubmitOrderStep.php b/dev/tests/functional/tests/app/Magento/Sales/Test/TestStep/SubmitOrderStep.php index ef35728207a4e..3390d579cc3a7 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/TestStep/SubmitOrderStep.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/TestStep/SubmitOrderStep.php @@ -8,7 +8,6 @@ use Magento\Customer\Test\Fixture\Address; use Magento\Customer\Test\Fixture\Customer; -use Magento\Sales\Test\Fixture\OrderInjectable; use Magento\Sales\Test\Page\Adminhtml\OrderCreateIndex; use Magento\Sales\Test\Page\Adminhtml\SalesOrderView; use Magento\Mtf\Fixture\FixtureFactory; @@ -61,20 +60,12 @@ class SubmitOrderStep implements TestStepInterface */ private $products; - /** - * Fixture OrderInjectable. - * - * @var OrderInjectable - */ - private $order; - /** * @param OrderCreateIndex $orderCreateIndex * @param SalesOrderView $salesOrderView * @param FixtureFactory $fixtureFactory * @param Customer $customer * @param \Magento\Mtf\Fixture\FixtureInterface[] $products - * @param OrderInjectable|null $order * @param Address|null $billingAddress */ public function __construct( @@ -83,7 +74,6 @@ public function __construct( FixtureFactory $fixtureFactory, Customer $customer, array $products, - OrderInjectable $order = null, Address $billingAddress = null ) { $this->orderCreateIndex = $orderCreateIndex; @@ -91,8 +81,8 @@ public function __construct( $this->fixtureFactory = $fixtureFactory; $this->customer = $customer; $this->products = $products; - $this->order = $order; $this->billingAddress = $billingAddress; + $this->products = $products; } /** @@ -105,16 +95,16 @@ public function run() $this->orderCreateIndex->getCreateBlock()->submitOrder(); $this->salesOrderView->getMessagesBlock()->waitSuccessMessage(); $orderId = trim($this->salesOrderView->getTitleBlock()->getTitle(), '#'); - $data = [ - 'id' => $orderId, - 'customer_id' => ['customer' => $this->customer], - 'entity_id' => ['products' => $this->products], - 'billing_address_id' => ['billingAddress' => $this->billingAddress], - ]; - $orderData = $this->order !== null ? $this->order->getData() : []; $order = $this->fixtureFactory->createByCode( 'orderInjectable', - ['data' => array_merge($data, $orderData)] + [ + 'data' => [ + 'id' => $orderId, + 'customer_id' => ['customer' => $this->customer], + 'entity_id' => ['products' => $this->products], + 'billing_address_id' => ['billingAddress' => $this->billingAddress], + ] + ] ); return ['orderId' => $orderId, 'order' => $order]; diff --git a/dev/tests/functional/tests/app/Magento/Shipping/Test/Block/Adminhtml/Form.php b/dev/tests/functional/tests/app/Magento/Shipping/Test/Block/Adminhtml/Form.php index f46b812ef0def..38fcff9a1de6a 100644 --- a/dev/tests/functional/tests/app/Magento/Shipping/Test/Block/Adminhtml/Form.php +++ b/dev/tests/functional/tests/app/Magento/Shipping/Test/Block/Adminhtml/Form.php @@ -74,7 +74,7 @@ public function fillData(array $data, $products = null) } if (isset($data['items_data']) && $products !== null) { foreach ($products as $key => $product) { - $this->getItemsBlock()->getItemProductBlock($product)->fillProduct($data['items_data'][$key]); + $this->getItemsBlock()->getItemProductBlock($product->getSku())->fillProduct($data['items_data'][$key]); } } } From bedf482e1e8fcb805b388a4199472a88094a745d Mon Sep 17 00:00:00 2001 From: Vasyl Kozyrenko Date: Wed, 4 Jan 2017 19:12:17 +0200 Subject: [PATCH 26/32] MTA-3901: Add variation for Partial Refund an order placed through Braintree with Partial capture --- dev/tests/functional/composer.json | 2 +- .../Test/TestStep/PlaceOrderWithPaypalStep.php | 2 +- .../Magento/Checkout/Test/TestStep/PlaceOrderStep.php | 10 +++++----- .../Sales/Test/Repository/OrderInjectable/Price.xml | 6 +++++- .../Magento/Sales/Test/TestStep/SubmitOrderStep.php | 2 +- 5 files changed, 13 insertions(+), 9 deletions(-) diff --git a/dev/tests/functional/composer.json b/dev/tests/functional/composer.json index 3567ec530f437..cfa06fbf60402 100644 --- a/dev/tests/functional/composer.json +++ b/dev/tests/functional/composer.json @@ -1,6 +1,6 @@ { "require": { - "magento/mtf": "1.0.0-rc51", + "magento/mtf": "1.0.0-rc52", "php": "~5.6.5|7.0.2|~7.0.6", "phpunit/phpunit": "~4.8.0|~5.5.0", "phpunit/phpunit-selenium": ">=1.2" diff --git a/dev/tests/functional/tests/app/Magento/Braintree/Test/TestStep/PlaceOrderWithPaypalStep.php b/dev/tests/functional/tests/app/Magento/Braintree/Test/TestStep/PlaceOrderWithPaypalStep.php index 93b4ae77e7cbf..f538052808a80 100644 --- a/dev/tests/functional/tests/app/Magento/Braintree/Test/TestStep/PlaceOrderWithPaypalStep.php +++ b/dev/tests/functional/tests/app/Magento/Braintree/Test/TestStep/PlaceOrderWithPaypalStep.php @@ -81,7 +81,7 @@ class PlaceOrderWithPaypalStep implements TestStepInterface * @param CheckoutOnepageSuccess $checkoutOnepageSuccess * @param FixtureFactory $fixtureFactory * @param array $products - * @param array|null $prices + * @param array $prices * @param OrderInjectable|null $order */ public function __construct( diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestStep/PlaceOrderStep.php b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestStep/PlaceOrderStep.php index 7da3383014c28..a56f98b802306 100644 --- a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestStep/PlaceOrderStep.php +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestStep/PlaceOrderStep.php @@ -72,26 +72,26 @@ class PlaceOrderStep implements TestStepInterface * @param AssertGrandTotalOrderReview $assertGrandTotalOrderReview * @param CheckoutOnepageSuccess $checkoutOnepageSuccess * @param FixtureFactory $fixtureFactory + * @param array $products + * @param array $prices * @param OrderInjectable|null $order - * @param array|null $products - * @param array|null $prices */ public function __construct( CheckoutOnepage $checkoutOnepage, AssertGrandTotalOrderReview $assertGrandTotalOrderReview, CheckoutOnepageSuccess $checkoutOnepageSuccess, FixtureFactory $fixtureFactory, - OrderInjectable $order = null, array $products = [], - array $prices = [] + array $prices = [], + OrderInjectable $order = null ) { $this->checkoutOnepage = $checkoutOnepage; $this->assertGrandTotalOrderReview = $assertGrandTotalOrderReview; $this->checkoutOnepageSuccess = $checkoutOnepageSuccess; $this->fixtureFactory = $fixtureFactory; - $this->order = $order; $this->products = $products; $this->prices = $prices; + $this->order = $order; } /** diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Repository/OrderInjectable/Price.xml b/dev/tests/functional/tests/app/Magento/Sales/Test/Repository/OrderInjectable/Price.xml index 8c3f31343a918..be727952f420b 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Repository/OrderInjectable/Price.xml +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Repository/OrderInjectable/Price.xml @@ -66,8 +66,12 @@ + + + 565 + + - 565 565 565 diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/TestStep/SubmitOrderStep.php b/dev/tests/functional/tests/app/Magento/Sales/Test/TestStep/SubmitOrderStep.php index 3390d579cc3a7..3967b6571baa6 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/TestStep/SubmitOrderStep.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/TestStep/SubmitOrderStep.php @@ -61,6 +61,7 @@ class SubmitOrderStep implements TestStepInterface private $products; /** + * @constructor * @param OrderCreateIndex $orderCreateIndex * @param SalesOrderView $salesOrderView * @param FixtureFactory $fixtureFactory @@ -80,7 +81,6 @@ public function __construct( $this->salesOrderView = $salesOrderView; $this->fixtureFactory = $fixtureFactory; $this->customer = $customer; - $this->products = $products; $this->billingAddress = $billingAddress; $this->products = $products; } From 2c871c03d4851bbbdbaf94dfc87dd6f08cd177e7 Mon Sep 17 00:00:00 2001 From: Rykh Oleksandr Date: Thu, 5 Jan 2017 12:35:10 +0200 Subject: [PATCH 27/32] MTA-3901: Add variation for Partial Refund an order placed through Braintree with Partial capture - skipped unused parameter --- .../tests/app/Magento/Checkout/Test/Fixture/Cart/Items.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/Fixture/Cart/Items.php b/dev/tests/functional/tests/app/Magento/Checkout/Test/Fixture/Cart/Items.php index 4a30bee726571..1d81b595b9b51 100644 --- a/dev/tests/functional/tests/app/Magento/Checkout/Test/Fixture/Cart/Items.php +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/Fixture/Cart/Items.php @@ -53,6 +53,8 @@ protected function getModuleName(FixtureInterface $product) * * @param null|string $key * @return array + * + * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function getData($key = null) { From 0b86f931a9e083a102c3347a7e87ca67c4bdcbc8 Mon Sep 17 00:00:00 2001 From: Rykh Oleksandr Date: Fri, 6 Jan 2017 15:46:22 +0200 Subject: [PATCH 28/32] MTA-3901: Add variation for Partial Refund an order placed through Braintree with Partial capture - fixed fail with comments --- .../Magento/Checkout/Test/Fixture/Cart/Items.php | 4 +--- .../Test/Fixture/Cart/Item.php | 6 +++++- .../Test/TestCase/CreateOnlineCreditMemoTest.xml | 16 +++++++++++----- .../Order/View/Tab/Info/CommentsHistoryBlock.php | 5 ++++- .../AssertCaptureInCommentsHistory.php | 2 +- .../Constraint/AssertRefundInCommentsHistory.php | 2 +- .../Sales/Test/TestStep/SubmitOrderStep.php | 1 - .../Block/Product/ProductList/ProductItem.php | 4 +++- .../ConfigurableProduct/CheckoutData.xml | 4 ++++ 9 files changed, 30 insertions(+), 14 deletions(-) diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/Fixture/Cart/Items.php b/dev/tests/functional/tests/app/Magento/Checkout/Test/Fixture/Cart/Items.php index 1d81b595b9b51..117a028d83531 100644 --- a/dev/tests/functional/tests/app/Magento/Checkout/Test/Fixture/Cart/Items.php +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/Fixture/Cart/Items.php @@ -53,8 +53,6 @@ protected function getModuleName(FixtureInterface $product) * * @param null|string $key * @return array - * - * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function getData($key = null) { @@ -65,7 +63,7 @@ public function getData($key = null) $this->data[] = $item; } - return $this->data; + return parent::getData($key); } /** diff --git a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Fixture/Cart/Item.php b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Fixture/Cart/Item.php index 46cf2ceefe8ac..d317d1686a9f7 100644 --- a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Fixture/Cart/Item.php +++ b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Fixture/Cart/Item.php @@ -48,7 +48,11 @@ public function getData($key = null) ]; } $attributeKey = implode(' ', $attributeKey); - $cartItem['sku'] = $productData['configurable_attributes_data']['matrix'][$attributeKey]['sku']; + if (isset($productData['configurable_attributes_data']['matrix'][$attributeKey])) { + $cartItem['sku'] = $productData['configurable_attributes_data']['matrix'][$attributeKey]['sku']; + } else { + $cartItem['sku'] = $productData['sku']; + } $cartItem['name'] = $productData['name']; $cartItem['options'] = isset($cartItem['options']) diff --git a/dev/tests/functional/tests/app/Magento/Paypal/Test/TestCase/CreateOnlineCreditMemoTest.xml b/dev/tests/functional/tests/app/Magento/Paypal/Test/TestCase/CreateOnlineCreditMemoTest.xml index 215764edfb49d..c0bde12b15a06 100644 --- a/dev/tests/functional/tests/app/Magento/Paypal/Test/TestCase/CreateOnlineCreditMemoTest.xml +++ b/dev/tests/functional/tests/app/Magento/Paypal/Test/TestCase/CreateOnlineCreditMemoTest.xml @@ -8,6 +8,7 @@ + test_type:3rd_party_test, severity:S0 catalogProductSimple::product_10_dollar default guest @@ -38,7 +39,6 @@ Capture Yes - test_type:3rd_party_test, severity:S0 @@ -46,11 +46,19 @@ + test_type:3rd_party_test, severity:S0 catalogProductSimple::product_10_dollar default guest - - 15.00 + + + 0 + + + + + 15.00 + US_address_1_without_email Flat Rate @@ -58,7 +66,6 @@ payflowpro payflowpro visa_default - - Closed Authorization @@ -72,7 +79,6 @@ Capture Yes - test_type:3rd_party_test, severity:S0 diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/View/Tab/Info/CommentsHistoryBlock.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/View/Tab/Info/CommentsHistoryBlock.php index ce36ae7324cac..61f6f923016ce 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/View/Tab/Info/CommentsHistoryBlock.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/View/Tab/Info/CommentsHistoryBlock.php @@ -70,8 +70,11 @@ public function getComments() 'time' => $item->find($this->commentHistoryTime)->getText(), 'status' => $item->find($this->commentHistoryStatus)->getText(), 'is_customer_notified' => $item->find($this->commentHistoryNotifiedStatus)->getText(), - 'comment' => $item->find($this->comment)->getText() + 'comment' => '', ]; + if ($item->find($this->comment)->isVisible()) { + $result[$key]['comment'] = $item->find($this->comment)->getText(); + } } return $result; diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertCaptureInCommentsHistory.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertCaptureInCommentsHistory.php index cfaf95bbdeb1a..48670ab45465a 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertCaptureInCommentsHistory.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertCaptureInCommentsHistory.php @@ -43,7 +43,7 @@ public function processAssert( $comments = $infoTab->getCommentsHistoryBlock()->getComments(); foreach ($comments as $key => $comment) { - if (stristr($comment['comment'], 'captured') === false) { + if (strstr($comment['comment'], 'Captured') === false) { unset($comments[$key]); } } diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertRefundInCommentsHistory.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertRefundInCommentsHistory.php index 2b68473a7fba3..949fd22e3b2c3 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertRefundInCommentsHistory.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertRefundInCommentsHistory.php @@ -48,7 +48,7 @@ public function processAssert( unset($comments[$key]); } } - $comments = array_values($comments); + $comments = array_reverse(array_values($comments)); $refundedPrices = $order->getPrice()['refund']; foreach ($refundedPrices as $key => $refundedPrice) { diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/TestStep/SubmitOrderStep.php b/dev/tests/functional/tests/app/Magento/Sales/Test/TestStep/SubmitOrderStep.php index 3967b6571baa6..134f7add98ff8 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/TestStep/SubmitOrderStep.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/TestStep/SubmitOrderStep.php @@ -61,7 +61,6 @@ class SubmitOrderStep implements TestStepInterface private $products; /** - * @constructor * @param OrderCreateIndex $orderCreateIndex * @param SalesOrderView $salesOrderView * @param FixtureFactory $fixtureFactory diff --git a/dev/tests/functional/tests/app/Magento/Swatches/Test/Block/Product/ProductList/ProductItem.php b/dev/tests/functional/tests/app/Magento/Swatches/Test/Block/Product/ProductList/ProductItem.php index 414d03bc68787..a69e9e4f49c86 100755 --- a/dev/tests/functional/tests/app/Magento/Swatches/Test/Block/Product/ProductList/ProductItem.php +++ b/dev/tests/functional/tests/app/Magento/Swatches/Test/Block/Product/ProductList/ProductItem.php @@ -36,7 +36,9 @@ public function fillData(\Magento\ConfigurableProduct\Test\Fixture\ConfigurableP $attributes = $confAttrSource->getAttributes(); foreach ($options as $option) { - if (!isset($attributes[$option['title']])) { + if (!isset($attributes[$option['title']]) + || stripos ($attributes[$option['title']]->getFrontendInput(), "swatch") === false + ) { continue; } $availableOptions = $attributes[$option['title']]->getOptions(); diff --git a/dev/tests/functional/tests/app/Magento/Swatches/Test/Repository/ConfigurableProduct/CheckoutData.xml b/dev/tests/functional/tests/app/Magento/Swatches/Test/Repository/ConfigurableProduct/CheckoutData.xml index 9b369d5a536f0..9e909245b88a7 100644 --- a/dev/tests/functional/tests/app/Magento/Swatches/Test/Repository/ConfigurableProduct/CheckoutData.xml +++ b/dev/tests/functional/tests/app/Magento/Swatches/Test/Repository/ConfigurableProduct/CheckoutData.xml @@ -34,6 +34,10 @@ attribute_key_0 option_key_1 + + attribute_key_1 + option_key_1 + 1 From 2d34004b004eda1f7b01e98f0a5152a434d15858 Mon Sep 17 00:00:00 2001 From: Vasyl Kozyrenko Date: Fri, 6 Jan 2017 16:36:35 +0200 Subject: [PATCH 29/32] MTA-3901: Add variation for Partial Refund an order placed through Braintree with Partial capture --- .../Swatches/Test/Block/Product/ProductList/ProductItem.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/tests/functional/tests/app/Magento/Swatches/Test/Block/Product/ProductList/ProductItem.php b/dev/tests/functional/tests/app/Magento/Swatches/Test/Block/Product/ProductList/ProductItem.php index a69e9e4f49c86..85363dc542c8a 100755 --- a/dev/tests/functional/tests/app/Magento/Swatches/Test/Block/Product/ProductList/ProductItem.php +++ b/dev/tests/functional/tests/app/Magento/Swatches/Test/Block/Product/ProductList/ProductItem.php @@ -37,7 +37,7 @@ public function fillData(\Magento\ConfigurableProduct\Test\Fixture\ConfigurableP foreach ($options as $option) { if (!isset($attributes[$option['title']]) - || stripos ($attributes[$option['title']]->getFrontendInput(), "swatch") === false + || stripos($attributes[$option['title']]->getFrontendInput(), "swatch") === false ) { continue; } From bc3f83b49b2dbd6c78f376a020292d8d8d19a430 Mon Sep 17 00:00:00 2001 From: Vasyl Kozyrenko Date: Tue, 10 Jan 2017 15:02:42 +0200 Subject: [PATCH 30/32] MTA-3901: Add variation for Partial Refund an order placed through Braintree with Partial capture --- .../functional/etc/repository_replacer_payments.xml | 2 +- .../Test/Fixture/BraintreeSandboxCustomer.xml | 2 +- .../Test/Repository/BraintreeSandboxCustomer.xml | 2 +- .../TestCase/CreateOnlineCreditMemoBraintreeTest.php | 2 +- .../TestCase/CreateOnlineCreditMemoBraintreeTest.xml | 2 +- .../Braintree/Test/TestStep/SettleTransactionStep.php | 2 +- .../Test/TestCase/CreateOnlineCreditMemoTest.xml | 10 +++++----- .../Order/View/Tab/Info/CommentsHistoryBlock.php | 2 +- 8 files changed, 12 insertions(+), 12 deletions(-) diff --git a/dev/tests/functional/etc/repository_replacer_payments.xml b/dev/tests/functional/etc/repository_replacer_payments.xml index 2045f3d02661b..6b9b9fe54515f 100644 --- a/dev/tests/functional/etc/repository_replacer_payments.xml +++ b/dev/tests/functional/etc/repository_replacer_payments.xml @@ -1,7 +1,7 @@ diff --git a/dev/tests/functional/tests/app/Magento/Braintree/Test/Fixture/BraintreeSandboxCustomer.xml b/dev/tests/functional/tests/app/Magento/Braintree/Test/Fixture/BraintreeSandboxCustomer.xml index 6628e4d741eb5..ed7d001af06d2 100644 --- a/dev/tests/functional/tests/app/Magento/Braintree/Test/Fixture/BraintreeSandboxCustomer.xml +++ b/dev/tests/functional/tests/app/Magento/Braintree/Test/Fixture/BraintreeSandboxCustomer.xml @@ -1,7 +1,7 @@ diff --git a/dev/tests/functional/tests/app/Magento/Braintree/Test/Repository/BraintreeSandboxCustomer.xml b/dev/tests/functional/tests/app/Magento/Braintree/Test/Repository/BraintreeSandboxCustomer.xml index fa68a4adf6dc8..e11d49b867d1a 100644 --- a/dev/tests/functional/tests/app/Magento/Braintree/Test/Repository/BraintreeSandboxCustomer.xml +++ b/dev/tests/functional/tests/app/Magento/Braintree/Test/Repository/BraintreeSandboxCustomer.xml @@ -1,7 +1,7 @@ diff --git a/dev/tests/functional/tests/app/Magento/Braintree/Test/TestCase/CreateOnlineCreditMemoBraintreeTest.php b/dev/tests/functional/tests/app/Magento/Braintree/Test/TestCase/CreateOnlineCreditMemoBraintreeTest.php index de41d9e6ca1bd..16aa003bd04b7 100644 --- a/dev/tests/functional/tests/app/Magento/Braintree/Test/TestCase/CreateOnlineCreditMemoBraintreeTest.php +++ b/dev/tests/functional/tests/app/Magento/Braintree/Test/TestCase/CreateOnlineCreditMemoBraintreeTest.php @@ -1,6 +1,6 @@ diff --git a/dev/tests/functional/tests/app/Magento/Braintree/Test/TestStep/SettleTransactionStep.php b/dev/tests/functional/tests/app/Magento/Braintree/Test/TestStep/SettleTransactionStep.php index 23fab32688a5a..977b95fb8b9aa 100644 --- a/dev/tests/functional/tests/app/Magento/Braintree/Test/TestStep/SettleTransactionStep.php +++ b/dev/tests/functional/tests/app/Magento/Braintree/Test/TestStep/SettleTransactionStep.php @@ -1,6 +1,6 @@ - Yes Closed - + Refund Yes - + Capture Yes @@ -67,15 +67,15 @@ payflowpro visa_default Closed - + Authorization Yes - + Refund Yes - + Capture Yes diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/View/Tab/Info/CommentsHistoryBlock.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/View/Tab/Info/CommentsHistoryBlock.php index 61f6f923016ce..9daed9e87482c 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/View/Tab/Info/CommentsHistoryBlock.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/View/Tab/Info/CommentsHistoryBlock.php @@ -1,6 +1,6 @@ Date: Tue, 10 Jan 2017 15:52:34 +0200 Subject: [PATCH 31/32] MTA-3901: Add variation for Partial Refund an order placed through Braintree with Partial capture --- .../app/Magento/Sales/Test/Block/Adminhtml/Order/History.php | 0 .../app/Magento/Sales/Test/Page/Adminhtml/SalesOrderView.xml | 1 - 2 files changed, 1 deletion(-) delete mode 100644 dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/History.php diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/History.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/History.php deleted file mode 100644 index e69de29bb2d1d..0000000000000 diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Page/Adminhtml/SalesOrderView.xml b/dev/tests/functional/tests/app/Magento/Sales/Test/Page/Adminhtml/SalesOrderView.xml index 057acf52bb51c..6d1aceb70bf4f 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Page/Adminhtml/SalesOrderView.xml +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Page/Adminhtml/SalesOrderView.xml @@ -13,7 +13,6 @@ - From a73493d578afacfa9da8ce95b523c96942df65e7 Mon Sep 17 00:00:00 2001 From: Vasyl Kozyrenko Date: Tue, 10 Jan 2017 18:52:34 +0200 Subject: [PATCH 32/32] MTA-3901: Add variation for Partial Refund an order placed through Braintree with Partial capture --- .../TestCase/CreateOnlineCreditMemoBraintreeTest.xml | 9 --------- 1 file changed, 9 deletions(-) diff --git a/dev/tests/functional/tests/app/Magento/Braintree/Test/TestCase/CreateOnlineCreditMemoBraintreeTest.xml b/dev/tests/functional/tests/app/Magento/Braintree/Test/TestCase/CreateOnlineCreditMemoBraintreeTest.xml index 881821c6f37e4..638c76cadb55d 100644 --- a/dev/tests/functional/tests/app/Magento/Braintree/Test/TestCase/CreateOnlineCreditMemoBraintreeTest.xml +++ b/dev/tests/functional/tests/app/Magento/Braintree/Test/TestCase/CreateOnlineCreditMemoBraintreeTest.xml @@ -89,14 +89,6 @@ 1.08 - - Refund - Yes - - - Capture - Yes - 0 @@ -105,7 +97,6 @@ -