Skip to content

Commit 4593302

Browse files
John ZolperJohn Zolper
authored andcommitted
MC-4239: MFTF Automation of MC-12255 and 12712
1 parent 93d6c83 commit 4593302

16 files changed

+520
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10+
11+
<actionGroup name="ConfigureAuthorizenetAcceptjs">
12+
<arguments>
13+
<argument name="paymentAction" type="string"/>
14+
</arguments>
15+
<!-- Navigate to configuration -->
16+
<waitForPageLoad stepKey="waitForStores"/>
17+
<click stepKey="clickOnStores" selector="{{AdminMenuSection.stores}}"/>
18+
<waitForPageLoad stepKey="waitForConfiguration"/>
19+
<click stepKey="clickOnConfiguration" selector="{{StoresSubmenuSection.configuration}}"/>
20+
<waitForPageLoad stepKey="waitForSales"/>
21+
<waitForElementVisible stepKey="waitForVisibleHack" selector="{{AdminMenuSection.currencySetup}}"/>
22+
<scrollTo stepKey="scrollToSales" selector="{{ConfigurationListSection.sales}}"/>
23+
<click stepKey="clickOnSales" selector="{{ConfigurationListSection.sales}}" />
24+
<waitForPageLoad stepKey="waitForPaymentMethods"/>
25+
<click stepKey="clickOnPaymentMethods" selector="{{ConfigurationListSection.salesPaymentMethods}}" />
26+
<waitForPageLoad stepKey="waitForOpenConfiguration"/>
27+
<scrollTo stepKey="scrollToOpenConfig" selector="{{AuthorizenetAcceptjsConfigurationSection.openSectionToggle}}"/>
28+
<conditionalClick stepKey="openConfiguration" selector="{{AuthorizenetAcceptjsConfigurationSection.openSectionToggle}}" dependentSelector="{{AuthorizenetAcceptjsConfigurationSection.alreadyOpenSectionToggle}}" visible="false"/>
29+
30+
31+
<!-- Fill Auth.net fields and save -->
32+
<waitForPageLoad stepKey="waitToFillApiLogin"/>
33+
<conditionalClick selector="{{AuthorizenetAcceptjsConfigurationSection.paymentActionCheckbox}}" stepKey="uncheckPaymentActionDefault" dependentSelector="{{AuthorizenetAcceptjsConfigurationSection.paymentActionSelectDisabled}}" visible="true"/>
34+
<selectOption selector="{{AuthorizenetAcceptjsConfigurationSection.paymentActionSelect}}" stepKey="selectPaymentAction" userInput="{{paymentAction}}"/>
35+
<scrollTo stepKey="scrollToApiLoginId" selector="{{AuthorizenetAcceptjsConfigurationSection.apiLoginIdField}}"/>
36+
<fillField stepKey="fillApiLoginId" selector="{{AuthorizenetAcceptjsConfigurationSection.apiLoginIdField}}" userInput="{{_CREDS.authorizenet_acceptjs_api_login_id}}"/>
37+
<fillField stepKey="fillTransactionKey" selector="{{AuthorizenetAcceptjsConfigurationSection.transactionKeyField}}" userInput="{{_CREDS.authorizenet_acceptjs_transaction_key}}"/>
38+
<fillField stepKey="fillPublicClientKey" selector="{{AuthorizenetAcceptjsConfigurationSection.publicClientKeyField}}" userInput="{{_CREDS.authorizenet_acceptjs_public_client_key}}"/>
39+
<fillField stepKey="fillSignatureKey" selector="{{AuthorizenetAcceptjsConfigurationSection.signatureKeyField}}" userInput="{{_CREDS.authorizenet_acceptjs_signature_key}}"/>
40+
<uncheckOption stepKey="uncheckCheckbox" selector="{{AuthorizenetAcceptjsConfigurationSection.enabledDefaultCheckbox}}"/>
41+
<selectOption stepKey="fillExpYear" selector="{{AuthorizenetAcceptjsConfigurationSection.enabledDefaultSelect}}" userInput="Yes"/>
42+
<click stepKey="clickOnSave" selector="{{ConfigurationMainActionsSection.save}}" />
43+
</actionGroup>
44+
45+
<actionGroup name="DisableAuthorizenetAcceptjs">
46+
<magentoCLI stepKey="disableBrainTree" command="config:set payment/authorizenet_acceptjs/active 0"/>
47+
</actionGroup>
48+
</actionGroups>
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10+
11+
<actionGroup name="FillPaymentInformation">
12+
<click stepKey="clickOnAuthorizenetToggle" selector="{{AuthorizenetCheckoutSection.selectAuthorizenet}}"/>
13+
<waitForPageLoad stepKey="waitForCardDataSection"/>
14+
<fillField stepKey="fillCardNumber" selector="{{AuthorizenetCheckoutSection.cardInput}}" userInput="{{PaymentAndShippingInfo.cardNumber}}"/>
15+
<selectOption stepKey="fillExpMonth" selector="{{AuthorizenetCheckoutSection.expMonth}}" userInput="{{PaymentAndShippingInfo.month}}"/>
16+
<selectOption stepKey="fillExpYear" selector="{{AuthorizenetCheckoutSection.expYear}}" userInput="20{{PaymentAndShippingInfo.year}}"/>
17+
<fillField stepKey="fillCvv" selector="{{AuthorizenetCheckoutSection.cvv}}" userInput="123"/>
18+
<click stepKey="checkoutButton" selector="{{AuthorizenetCheckoutSection.checkoutButton}}"/>
19+
<waitForPageLoad stepKey="waitForCheckout"/>
20+
</actionGroup>
21+
22+
<!-- Guest checkout Authorizenet fill billing address -->
23+
<actionGroup name="GuestCheckoutAuthorizenetFillBillingAddress">
24+
<arguments>
25+
<argument name="customer"/>
26+
<argument name="customerAddress"/>
27+
</arguments>
28+
<fillField selector="{{GuestAuthorizenetCheckoutSection.firstName}}" userInput="{{customer.firstName}}" stepKey="fillFirstName"/>
29+
<fillField selector="{{GuestAuthorizenetCheckoutSection.lastName}}" userInput="{{customer.lastName}}" stepKey="fillLastName"/>
30+
<fillField selector="{{GuestAuthorizenetCheckoutSection.street}}" userInput="{{customerAddress.street[0]}}" stepKey="fillStreet"/>
31+
<fillField selector="{{GuestAuthorizenetCheckoutSection.city}}" userInput="{{customerAddress.city}}" stepKey="fillCity"/>
32+
<selectOption selector="{{GuestAuthorizenetCheckoutSection.state}}" userInput="{{customerAddress.state}}" stepKey="selectState"/>
33+
<fillField selector="{{GuestAuthorizenetCheckoutSection.postcode}}" userInput="{{customerAddress.postcode}}" stepKey="fillPostCode"/>
34+
<fillField selector="{{GuestAuthorizenetCheckoutSection.telephone}}" userInput="{{customerAddress.telephone}}" stepKey="fillTelephone"/>
35+
<click selector="{{GuestAuthorizenetCheckoutSection.update}}" stepKey="updateAddress"/>
36+
<waitForPageLoad stepKey="waitForUpdate"/>
37+
</actionGroup>
38+
39+
</actionGroups>
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10+
11+
<actionGroup name="ViewAndValidateOrderActionGroup">
12+
<arguments>
13+
<argument name="amount" type="string"/>
14+
<argument name="status" type="string"/>
15+
<argument name="captureStatus" type="string"/>
16+
<argument name="closedStatus" type="string"/>
17+
</arguments>
18+
<amOnPage url="/admin" stepKey="navigateToAdmin"/>
19+
<click selector="{{AdminMenuSection.sales}}" stepKey="clickSales"/>
20+
<waitForPageLoad stepKey="waitForSalesSubsection"/>
21+
<click selector="{{AdminMenuSection.orders}}" stepKey="clickOrders"/>
22+
<waitForPageLoad stepKey="waitForOrdersGrid" time="30"/>
23+
<click selector="{{OrdersGridSection.viewMostRecentOrder}}" stepKey="viewOrder"/>
24+
<waitForPageLoad stepKey="waitForViewOrder"/>
25+
<click selector="{{ViewOrderSection.openInvoiceForm}}" stepKey="openInvoiceForm"/>
26+
<selectOption selector="{{ViewOrderSection.selectCaptureType}}" stepKey="selectCaptureType" userInput="Capture Online"/>
27+
<click selector="{{ViewOrderSection.submitInvoice}}" stepKey="submitInvoice"/>
28+
<waitForPageLoad stepKey="waitForInvoiceLoad"/>
29+
<click selector="{{ViewOrderSection.commentsHistory}}" stepKey="viewCommentsHistory"/>
30+
<waitForPageLoad stepKey="waitForHistoryLoad"/>
31+
<see userInput="{{amount}}" selector="{{ViewOrderSection.capturedAmountText}}" stepKey="validateCapturedAmount"/>
32+
<see userInput="{{status}}" selector="{{ViewOrderSection.orderStatus}}" stepKey="validateOrderStatus"/>
33+
<click selector="{{ViewOrderSection.invoices}}" stepKey="openInvoices"/>
34+
<waitForPageLoad stepKey="waitForInvoices"/>
35+
<seeElement selector="{{ViewOrderSection.firstInvoice}}" stepKey="seeFirstInvoice"/>
36+
<click selector="{{ViewOrderSection.transactions}}" stepKey="openTransactions"/>
37+
<waitForPageLoad stepKey="waitForTransactions"/>
38+
<see userInput="{{captureStatus}}" selector="{{ViewOrderSection.confirmCapture}}" stepKey="seeCapture"/>
39+
<!-- Enable below line after fix of MC-
40+
<see userInput="{{closedStatus}}" selector="{{ViewOrderSection.confirmClosed}}" stepKey="seeClosed"/>
41+
-->
42+
</actionGroup>
43+
<actionGroup name="ViewAndValidateOrderActionGroupNoSubmit">
44+
<arguments>
45+
<argument name="amount" type="string"/>
46+
<argument name="status" type="string"/>
47+
<argument name="captureStatus" type="string"/>
48+
<argument name="closedStatus" type="string"/>
49+
</arguments>
50+
<amOnPage url="/admin" stepKey="navigateToAdmin"/>
51+
<click selector="{{AdminMenuSection.sales}}" stepKey="clickSales"/>
52+
<waitForPageLoad stepKey="waitForSalesSubsection"/>
53+
<click selector="{{AdminMenuSection.orders}}" stepKey="clickOrders"/>
54+
<waitForPageLoad stepKey="waitForOrdersGrid" time="30"/>
55+
<click selector="{{OrdersGridSection.viewMostRecentOrder}}" stepKey="viewOrder"/>
56+
<waitForPageLoad stepKey="waitForViewOrder"/>
57+
<click selector="{{ViewOrderSection.commentsHistory}}" stepKey="viewCommentsHistory"/>
58+
<waitForPageLoad stepKey="waitForHistoryLoad"/>
59+
<see userInput="{{amount}}" selector="{{ViewOrderSection.capturedAmountTextUnsubmitted}}" stepKey="validateCapturedAmount"/>
60+
<see userInput="{{status}}" selector="{{ViewOrderSection.orderStatus}}" stepKey="validateOrderStatus"/>
61+
<click selector="{{ViewOrderSection.invoices}}" stepKey="openInvoices"/>
62+
<waitForPageLoad stepKey="waitForInvoices"/>
63+
<seeElement selector="{{ViewOrderSection.firstInvoice}}" stepKey="seeFirstInvoice"/>
64+
<click selector="{{ViewOrderSection.transactions}}" stepKey="openTransactions"/>
65+
<waitForPageLoad stepKey="waitForTransactions"/>
66+
<see userInput="{{captureStatus}}" selector="{{ViewOrderSection.confirmCapture}}" stepKey="seeCapture"/>
67+
<!-- Enable below line after fix of MC-
68+
<see userInput="{{closedStatus}}" selector="{{ViewOrderSection.confirmClosed}}" stepKey="seeClosed"/>
69+
-->
70+
</actionGroup>
71+
72+
</actionGroups>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd">
11+
<entity name="SandboxCredentials" type="AuthorizenetAcceptjsCredentials">
12+
<requiredEntity type="api_login_id">SampleTitle</requiredEntity>
13+
<requiredEntity type="transaction_id">SamplePaymentAction</requiredEntity>
14+
<requiredEntity type="public_client_key">SampleEnvironment</requiredEntity>
15+
<requiredEntity type="signature_key">SampleMerchantId</requiredEntity>
16+
</entity>
17+
</entities>
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
11+
<section name="AdminMenuSection">
12+
<element name="dashboard" type="button" selector="#menu-magento-backend-dashboard"/>
13+
<element name="sales" type="button" selector="#menu-magento-sales-sales"/>
14+
<element name="orders" type="button" selector="//span[text()='Orders']"/>
15+
<element name="catalog" type="button" selector="#menu-magento-catalog-catalog"/>
16+
<element name="customers" type="button" selector="#menu-magento-customer-customer"/>
17+
<element name="marketing" type="button" selector="#menu-magento-backend-marketing"/>
18+
<element name="content" type="button" selector="#menu-magento-backend-content"/>
19+
<element name="reports" type="button" selector="#menu-magento-reports-report"/>
20+
<element name="stores" type="button" selector="#menu-magento-backend-stores"/>
21+
<element name="system" type="button" selector="#menu-magento-backend-system"/>
22+
<element name="findPartners" type="button" selector="#menu-magento-marketplace-partners"/>
23+
<element name="currencySetup" type="button" selector="//span[text()='Currency Setup']"/>
24+
25+
</section>
26+
</sections>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
11+
<section name="AuthorizenetAcceptjsConfigurationSection">
12+
<element name="openSectionToggle" type="button" selector="#payment_us_authorizenet_acceptjs-head"/>
13+
<element name="alreadyOpenSectionToggle" type="button" selector="#payment_us_authorizenet_acceptjs-head.open"/>
14+
<element name="apiLoginIdField" type="input" selector="#payment_us_authorizenet_acceptjs_required_login"/>
15+
<element name="transactionKeyField" type="input" selector="#payment_us_authorizenet_acceptjs_required_trans_key"/>
16+
<element name="publicClientKeyField" type="input" selector="#payment_us_authorizenet_acceptjs_required_public_client_key"/>
17+
<element name="signatureKeyField" type="input" selector="#payment_us_authorizenet_acceptjs_required_trans_signature_key"/>
18+
<element name="enabledDefaultCheckbox" type="input" selector="#payment_us_authorizenet_acceptjs_active_inherit"/>
19+
<element name="enabledDefaultSelect" type="select" selector="#payment_us_authorizenet_acceptjs_active"/>
20+
<element name="paymentActionCheckbox" type="input" selector="#payment_us_authorizenet_acceptjs_required_payment_action_inherit"/>
21+
<element name="paymentActionSelect" type="select" selector="#payment_us_authorizenet_acceptjs_required_payment_action"/>
22+
<element name="paymentActionSelectDisabled" type="select" selector="#payment_us_authorizenet_acceptjs_required_payment_action[disabled='disabled']"/>
23+
24+
</section>
25+
</sections>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
11+
<section name="AuthorizenetCheckoutSection">
12+
<element name="selectAuthorizenet" type="button" selector="#authorizenet_acceptjs"/>
13+
<element name="cardInput" type="input" selector="#authorizenet_acceptjs_cc_number"/>
14+
<element name="expMonth" type="select" selector="#authorizenet_acceptjs_expiration"/>
15+
<element name="expYear" type="select" selector="#authorizenet_acceptjs_expiration_yr"/>
16+
<element name="cvv" type="input" selector="#authorizenet_acceptjs_cc_cid"/>
17+
<element name="checkoutButton" type="button" selector="._active button.action.checkout"/>
18+
</section>
19+
</sections>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
11+
<section name="ConfigurationListSection">
12+
<element name="sales" type="button" selector="#system_config_tabs > div:nth-child(4) > div"/>
13+
<element name="salesPaymentMethods" type="button" selector="//span[text()='Payment Methods']"/>
14+
<element name="shippingMethods" type="button" selector="//span[text()='Shipping Methods']"/>
15+
</section>
16+
</sections>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
11+
<section name="ConfigurationMainActionsSection">
12+
<element name="save" type="button" selector="#save"/>
13+
</section>
14+
</sections>
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
11+
<section name="GuestAuthorizenetCheckoutSection">
12+
<element name="firstName" type="input" selector="div[name='billingAddressauthorizenet_acceptjs.firstname'] input"/>
13+
<element name="lastName" type="input" selector="div[name='billingAddressauthorizenet_acceptjs.lastname'] input"/>
14+
<element name="street" type="input" selector="div[name='billingAddressauthorizenet_acceptjs.street.0'] input"/>
15+
<element name="city" type="input" selector="div[name='billingAddressauthorizenet_acceptjs.city'] input"/>
16+
<element name="state" type="select" selector="div[name='billingAddressauthorizenet_acceptjs.region_id'] select"/>
17+
<element name="postcode" type="input" selector="div[name='billingAddressauthorizenet_acceptjs.postcode'] input"/>
18+
<element name="country" type="select" selector="div[name='billingAddressauthorizenet_acceptjs.country_id'] select"/>
19+
<element name="telephone" type="input" selector="div[name='billingAddressauthorizenet_acceptjs.telephone'] input"/>
20+
<element name="update" type="button" selector=".payment-method._active button.action-update" />
21+
</section>
22+
</sections>

0 commit comments

Comments
 (0)