-
Notifications
You must be signed in to change notification settings - Fork 9.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3503 from magento-mpi/port-94472
[MPI]-port-94472
- Loading branch information
Showing
19 changed files
with
353 additions
and
60 deletions.
There are no files selected for viewing
42 changes: 42 additions & 0 deletions
42
app/code/Magento/Braintree/Test/Mftf/ActionGroup/AdminOrderBraintreeFillActionGroup.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
--> | ||
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/actionGroupSchema.xsd"> | ||
|
||
<actionGroup name="AdminOrderBraintreeFillActionGroup"> | ||
<!--Select Braintree Payment method on Admin Order Create Page--> | ||
<click stepKey="chooseBraintree" selector="{{NewOrderSection.creditCardBraintree}}"/> | ||
<waitForPageLoad stepKey="waitForBraintreeConfigs" time="5"/> | ||
<click stepKey="openCardTypes" selector="{{NewOrderSection.openCardTypes}}"/> | ||
<waitForPageLoad stepKey="waitForCardTypes" time="3"/> | ||
<click stepKey="chooseCardType" selector="{{NewOrderSection.masterCard}}"/> | ||
<waitForPageLoad stepKey="waitForCardSelected" time="3"/> | ||
|
||
<!--Choose Master Card from drop-down list--> | ||
<switchToIFrame stepKey="switchToCardNumber" selector="{{NewOrderSection.cardFrame}}"/> | ||
<fillField stepKey="fillCardNumber" selector="{{NewOrderSection.creditCardNumber}}" userInput="{{PaymentAndShippingInfo.cardNumber}}"/> | ||
<waitForPageLoad stepKey="waitForFillCardNumber" time="1"/> | ||
<switchToIFrame stepKey="switchBackFromCard"/> | ||
|
||
<!--Fill expire date--> | ||
<switchToIFrame stepKey="switchToExpirationMonth" selector="{{NewOrderSection.monthFrame}}"/> | ||
<fillField stepKey="fillMonth" selector="{{NewOrderSection.expirationMonth}}" userInput="{{PaymentAndShippingInfo.month}}"/> | ||
<waitForPageLoad stepKey="waitForFillMonth" time="1"/> | ||
<switchToIFrame stepKey="switchBackFromMonth"/> | ||
<switchToIFrame stepKey="switchToExpirationYear" selector="{{NewOrderSection.yearFrame}}"/> | ||
<fillField stepKey="fillYear" selector="{{NewOrderSection.expirationYear}}" userInput="{{PaymentAndShippingInfo.year}}"/> | ||
<waitForPageLoad stepKey="waitForFillYear" time="1"/> | ||
<switchToIFrame stepKey="switchBackFromYear"/> | ||
|
||
<!--Fill CVW code--> | ||
<switchToIFrame stepKey="switchToCVV" selector="{{NewOrderSection.cvvFrame}}"/> | ||
<fillField stepKey="fillCVV" selector="{{NewOrderSection.cvv}}" userInput="{{PaymentAndShippingInfo.cvv}}"/> | ||
<wait stepKey="waitForFillCVV" time="1"/> | ||
<switchToIFrame stepKey="switchBackFromCVV"/> | ||
</actionGroup> | ||
</actionGroups> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
126 changes: 126 additions & 0 deletions
126
...to/Braintree/Test/Mftf/Test/CretateAdminOrderWithOnlinePaymentIncludingTaxAndDiscount.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,126 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
--> | ||
|
||
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> | ||
<test name="CreateAdminOrderPayedWithOnlinePaymentIncludingTaxAndDiscount"> | ||
<annotations> | ||
<features value="Braintree"/> | ||
<stories value="Get access to a New Credit Memo Page from Invocie for Order payed with online payment via Admin"/> | ||
<title value="Admin should be able to open a New Credit Memo Page from Invoice Page for Order with tax and discount and payed using online payment method"/> | ||
<description value="Admin should be able to open a New Credit Memo Page from Invoice Page for Order with tax and discount and payed using online payment method"/> | ||
<severity value="CRITICAL"/> | ||
<testCaseId value="MAGETWO-94472"/> | ||
<group value="braintree"/> | ||
</annotations> | ||
|
||
<before> | ||
<!--Create Default Category--> | ||
<createData entity="SimpleSubCategory" stepKey="createCategory"/> | ||
|
||
<!--Create Simple product--> | ||
<createData entity="_defaultProduct" stepKey="simpleProduct"> | ||
<requiredEntity createDataKey="createCategory"/> | ||
</createData> | ||
|
||
<!--Create Tax Rule is based on default tax rates (Stores>Tax Rule) US-CA-*-Rate 1 = 8.2500 US-NY-*-Rate 1 = 8.3750 --> | ||
<createData entity="SimpleTaxRule" stepKey="createTaxRule"/> | ||
|
||
<!--Configure Braintree Payment method--> | ||
<createData entity="BraintreeConfig" stepKey="BraintreeConfigurationData"/> | ||
<createData entity="CustomBraintreeConfigurationData" stepKey="enableBraintree"/> | ||
|
||
<!--Create Retailer Customer with US_CA address--> | ||
<createData entity="Simple_US_Customer_CA" stepKey="simpleCustomer"> | ||
<field key="group_id">3</field> | ||
</createData> | ||
|
||
<!--Login as Admin User--> | ||
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> | ||
</before> | ||
|
||
<after> | ||
<!--Delete Cart Price Rule--> | ||
<actionGroup ref="AdminDeleteCartPriceRuleForRetailerActionGroup" stepKey="deleteSalesRule"/> | ||
|
||
<!--Set to default configuration Tax Shipping Class--> | ||
<actionGroup ref="setDefaultShippingTaxClass" stepKey="setdefaultClass"/> | ||
|
||
<!--Delete Simple Sub Category--> | ||
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/> | ||
|
||
<!--Delete Simple Product--> | ||
<deleteData createDataKey="simpleProduct" stepKey="deleteSimpleProduct"/> | ||
|
||
<!-- Delete Tax Rule --> | ||
<deleteData createDataKey="createTaxRule" stepKey="deleteTaxRule"/> | ||
|
||
<!-- Rollback Braintree to Default --> | ||
<createData entity="RollBackCustomBraintreeConfigurationData" stepKey="rollbackBraintreeConfig"/> | ||
|
||
<!--Delete Customer--> | ||
<deleteData createDataKey="simpleCustomer" stepKey="deleteSimpleCustomer"/> | ||
|
||
<!--Log Out--> | ||
<actionGroup ref="logout" stepKey="logout"/> | ||
</after> | ||
|
||
<!-- Create a cart price rule with 10% discount for whole cart --> | ||
<click selector="{{AdminMenuSection.marketing}}" stepKey="clickOnMarketing" /> | ||
<waitForPageLoad stepKey="waitForMarketing" time="3"/> | ||
<click selector="{{CartPriceRulesSubmenuSection.cartPriceRules}}" stepKey="clickOnCartPriceRules"/> | ||
<waitForPageLoad stepKey="waitForCartPriceRules" time="3"/> | ||
<click selector="{{AdminCartPriceRulesSection.addNewRuleButton}}" stepKey="clickAddNewRule"/> | ||
<fillField selector="{{AdminCartPriceRulesFormSection.ruleName}}" userInput="{{SimpleSalesRule.name}}" stepKey="fillRuleName"/> | ||
<selectOption selector="{{AdminCartPriceRulesFormSection.websites}}" userInput="Main Website" stepKey="selectWebsites"/> | ||
<actionGroup ref="selectRetailerCustomerGroup" stepKey="selectRetailerCustomerGroup"/> | ||
<click selector="{{AdminCartPriceRulesFormSection.actionsHeader}}" stepKey="clickToExpandActions"/> | ||
<selectOption selector="{{AdminCartPriceRulesFormSection.apply}}" userInput="Percent of product price discount" stepKey="selectActionType"/> | ||
<fillField selector="{{AdminCartPriceRulesFormSection.discountAmount}}" userInput="10" stepKey="fillDiscountAmount"/> | ||
<click selector="{{AdminCartPriceRulesFormSection.save}}" stepKey="clickSaveButton"/> | ||
<waitForPageLoad stepKey="waitForCartRuleLoad" time="3"/> | ||
<see selector="{{AdminCartPriceRulesSection.messages}}" userInput="You saved the rule." stepKey="seeSuccessMessage"/> | ||
|
||
<!--Set Taxable Goods for Shipping Tax Class--> | ||
<actionGroup ref="changeShippingTaxClass" stepKey="changeShippingTaxClass"/> | ||
|
||
<!--Adding Special price to product--> | ||
<amOnPage url="{{AdminProductEditPage.url($$simpleProduct.id$$)}}" stepKey="openAdminProductEditPage"/> | ||
<actionGroup ref="AddSpecialPriceToProductActionGroup" stepKey="addSpecialPrice"/> | ||
<actionGroup ref="saveProductForm" stepKey="saveProductForm"/> | ||
|
||
<!--Create New Order--> | ||
<actionGroup ref="navigateToNewOrderPageExistingCustomer" stepKey="navigateToNewOrderWithExistingCustomer"> | ||
<argument name="customer" value="$$simpleCustomer$$"/> | ||
</actionGroup> | ||
|
||
<!--Add a product to order--> | ||
<actionGroup ref="addSimpleProductToOrder" stepKey="addProductToOrder"> | ||
<argument name="product" value="$$simpleProduct$$"/> | ||
</actionGroup> | ||
|
||
<!--Select FlatRate shipping method--> | ||
<actionGroup ref="orderSelectFlatRateShipping" stepKey="orderSelectFlatRateShippingMethod"/> | ||
|
||
<!--Select Braintree online Payment method --> | ||
<actionGroup ref="AdminOrderBraintreeFillActionGroup" stepKey="selectCreditCardPayment"/> | ||
|
||
<!--Submit Order--> | ||
<click stepKey="submitOrder" selector="{{NewOrderSection.submitOrder}}"/> | ||
<waitForPageLoad stepKey="waitForSubmitOrder" time="5"/> | ||
<see selector="{{AdminOrderDetailsMessagesSection.successMessage}}" userInput="You created the order." stepKey="seeOrderSuccessMessage" after="waitForSubmitOrder"/> | ||
|
||
<!-- Create New invoice--> | ||
<actionGroup ref="adminFastCreateInvoice" stepKey="createInvoice"/> | ||
|
||
<!--Get access to Credit Memo page from Invoice page--> | ||
<click selector="{{AdminInvoiceMainActionsSection.openNewCreditMemoFromInvoice}}" stepKey="clickCreateNewCreditMemo"/> | ||
<waitForPageLoad stepKey="waitForLoadNewCreditMemoPage" time="5"/> | ||
<see selector="{{AdminCreditMemoOrderInformationSection.orderStatus}}" userInput="Processing" stepKey="seeNewCreditMemo"/> | ||
</test> | ||
</tests> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.