File tree Expand file tree Collapse file tree 8 files changed +204
-0
lines changed
dev/tests/functional/tests/app/Magento Expand file tree Collapse file tree 8 files changed +204
-0
lines changed Original file line number Diff line number Diff line change 79
79
</field >
80
80
</dataset >
81
81
82
+ <dataset name =" braintree_advanced_protection" >
83
+ <field name =" payment/braintree_section/braintree/braintree_advanced/fraudprotection" xsi : type =" array" >
84
+ <item name =" scope" xsi : type =" string" >payment</item >
85
+ <item name =" scope_id" xsi : type =" number" >1</item >
86
+ <item name =" label" xsi : type =" string" >Yes</item >
87
+ <item name =" value" xsi : type =" number" >1</item >
88
+ </field >
89
+ </dataset >
90
+
91
+ <dataset name =" braintree_advanced_protection_rollback" >
92
+ <field name =" payment/braintree_section/braintree/braintree_advanced/fraudprotection" xsi : type =" array" >
93
+ <item name =" scope" xsi : type =" string" >payment</item >
94
+ <item name =" scope_id" xsi : type =" number" >1</item >
95
+ <item name =" label" xsi : type =" string" >No</item >
96
+ <item name =" value" xsi : type =" number" >0</item >
97
+ </field >
98
+ </dataset >
99
+
82
100
<dataset name =" braintree_3d_secure_rollback" >
83
101
<field name =" payment/braintree_section/braintree/braintree_3dsecure/verify_3dsecure" xsi : type =" array" >
84
102
<item name =" scope" xsi : type =" string" >payment</item >
Original file line number Diff line number Diff line change 13
13
<field name =" credit_card_exp_year" xsi : type =" string" >2020</field >
14
14
<field name =" cvv" xsi : type =" string" >123</field >
15
15
</dataset >
16
+
16
17
<dataset name =" visa_braintree_3dsecure" >
17
18
<field name =" credit_card_number" xsi : type =" string" >4000000000000002</field >
18
19
<field name =" credit_card_exp_month" xsi : type =" string" >01</field >
19
20
<field name =" credit_card_exp_year" xsi : type =" string" >20</field >
20
21
<field name =" cvv" xsi : type =" string" >123</field >
21
22
</dataset >
23
+
22
24
<dataset name =" visa_braintree_3dsecure_failed" >
23
25
<field name =" credit_card_number" xsi : type =" string" >4000000000000028</field >
24
26
<field name =" credit_card_exp_month" xsi : type =" string" >01</field >
25
27
<field name =" credit_card_exp_year" xsi : type =" string" >2020</field >
26
28
<field name =" cvv" xsi : type =" string" >123</field >
27
29
</dataset >
30
+
31
+ <dataset name =" visa_braintree_fraud_rejected" >
32
+ <field name =" credit_card_number" xsi : type =" string" >4000111111111511</field >
33
+ <field name =" credit_card_exp_month" xsi : type =" string" >01</field >
34
+ <field name =" credit_card_exp_year" xsi : type =" string" >2020</field >
35
+ <field name =" cvv" xsi : type =" string" >123</field >
36
+ </dataset >
28
37
</repository >
29
38
</config >
Original file line number Diff line number Diff line change
1
+ <?xml version =" 1.0" encoding =" utf-8" ?>
2
+ <!--
3
+ /**
4
+ * Copyright © 2016 Magento. All rights reserved.
5
+ * See COPYING.txt for license details.
6
+ */
7
+ -->
8
+ <config xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance" xsi : noNamespaceSchemaLocation =" ../../../../../../vendor/magento/mtf/etc/variations.xsd" >
9
+ <testCase name =" Magento\Checkout\Test\TestCase\OnePageCheckoutDeclinedTest" summary =" Error message during OnePageCheckout" >
10
+ <variation name =" OnePageCheckoutBraintreeDeclinedTestVariation1" summary =" Registered Checkout with Braintree Credit Card from Storefront with Advanced Fraud Protection failed" ticketId =" MAGETWO-46469" >
11
+ <data name =" products/0" xsi : type =" string" >catalogProductSimple::product_10_dollar</data >
12
+ <data name =" customer/dataset" xsi : type =" string" >default</data >
13
+ <data name =" shippingAddress/dataset" xsi : type =" string" >US_address_1_without_email</data >
14
+ <data name =" checkoutMethod" xsi : type =" string" >login</data >
15
+ <data name =" shipping/shipping_service" xsi : type =" string" >Flat Rate</data >
16
+ <data name =" shipping/shipping_method" xsi : type =" string" >Fixed</data >
17
+ <data name =" payment/method" xsi : type =" string" >braintree</data >
18
+ <data name =" creditCardClass" xsi : type =" string" >credit_card_braintree</data >
19
+ <data name =" creditCard/dataset" xsi : type =" string" >visa_braintree_fraud_rejected</data >
20
+ <data name =" configData" xsi : type =" string" >braintree, braintree_advanced_protection</data >
21
+ <data name =" status" xsi : type =" string" >Processing</data >
22
+ <data name =" tag" xsi : type =" string" >test_type:3rd_party_test, severity:S1</data >
23
+ <constraint name =" Magento\Checkout\Test\Constraint\AssertOrderFailedMessage" />
24
+ </variation >
25
+ </testCase >
26
+ </config >
Original file line number Diff line number Diff line change
1
+ <?php
2
+ /**
3
+ * Copyright © 2016 Magento. All rights reserved.
4
+ * See COPYING.txt for license details.
5
+ */
6
+
7
+ namespace Magento \Checkout \Test \Constraint ;
8
+
9
+ use Magento \Checkout \Test \Page \CheckoutOnepage ;
10
+ use Magento \Mtf \Constraint \AbstractConstraint ;
11
+
12
+ /**
13
+ * Assert that error message is correct.
14
+ */
15
+ class AssertOrderFailedMessage extends AbstractConstraint
16
+ {
17
+ /**
18
+ * Error message on checkout.
19
+ */
20
+ const ERROR_MESSAGE = 'Transaction has been declined. Please try again later. ' ;
21
+
22
+ /**
23
+ * Assert that error message is correct.
24
+ *
25
+ * @param CheckoutOnepage $checkoutOnepage
26
+ * @return void
27
+ */
28
+ public function processAssert (CheckoutOnepage $ checkoutOnepage )
29
+ {
30
+ \PHPUnit_Framework_Assert::assertEquals (
31
+ self ::ERROR_MESSAGE ,
32
+ $ checkoutOnepage ->getMessagesBlock ()->getErrorMessage (),
33
+ 'Wrong error message is displayed. '
34
+ );
35
+ }
36
+
37
+ /**
38
+ * Returns string representation of successful assertion.
39
+ *
40
+ * @return string
41
+ */
42
+ public function toString ()
43
+ {
44
+ return 'Error message on Checkout onepage page is correct. ' ;
45
+ }
46
+ }
Original file line number Diff line number Diff line change
1
+ <?php
2
+ /**
3
+ * Copyright © 2016 Magento. All rights reserved.
4
+ * See COPYING.txt for license details.
5
+ */
6
+
7
+ namespace Magento \Checkout \Test \TestCase ;
8
+
9
+ use Magento \Mtf \TestCase \Scenario ;
10
+
11
+ /**
12
+ * Preconditions:
13
+ * 1. Configure payment method.
14
+ * 2. Create products.
15
+ *
16
+ * Steps:
17
+ * 1. Log in Storefront.
18
+ * 2. Add products to the Shopping Cart.
19
+ * 3. Click the 'Proceed to Checkout' button.
20
+ * 4. Fill shipping information.
21
+ * 5. Select shipping method.
22
+ * 6. Select payment method.
23
+ * 7. Click 'Place Order' button.
24
+ * 8. Perform assertions.
25
+ *
26
+ * @group Checkout
27
+ * @ZephyrId MAGETWO-46469
28
+ */
29
+ class OnePageCheckoutDeclinedTest extends Scenario
30
+ {
31
+ /* tags */
32
+ const MVP = 'yes ' ;
33
+ const TEST_TYPE = '3rd_party_test ' ;
34
+ const SEVERITY = 'S1 ' ;
35
+ /* end tags */
36
+
37
+ /**
38
+ * Verifies error message on Onepage Checkout.
39
+ *
40
+ * @return void
41
+ */
42
+ public function test ()
43
+ {
44
+ $ this ->executeScenario ();
45
+ }
46
+ }
Original file line number Diff line number Diff line change
1
+ <?php
2
+ /**
3
+ * Copyright © 2016 Magento. All rights reserved.
4
+ * See COPYING.txt for license details.
5
+ */
6
+
7
+ namespace Magento \Checkout \Test \TestStep ;
8
+
9
+ use Magento \Checkout \Test \Page \CheckoutOnepage ;
10
+ use Magento \Mtf \TestStep \TestStepInterface ;
11
+
12
+ /**
13
+ * Click 'Place order' button.
14
+ */
15
+ class ClickPlaceOrderButtonStep implements TestStepInterface
16
+ {
17
+ /**
18
+ * Onepage checkout page.
19
+ *
20
+ * @var CheckoutOnepage
21
+ */
22
+ private $ checkoutOnepage ;
23
+
24
+ /**
25
+ * @param CheckoutOnepage $checkoutOnepage
26
+ */
27
+ public function __construct (CheckoutOnepage $ checkoutOnepage )
28
+ {
29
+ $ this ->checkoutOnepage = $ checkoutOnepage ;
30
+ }
31
+
32
+ /**
33
+ * Click 'Place order' button.
34
+ *
35
+ * @return array
36
+ */
37
+ public function run ()
38
+ {
39
+ $ this ->checkoutOnepage ->getPaymentBlock ()->getSelectedPaymentMethodBlock ()->clickPlaceOrder ();
40
+ }
41
+ }
Original file line number Diff line number Diff line change 22
22
<argument name =" severity" xsi : type =" string" >S0</argument >
23
23
</arguments >
24
24
</type >
25
+ <type name =" Magento\Checkout\Test\Constraint\AssertOrderFailedMessage" >
26
+ <arguments >
27
+ <argument name =" severity" xsi : type =" string" >S1</argument >
28
+ </arguments >
29
+ </type >
25
30
</config >
Original file line number Diff line number Diff line change 28
28
<step name =" addProductsToTheCart" module =" Magento_Checkout" next =" ProceedToCheckout" />
29
29
<step name =" ProceedToCheckout" module =" Magento_Checkout" />
30
30
</scenario >
31
+ <scenario name =" OnePageCheckoutDeclinedTest" firstStep =" setupConfiguration" >
32
+ <step name =" setupConfiguration" module =" Magento_Config" next =" createProducts" />
33
+ <step name =" createProducts" module =" Magento_Catalog" next =" addProductsToTheCart" />
34
+ <step name =" addProductsToTheCart" module =" Magento_Checkout" next =" proceedToCheckout" />
35
+ <step name =" proceedToCheckout" module =" Magento_Checkout" next =" createCustomer" />
36
+ <step name =" createCustomer" module =" Magento_Customer" next =" selectCheckoutMethod" />
37
+ <step name =" selectCheckoutMethod" module =" Magento_Checkout" next =" fillShippingAddress" />
38
+ <step name =" fillShippingAddress" module =" Magento_Checkout" next =" fillShippingMethod" />
39
+ <step name =" fillShippingMethod" module =" Magento_Checkout" next =" selectPaymentMethod" />
40
+ <step name =" selectPaymentMethod" module =" Magento_Checkout" next =" fillBillingInformation" />
41
+ <step name =" fillBillingInformation" module =" Magento_Checkout" next =" clickPlaceOrderButton" />
42
+ <step name =" clickPlaceOrderButton" module =" Magento_Checkout" />
43
+ </scenario >
31
44
</config >
You can’t perform that action at this time.
0 commit comments