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 $braintreeConfigBlock;
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->braintreeConfigBlock = $this->systemConfigEditSectionPayment->getBraintreeConfigBlock();
102 $this->systemConfigEditSectionPayment->getPaymentsConfigBlock()->expandPaymentSections($this->sections);
103 $this->enableBraintree();
104 $this->disableBraintree();
112 private function enableBraintree()
114 $this->braintreeConfigBlock->clickConfigureButton();
115 $this->braintreeConfigBlock->clearCredentials();
116 $enablers = $this->braintreeConfigBlock->getEnablerFields();
117 $this->assertFieldsAreDisabled->processAssert($this->systemConfigEditSectionPayment, $enablers);
118 $this->braintreeConfigBlock->specifyCredentials();
119 $this->assertFieldsAreActive->processAssert($this->systemConfigEditSectionPayment, $enablers);
120 $this->braintreeConfigBlock->enableBraintree();
121 $this->assertFieldsAreActive->processAssert($this->systemConfigEditSectionPayment, $enablers);
122 $this->systemConfigEditSectionPayment->getPageActions()->save();
123 $this->systemConfigEditSectionPayment->getMessagesBlock()->waitSuccessMessage();
131 private function disableBraintree()
133 $enablers = $this->braintreeConfigBlock->getEnablerFields();
134 $this->braintreeConfigBlock->clickConfigureButton();
135 $this->assertFieldsAreActive->processAssert($this->systemConfigEditSectionPayment, $enablers);
136 $this->assertFieldsAreEnabled->processAssert(
137 $this->systemConfigEditSectionPayment,
138 [$enablers[
'Enable this Solution']]
140 $this->braintreeConfigBlock->disableBraintree();
141 $this->assertFieldsAreActive->processAssert($this->systemConfigEditSectionPayment, $enablers);
142 $this->systemConfigEditSectionPayment->getPageActions()->save();
143 $this->systemConfigEditSectionPayment->getMessagesBlock()->waitSuccessMessage();
__construct(SystemConfigEditSectionPayment $systemConfigEditSectionPayment, AssertFieldsAreDisabled $assertFieldsAreDisabled, AssertFieldsArePresent $assertFieldsArePresent, AssertFieldsAreActive $assertFieldsAreActive, AssertFieldsAreEnabled $assertFieldsAreEnabled, $countryCode, array $sections)