Skip to content

Commit 85728ed

Browse files
committed
MC-17753: Authorize.net Cannot read property 'length' of null
1 parent 5409b1f commit 85728ed

5 files changed

+69
-25
lines changed

app/code/Magento/AuthorizenetAcceptjs/Test/Mftf/ActionGroup/ConfigureAuthorizenetAcceptjsActionGroup.xml

Lines changed: 28 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -7,40 +7,43 @@
77
-->
88
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
99
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10-
<actionGroup name="ConfigureAuthorizenetAcceptjs">
10+
<actionGroup name="ConfigureAuthorizenetAcceptjs" extends="EnableAuthorizenetAcceptjs">
1111
<arguments>
1212
<argument name="paymentAction" type="string"/>
1313
</arguments>
14-
<!-- Navigate to configuration -->
15-
<waitForPageLoad stepKey="waitForStores"/>
16-
<click stepKey="clickOnStores" selector="{{AdminMenuSection.stores}}"/>
17-
<waitForPageLoad stepKey="waitForConfiguration"/>
18-
<click stepKey="clickOnConfiguration" selector="{{StoresSubmenuSection.configuration}}"/>
19-
<waitForPageLoad stepKey="waitForSales"/>
20-
<waitForElementVisible stepKey="waitForVisibleHack" selector="{{AdminMenuSection.currencySetup}}"/>
21-
<scrollTo stepKey="scrollToSales" selector="{{StoresConfigurationListSection.sales}}"/>
22-
<click stepKey="clickOnSales" selector="{{StoresConfigurationListSection.sales}}" />
23-
<waitForPageLoad stepKey="waitForPaymentMethods"/>
24-
<click stepKey="clickOnPaymentMethods" selector="{{StoresConfigurationListSection.salesPaymentMethods}}" />
25-
<waitForPageLoad stepKey="waitForOpenConfiguration"/>
26-
<scrollTo stepKey="scrollToOpenConfig" selector="{{AuthorizenetAcceptjsConfigurationSection.openSectionToggle}}"/>
27-
<conditionalClick stepKey="openConfiguration" selector="{{AuthorizenetAcceptjsConfigurationSection.openSectionToggle}}" dependentSelector="{{AuthorizenetAcceptjsConfigurationSection.alreadyOpenSectionToggle}}" visible="false"/>
28-
2914
<!-- Fill Auth.net fields and save -->
30-
<waitForPageLoad stepKey="waitToFillApiLogin"/>
15+
<waitForElementVisible selector="{{AuthorizenetAcceptjsConfigurationSection.paymentActionCheckbox}}" stepKey="waitForFormVisible"/>
3116
<conditionalClick selector="{{AuthorizenetAcceptjsConfigurationSection.paymentActionCheckbox}}" stepKey="uncheckPaymentActionDefault" dependentSelector="{{AuthorizenetAcceptjsConfigurationSection.paymentActionSelectDisabled}}" visible="true"/>
3217
<selectOption selector="{{AuthorizenetAcceptjsConfigurationSection.paymentActionSelect}}" stepKey="selectPaymentAction" userInput="{{paymentAction}}"/>
33-
<scrollTo stepKey="scrollToApiLoginId" selector="{{AuthorizenetAcceptjsConfigurationSection.apiLoginIdField}}"/>
34-
<fillField stepKey="fillApiLoginId" selector="{{AuthorizenetAcceptjsConfigurationSection.apiLoginIdField}}" userInput="{{_CREDS.authorizenet_acceptjs_api_login_id}}"/>
35-
<fillField stepKey="fillTransactionKey" selector="{{AuthorizenetAcceptjsConfigurationSection.transactionKeyField}}" userInput="{{_CREDS.authorizenet_acceptjs_transaction_key}}"/>
36-
<fillField stepKey="fillPublicClientKey" selector="{{AuthorizenetAcceptjsConfigurationSection.publicClientKeyField}}" userInput="{{_CREDS.authorizenet_acceptjs_public_client_key}}"/>
37-
<fillField stepKey="fillSignatureKey" selector="{{AuthorizenetAcceptjsConfigurationSection.signatureKeyField}}" userInput="{{_CREDS.authorizenet_acceptjs_signature_key}}"/>
38-
<uncheckOption stepKey="uncheckCheckbox" selector="{{AuthorizenetAcceptjsConfigurationSection.enabledDefaultCheckbox}}"/>
39-
<selectOption stepKey="fillExpYear" selector="{{AuthorizenetAcceptjsConfigurationSection.enabledDefaultSelect}}" userInput="Yes"/>
40-
<click stepKey="clickOnSave" selector="{{ConfigurationMainActionsSection.save}}" />
18+
<scrollTo selector="{{AuthorizenetAcceptjsConfigurationSection.apiLoginIdField}}" stepKey="scrollToApiLoginId"/>
19+
<fillField selector="{{AuthorizenetAcceptjsConfigurationSection.apiLoginIdField}}" userInput="{{_CREDS.authorizenet_acceptjs_api_login_id}}" stepKey="fillApiLoginId"/>
20+
<fillField selector="{{AuthorizenetAcceptjsConfigurationSection.transactionKeyField}}" userInput="{{_CREDS.authorizenet_acceptjs_transaction_key}}" stepKey="fillTransactionKey"/>
21+
<fillField selector="{{AuthorizenetAcceptjsConfigurationSection.publicClientKeyField}}" userInput="{{_CREDS.authorizenet_acceptjs_public_client_key}}" stepKey="fillPublicClientKey"/>
22+
<fillField selector="{{AuthorizenetAcceptjsConfigurationSection.signatureKeyField}}" userInput="{{_CREDS.authorizenet_acceptjs_signature_key}}" stepKey="fillSignatureKey"/>
4123
</actionGroup>
4224

4325
<actionGroup name="DisableAuthorizenetAcceptjs">
4426
<magentoCLI stepKey="disableAuthorizenetAcceptjs" command="config:set payment/authorizenet_acceptjs/active 0"/>
4527
</actionGroup>
28+
29+
<actionGroup name="EnableAuthorizenetAcceptjs">
30+
<scrollTo selector="{{AuthorizenetAcceptjsConfigurationSection.openSectionToggle}}" stepKey="scrollToAuthorizeNetConfigSection"/>
31+
<conditionalClick selector="{{AuthorizenetAcceptjsConfigurationSection.openSectionToggle}}" dependentSelector="{{AuthorizenetAcceptjsConfigurationSection.enabledDefaultSelect}}" visible="false" stepKey="openConfigSection"/>
32+
<waitForElementVisible selector="{{AuthorizenetAcceptjsConfigurationSection.enabledDefaultSelect}}" stepKey="waitForEnableFieldVisible"/>
33+
<uncheckOption selector="{{AuthorizenetAcceptjsConfigurationSection.enabledDefaultCheckbox}}" stepKey="uncheckCheckbox"/>
34+
<selectOption selector="{{AuthorizenetAcceptjsConfigurationSection.enabledDefaultSelect}}" userInput="Yes" stepKey="enablePayment"/>
35+
</actionGroup>
36+
37+
<actionGroup name="AssertAuthorizenetAcceptjsRequiredFieldsValidationArePresentOnSave">
38+
<scrollToTopOfPage stepKey="scrollToTop"/>
39+
<click selector="{{AdminMainActionsSection.save}}" stepKey="clickSave"/>
40+
<scrollTo selector="{{AuthorizenetAcceptjsConfigurationSection.apiLoginIdField}}" stepKey="scrollToApiLoginIdField"/>
41+
<seeElement selector="{{AuthorizenetAcceptjsConfigurationSection.apiLoginIdFieldRequiredMessage}}" stepKey="seeApiLoginIdRequiredErrorMessage"/>
42+
<scrollTo selector="{{AuthorizenetAcceptjsConfigurationSection.publicClientKeyField}}" stepKey="scrollToPublicClientKeyField"/>
43+
<seeElement selector="{{AuthorizenetAcceptjsConfigurationSection.publicClientKeyFieldRequiredMessage}}" stepKey="seePublicClientKeyRequiredErrorMessage"/>
44+
<scrollTo selector="{{AuthorizenetAcceptjsConfigurationSection.transactionKeyField}}" stepKey="scrollTransactionKeyField"/>
45+
<seeElement selector="{{AuthorizenetAcceptjsConfigurationSection.transactionKeyFieldRequiredMessage}}" stepKey="seeTransactionKeyRequiredErrorMessage"/>
46+
<scrollTo selector="{{AuthorizenetAcceptjsConfigurationSection.signatureKeyField}}" stepKey="scrollToSignatureKeyField"/>
47+
<seeElement selector="{{AuthorizenetAcceptjsConfigurationSection.signatureKeyFieldRequiredMessage}}" stepKey="seeSignatureKeyRequiredErrorMessage"/>
48+
</actionGroup>
4649
</actionGroups>

app/code/Magento/AuthorizenetAcceptjs/Test/Mftf/Section/AuthorizenetAcceptjsConfigurationSection.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,9 @@
2020
<element name="paymentActionCheckbox" type="input" selector="#payment_us_authorizenet_acceptjs_required_payment_action_inherit"/>
2121
<element name="paymentActionSelect" type="select" selector="#payment_us_authorizenet_acceptjs_required_payment_action"/>
2222
<element name="paymentActionSelectDisabled" type="select" selector="#payment_us_authorizenet_acceptjs_required_payment_action[disabled='disabled']"/>
23+
<element name="apiLoginIdFieldRequiredMessage" type="text" selector="//input[@name='groups[authorizenet_acceptjs][groups][required][fields][login][value]']/../label[contains(.,'This is a required field.')]"/>
24+
<element name="publicClientKeyFieldRequiredMessage" type="text" selector="//input[@name='groups[authorizenet_acceptjs][groups][required][fields][public_client_key][value]']/../label[contains(.,'This is a required field.')]"/>
25+
<element name="transactionKeyFieldRequiredMessage" type="text" selector="//input[@name='groups[authorizenet_acceptjs][groups][required][fields][trans_key][value]']/../label[contains(.,'This is a required field.')]"/>
26+
<element name="signatureKeyFieldRequiredMessage" type="text" selector="//input[@name='groups[authorizenet_acceptjs][groups][required][fields][trans_signature_key][value]']/../label[contains(.,'This is a required field.')]"/>
2327
</section>
2428
</sections>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
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+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
11+
<test name="ConfigureAuthorizenetAcceptjsWithoutRequiredOptionsTest">
12+
<annotations>
13+
<stories value="Authorize.net Accept.js"/>
14+
<title value="Unable to configure Authorize.net Accept.js without required options"/>
15+
<description value="Unable to configure Authorize.net Accept.js without required options"/>
16+
<severity value="CRITICAL"/>
17+
<testCaseId value="MC-17805"/>
18+
<useCaseId value="MC-17753"/>
19+
<group value="AuthorizenetAcceptjs"/>
20+
</annotations>
21+
<before>
22+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
23+
</before>
24+
<after>
25+
<actionGroup ref="logout" stepKey="logout"/>
26+
</after>
27+
<amOnPage url="{{AdminConfigPaymentMethodsPage.url}}" stepKey="navigateToPaymentConfigurationPage"/>
28+
<actionGroup ref="EnableAuthorizenetAcceptjs" stepKey="enableAuthorizenetAcceptjs"/>
29+
<actionGroup ref="AssertAuthorizenetAcceptjsRequiredFieldsValidationArePresentOnSave" stepKey="assertErrorMessages"/>
30+
</test>
31+
</tests>

app/code/Magento/AuthorizenetAcceptjs/Test/Mftf/Test/FullCaptureAuthorizenetAcceptjsTest.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,12 @@
3131
</createData>
3232

3333
<!--Configure Auth.net-->
34+
<amOnPage url="{{AdminConfigPaymentMethodsPage.url}}" stepKey="navigateToPaymentConfigurationPage"/>
35+
<actionGroup ref="EnableAuthorizenetAcceptjs" stepKey="enableAuthorizenetAcceptjs"/>
3436
<actionGroup ref="ConfigureAuthorizenetAcceptjs" stepKey="configureAuthorizenetAcceptjs">
3537
<argument name="paymentAction" value="Authorize Only"/>
3638
</actionGroup>
39+
<actionGroup ref="AdminSaveConfigActionGroup" stepKey="saveConfig"/>
3740

3841
</before>
3942
<after>

app/code/Magento/AuthorizenetAcceptjs/Test/Mftf/Test/GuestCheckoutVirtualProductAuthorizenetAcceptjsTest.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,12 @@
3636
<actionGroup ref="saveProductForm" stepKey="saveProductForm"/>
3737

3838
<!--Configure Auth.net-->
39+
<amOnPage url="{{AdminConfigPaymentMethodsPage.url}}" stepKey="navigateToPaymentConfigurationPage"/>
40+
<actionGroup ref="EnableAuthorizenetAcceptjs" stepKey="enableAuthorizenetAcceptjs"/>
3941
<actionGroup ref="ConfigureAuthorizenetAcceptjs" stepKey="configureAuthorizenetAcceptjs">
4042
<argument name="paymentAction" value="Authorize and Capture"/>
4143
</actionGroup>
44+
<actionGroup ref="AdminSaveConfigActionGroup" stepKey="saveConfig"/>
4245

4346
</before>
4447
<after>

0 commit comments

Comments
 (0)