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 $paymentsAdvancedConfigBlock;
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->paymentsAdvancedConfigBlock = $this->systemConfigEditSectionPayment->getPaymentsAdvancedConfigBlock();
102 $this->systemConfigEditSectionPayment->getPaymentsConfigBlock()->expandPaymentSections($this->sections);
103 $this->enablePaymentsAdvanced();
104 $this->disablePaymentsAdvanced();
112 private function enablePaymentsAdvanced()
114 $this->paymentsAdvancedConfigBlock->clickConfigureButton();
115 $this->paymentsAdvancedConfigBlock->clearCredentials();
116 $enablers = $this->paymentsAdvancedConfigBlock->getEnablerFields();
117 $this->assertFieldsAreDisabled->processAssert($this->systemConfigEditSectionPayment, $enablers);
118 $this->paymentsAdvancedConfigBlock->specifyCredentials();
119 $this->assertFieldsAreActive->processAssert(
120 $this->systemConfigEditSectionPayment,
121 [$enablers[
'Enable this Solution']]
123 $this->paymentsAdvancedConfigBlock->enablePaymentsAdvanced();
124 $this->assertFieldsAreActive->processAssert(
125 $this->systemConfigEditSectionPayment,
126 [$enablers[
'Enable this Solution'], $enablers[
'Enable PayPal Credit']]
128 $this->assertFieldsAreEnabled->processAssert(
129 $this->systemConfigEditSectionPayment,
130 [$enablers[
'Enable this Solution'], $enablers[
'Enable PayPal Credit']]
132 $this->systemConfigEditSectionPayment->getPageActions()->save();
133 $this->systemConfigEditSectionPayment->getMessagesBlock()->waitSuccessMessage();
141 private function disablePaymentsAdvanced()
143 $enablers = $this->paymentsAdvancedConfigBlock->getEnablerFields();
144 $this->paymentsAdvancedConfigBlock->clickConfigureButton();
145 $this->assertFieldsAreActive->processAssert($this->systemConfigEditSectionPayment, $enablers);
146 $this->assertFieldsAreEnabled->processAssert($this->systemConfigEditSectionPayment, $enablers);
147 $this->paymentsAdvancedConfigBlock->disablePaymentsAdvanced();
148 $this->assertFieldsAreDisabled->processAssert(
149 $this->systemConfigEditSectionPayment,
150 [$enablers[
'Enable PayPal Credit']]
152 $this->systemConfigEditSectionPayment->getPageActions()->save();
153 $this->systemConfigEditSectionPayment->getMessagesBlock()->waitSuccessMessage();
__construct(SystemConfigEditSectionPayment $systemConfigEditSectionPayment, AssertFieldsAreDisabled $assertFieldsAreDisabled, AssertFieldsArePresent $assertFieldsArePresent, AssertFieldsAreActive $assertFieldsAreActive, AssertFieldsAreEnabled $assertFieldsAreEnabled, $countryCode, array $sections)