diff --git a/dev/tests/functional/tests/app/Magento/Braintree/Test/Repository/ConfigData.xml b/dev/tests/functional/tests/app/Magento/Braintree/Test/Repository/ConfigData.xml index 12e27758eff4f0ae8d5c867ab89381311cee6124..268ce5795221dbbe3f545891c4d2e420bc87440e 100644 --- a/dev/tests/functional/tests/app/Magento/Braintree/Test/Repository/ConfigData.xml +++ b/dev/tests/functional/tests/app/Magento/Braintree/Test/Repository/ConfigData.xml @@ -204,6 +204,12 @@ </dataset> <dataset name="braintree_paypal_sale"> + <field name="payment/braintree_section/braintree/active_braintree_paypal" xsi:type="array"> + <item name="scope" xsi:type="string">payment</item> + <item name="scope_id" xsi:type="number">1</item> + <item name="label" xsi:type="string">Yes</item> + <item name="value" xsi:type="number">1</item> + </field> <field name="payment/braintree_section/braintree/braintree_paypal/payment_action" xsi:type="array"> <item name="scope" xsi:type="string">payment</item> <item name="scope_id" xsi:type="number">1</item> @@ -212,6 +218,15 @@ </field> </dataset> + <dataset name="braintree_paypal_sale_rollback"> + <field name="payment/braintree_section/braintree/active_braintree_paypal" xsi:type="array"> + <item name="scope" xsi:type="string">payment</item> + <item name="scope_id" xsi:type="number">1</item> + <item name="label" xsi:type="string">No</item> + <item name="value" xsi:type="number">0</item> + </field> + </dataset> + <dataset name="braintree_paypal_skip_order_review"> <field name="payment/braintree_section/braintree/braintree_paypal/skip_order_review" xsi:type="array"> <item name="scope" xsi:type="string">payment</item> diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Onepage/Login.php b/dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Onepage/Login.php index 49b900e4eedce313df7809a574e150f3c63c4787..507bb5673effc80e7525b238d0b14b2ee6d40c11 100644 --- a/dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Onepage/Login.php +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Onepage/Login.php @@ -6,6 +6,7 @@ namespace Magento\Checkout\Test\Block\Onepage; use Magento\Checkout\Test\Fixture\Checkout; +use Magento\Customer\Test\Fixture\Customer; use Magento\Mtf\Block\Form; use Magento\Mtf\Fixture\FixtureInterface; @@ -93,14 +94,15 @@ class Login extends Form /** * Fill required fields for guest checkout. * - * @param FixtureInterface $customer + * @param Customer $customer * @return void */ - public function fillGuestFields(FixtureInterface $customer) + public function fillGuestFields(Customer $customer) { $mapping = $this->dataMapping(); $this->_rootElement->find($mapping['email']['selector'], $mapping['email']['strategy']) ->setValue($customer->getEmail()); + $this->waitForElementNotVisible($this->loadingMask); } /** diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestStep/SelectCheckoutMethodStep.php b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestStep/SelectCheckoutMethodStep.php index eef5f2fbdd03a9b7325b01aa8b5d4293e566ffbb..4d7cae8eeb13ed3c4e7a76beab31332448176b42 100644 --- a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestStep/SelectCheckoutMethodStep.php +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestStep/SelectCheckoutMethodStep.php @@ -51,13 +51,6 @@ class SelectCheckoutMethodStep implements TestStepInterface */ private $clickProceedToCheckoutStep; - /** - * Shipping carrier and method. - * - * @var array - */ - protected $shipping; - /** * @constructor * @param CheckoutOnepage $checkoutOnepage @@ -65,22 +58,19 @@ class SelectCheckoutMethodStep implements TestStepInterface * @param LogoutCustomerOnFrontendStep $logoutCustomerOnFrontend * @param ClickProceedToCheckoutStep $clickProceedToCheckoutStep * @param string $checkoutMethod - * @param array $shipping */ public function __construct( CheckoutOnepage $checkoutOnepage, Customer $customer, LogoutCustomerOnFrontendStep $logoutCustomerOnFrontend, ClickProceedToCheckoutStep $clickProceedToCheckoutStep, - $checkoutMethod, - array $shipping = [] + $checkoutMethod ) { $this->checkoutOnepage = $checkoutOnepage; $this->customer = $customer; $this->logoutCustomerOnFrontend = $logoutCustomerOnFrontend; $this->clickProceedToCheckoutStep = $clickProceedToCheckoutStep; $this->checkoutMethod = $checkoutMethod; - $this->shipping = $shipping; } /** @@ -98,9 +88,7 @@ class SelectCheckoutMethodStep implements TestStepInterface $this->checkoutOnepage->getLoginBlock()->loginCustomer($this->customer); } } elseif ($this->checkoutMethod === 'guest') { - if (empty($this->shipping)) { - $this->checkoutOnepage->getLoginBlock()->fillGuestFields($this->customer); - } + $this->checkoutOnepage->getLoginBlock()->fillGuestFields($this->customer); } } diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/View/Tab/Invoices/Grid.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/View/Tab/Invoices/Grid.php index d1f27d14a6619f71fc2e459adad23888d4fb51b7..4b3768295799695fbb45db1a17e75acb193b91f7 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/View/Tab/Invoices/Grid.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/View/Tab/Invoices/Grid.php @@ -9,7 +9,7 @@ namespace Magento\Sales\Test\Block\Adminhtml\Order\View\Tab\Invoices; /** * Invoices grid on order view page. */ -class Grid extends \Magento\Backend\Test\Block\Widget\Grid +class Grid extends \Magento\Ui\Test\Block\Adminhtml\DataGrid { /** * Locator value for link in action column. @@ -34,6 +34,9 @@ class Grid extends \Magento\Backend\Test\Block\Widget\Grid 'id' => [ 'selector' => 'input[name="increment_id"]', ], + 'order_id' => [ + 'selector' => 'input[name="order_increment_id"]', + ], 'status' => [ 'selector' => 'select[name="state"]', 'input' => 'select', diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertInvoiceStatusInOrdersGrid.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertInvoiceStatusInOrdersGrid.php new file mode 100644 index 0000000000000000000000000000000000000000..6695786923b5c00c71e12101855421554e940281 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertInvoiceStatusInOrdersGrid.php @@ -0,0 +1,53 @@ +<?php +/** + * Copyright © 2016 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +namespace Magento\Sales\Test\Constraint; + +use Magento\Sales\Test\Page\Adminhtml\SalesOrderView; +use Magento\Mtf\Constraint\AbstractConstraint; + +/** + * Assert invoice status on order page in Admin. + */ +class AssertInvoiceStatusInOrdersGrid extends AbstractConstraint +{ + /** + * Assert invoice status on order page in Admin. + * + * @param SalesOrderView $salesOrderView + * @param string $invoiceStatus + * @param string $orderId + * @return void + */ + public function processAssert( + SalesOrderView $salesOrderView, + $invoiceStatus, + $orderId + ) { + $salesOrderView->open(['order_id' => $orderId]); + $salesOrderView->getOrderForm()->openTab('invoices'); + /** @var \Magento\Sales\Test\Block\Adminhtml\Order\View\Tab\Invoices\Grid $grid */ + $grid = $salesOrderView->getOrderForm()->getTab('invoices')->getGridBlock(); + $filter = [ + 'order_id' => $orderId, + 'status' => $invoiceStatus, + ]; + \PHPUnit_Framework_Assert::assertTrue( + $grid->isRowVisible($filter), + 'Invoice status is incorrect.' + ); + } + + /** + * Returns a string representation of the object. + * + * @return string + */ + public function toString() + { + return 'Invoice status is correct.'; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/etc/di.xml b/dev/tests/functional/tests/app/Magento/Sales/Test/etc/di.xml index f42c97e1a6614a927da685f9cd5e1f8c84ff0c32..df10cccbd82136f027f4ee6b236cafe272cdbdc8 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/etc/di.xml +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/etc/di.xml @@ -11,6 +11,11 @@ <argument name="severity" xsi:type="string">S0</argument> </arguments> </type> + <type name="Magento\Sales\Test\Constraint\AssertInvoiceStatusInOrdersGrid"> + <arguments> + <argument name="severity" xsi:type="string">S1</argument> + </arguments> + </type> <type name="Magento\Sales\Test\Constraint\AssertOrderStatusDuplicateStatus"> <arguments> <argument name="severity" xsi:type="string">S0</argument>