Skip to content
This repository was archived by the owner on Apr 29, 2019. It is now read-only.

Commit 9568a25

Browse files
author
Dmytro Yushkin
committed
MAGETWO-65119: Create/update automated functional tests
- Added constraint into deny payment testcase - Covered cancel and deny flow with integration tests - Added delete customer step to functional test
1 parent d944924 commit 9568a25

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

Test/TestCase/CreateSignifydGuaranteeAndCancelOrderTest.xml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
<data name="signifydAccount/dataset" xsi:type="string">sandbox_default</data>
2828
<data name="signifydData/dataset" xsi:type="string">signifyd_guarantee_approve</data>
2929
<data name="tag" xsi:type="string">test_type:3rd_party_test_single_flow, severity:S1</data>
30-
<constraint name="Magento\Sales\Test\Constraint\AssertOrderCancelSuccessMessage" />
3130
<constraint name="Magento\Sales\Test\Constraint\AssertAuthorizationInCommentsHistory" />
3231
<constraint name="Magento\Sales\Test\Constraint\AssertOrderGrandTotal" />
3332
<constraint name="Magento\Sales\Test\Constraint\AssertOrderStatusIsCanceled" />
@@ -55,7 +54,6 @@
5554
<data name="signifydAccount/dataset" xsi:type="string">sandbox_default</data>
5655
<data name="signifydData/dataset" xsi:type="string">signifyd_guarantee_decline</data>
5756
<data name="tag" xsi:type="string">test_type:3rd_party_test_single_flow, severity:S1</data>
58-
<constraint name="Magento\Sales\Test\Constraint\AssertOrderCancelSuccessMessage" />
5957
<constraint name="Magento\Sales\Test\Constraint\AssertAuthorizationInCommentsHistory" />
6058
<constraint name="Magento\Sales\Test\Constraint\AssertOrderGrandTotal" />
6159
<constraint name="Magento\Sales\Test\Constraint\AssertOrderStatusIsCanceled" />

Test/TestCase/DenyPaymentWithSignifydGuaranteeDeclinedTest.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
<constraint name="Magento\Signifyd\Test\Constraint\AssertSignifydCaseInCommentsHistory" />
3434
<constraint name="Magento\Sales\Test\Constraint\AssertDenyPaymentMessageInCommentsHistory" />
3535
<constraint name="Magento\Sales\Test\Constraint\AssertOrderStatusIsCorrect" />
36+
<constraint name="Magento\Signifyd\Test\Constraint\AssertSignifydGuaranteeCancelInCommentsHistory" />
3637
</variation>
3738
</testCase>
3839
</config>

Test/TestStep/SignifydObserveCaseStep.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
*/
66
namespace Magento\Signifyd\Test\TestStep;
77

8+
use Magento\Customer\Test\TestStep\DeleteCustomerStep;
89
use Magento\Mtf\TestStep\TestStepInterface;
910
use Magento\Signifyd\Test\Constraint\AssertCaseInfoOnSignifydConsole;
1011
use Magento\Signifyd\Test\Fixture\SignifydAddress;
@@ -59,6 +60,13 @@ class SignifydObserveCaseStep implements TestStepInterface
5960
*/
6061
private $signifydCancelOrderStep;
6162

63+
/**
64+
* Delete customer step.
65+
*
66+
* @var DeleteCustomerStep
67+
*/
68+
private $deleteCustomerStep;
69+
6270
/**
6371
* Prices list.
6472
*
@@ -80,6 +88,7 @@ class SignifydObserveCaseStep implements TestStepInterface
8088
* @param SignifydNotifications $signifydNotifications
8189
* @param SignifydData $signifydData
8290
* @param SignifydCancelOrderStep $signifydCancelOrderStep
91+
* @param DeleteCustomerStep $deleteCustomerStep
8392
* @param array $prices
8493
* @param $orderId
8594
*/
@@ -90,6 +99,7 @@ public function __construct(
9099
SignifydNotifications $signifydNotifications,
91100
SignifydData $signifydData,
92101
SignifydCancelOrderStep $signifydCancelOrderStep,
102+
DeleteCustomerStep $deleteCustomerStep,
93103
array $prices,
94104
$orderId
95105
) {
@@ -99,6 +109,7 @@ public function __construct(
99109
$this->signifydNotifications = $signifydNotifications;
100110
$this->signifydData = $signifydData;
101111
$this->signifydCancelOrderStep = $signifydCancelOrderStep;
112+
$this->deleteCustomerStep = $deleteCustomerStep;
102113
$this->prices = $prices;
103114
$this->orderId = $orderId;
104115
}
@@ -126,12 +137,14 @@ public function run()
126137

127138
/**
128139
* Cancel order if test fails, or in the end of variation.
140+
* Cleanup customer for next variations.
129141
*
130142
* @return void
131143
*/
132144
public function cleanup()
133145
{
134146
$this->signifydCancelOrderStep->run();
147+
$this->deleteCustomerStep->run();
135148
}
136149

137150
/**

0 commit comments

Comments
 (0)