9 use Magento\Checkout\Test\Page\CheckoutOnepage;
10 use Magento\Customer\Test\Fixture\Address;
11 use Magento\Mtf\TestStep\TestStepInterface;
14 use Magento\Mtf\ObjectManager;
68 private $billingAddressCustomer;
75 private $editBillingInformation;
104 $billingAddressCustomer =
null,
105 $editBillingInformation =
true 114 $this->billingAddressCustomer = $billingAddressCustomer;
115 $this->editBillingInformation = $editBillingInformation;
126 if ($this->billingCheckboxState) {
127 $this->assertBillingAddressCheckbox->processAssert($this->checkoutOnepage, $this->billingCheckboxState);
129 if ($this->billingCheckboxState ===
'Yes' && !$this->editBillingInformation) {
134 if ($this->billingAddress) {
135 $selectedPaymentMethod = $this->checkoutOnepage->getPaymentBlock()->getSelectedPaymentMethodBlock();
136 if ($this->shippingAddress) {
137 $selectedPaymentMethod->getBillingBlock()->unsetSameAsShippingCheckboxValue();
139 $selectedPaymentMethod->getBillingBlock()->fillBilling($this->billingAddress);
142 if (isset($this->billingAddressCustomer[
'added'])) {
143 $addressIndex = $this->billingAddressCustomer[
'added'];
144 $billingAddress = $this->customer->getDataFieldConfig(
'address')[
'source']->getAddresses()[$addressIndex];
145 $address = $this->objectManager->create(
149 $selectedPaymentMethod = $this->checkoutOnepage->getPaymentBlock()->getSelectedPaymentMethodBlock();
150 $selectedPaymentMethod->getBillingBlock()->unsetSameAsShippingCheckboxValue();
151 $this->checkoutOnepage->getCustomAddressBlock()->selectAddress(
$address);
152 $selectedPaymentMethod->getBillingBlock()->clickUpdate();