9 use Magento\Backend\Test\Page\Adminhtml\SystemConfigEditSectionPayment;
10 use Magento\Mtf\TestStep\TestStepInterface;
26 private $systemConfigEditSectionPayment;
31 private $assertFieldsAreDisabled;
36 private $assertFieldsArePresent;
41 private $assertFieldsAreActive;
46 private $assertFieldsAreEnabled;
65 private $payflowLinkConfigBlock;
77 SystemConfigEditSectionPayment $systemConfigEditSectionPayment,
85 $this->systemConfigEditSectionPayment = $systemConfigEditSectionPayment;
86 $this->assertFieldsAreDisabled = $assertFieldsAreDisabled;
87 $this->assertFieldsArePresent = $assertFieldsArePresent;
88 $this->assertFieldsAreActive = $assertFieldsAreActive;
89 $this->assertFieldsAreEnabled = $assertFieldsAreEnabled;
90 $this->countryCode = $countryCode;
91 $this->sections = $sections;
92 $this->payflowLinkConfigBlock = $this->systemConfigEditSectionPayment->getPayflowLinkConfigBlock();
102 $this->systemConfigEditSectionPayment->getPaymentsConfigBlock()->expandPaymentSections($this->sections);
103 $this->enablePayflowLink();
104 $this->disablePayflowLink();
112 private function enablePayflowLink()
114 $this->payflowLinkConfigBlock->clickConfigureButton();
115 $this->payflowLinkConfigBlock->clearCredentials();
116 $enablers = $this->payflowLinkConfigBlock->getEnablerFields();
117 $this->assertFieldsAreDisabled->processAssert(
118 $this->systemConfigEditSectionPayment,
121 $this->payflowLinkConfigBlock->specifyCredentials();
122 $this->assertFieldsAreActive->processAssert(
123 $this->systemConfigEditSectionPayment,
124 [$enablers[
'Enable Payflow Link']]
126 $this->assertFieldsAreDisabled->processAssert(
127 $this->systemConfigEditSectionPayment,
128 [$enablers[
'Enable Express Checkout'], $enablers[
'Enable PayPal Credit']]
130 $this->payflowLinkConfigBlock->enablePayflowLink();
131 $this->assertFieldsAreActive->processAssert(
132 $this->systemConfigEditSectionPayment,
135 $this->assertFieldsAreEnabled->processAssert(
136 $this->systemConfigEditSectionPayment,
139 $this->systemConfigEditSectionPayment->getPageActions()->save();
140 $this->systemConfigEditSectionPayment->getMessagesBlock()->waitSuccessMessage();
148 private function disablePayflowLink()
150 $enablers = $this->payflowLinkConfigBlock->getEnablerFields();
151 $this->payflowLinkConfigBlock->clickConfigureButton();
152 $this->assertFieldsAreActive->processAssert($this->systemConfigEditSectionPayment, $enablers);
153 $this->assertFieldsAreEnabled->processAssert(
154 $this->systemConfigEditSectionPayment,
157 $this->payflowLinkConfigBlock->disablePayflowLink();
158 $this->assertFieldsAreDisabled->processAssert(
159 $this->systemConfigEditSectionPayment,
160 [$enablers[
'Enable Express Checkout'], $enablers[
'Enable PayPal Credit']]
162 $this->systemConfigEditSectionPayment->getPageActions()->save();
163 $this->systemConfigEditSectionPayment->getMessagesBlock()->waitSuccessMessage();
__construct(SystemConfigEditSectionPayment $systemConfigEditSectionPayment, AssertFieldsAreDisabled $assertFieldsAreDisabled, AssertFieldsArePresent $assertFieldsArePresent, AssertFieldsAreActive $assertFieldsAreActive, AssertFieldsAreEnabled $assertFieldsAreEnabled, $countryCode, array $sections)