9 use Magento\Cms\Test\Page\CmsIndex;
11 use Magento\Customer\Test\Fixture\Address;
13 use Magento\Customer\Test\Page\CustomerAccountEdit;
14 use Magento\Customer\Test\Page\CustomerAccountIndex;
15 use Magento\Customer\Test\Page\CustomerAddressEdit;
16 use Magento\Mtf\Fixture\FixtureFactory;
17 use Magento\Mtf\TestCase\Injectable;
41 const TEST_TYPE =
'acceptance_test, extended_acceptance_test';
110 private function prepareCustomer(
112 Customer $initialCustomer
115 return $initialCustomer;
117 $data = array_replace_recursive($initialCustomer->getData(),
$customer->getData());
118 $data[
'group_id'] = [
119 'customerGroup' => $initialCustomer->getDataFieldConfig(
'group_id')[
'source']->getCustomerGroup()
122 return $this->fixtureFactory->createByCode(
'customer', [
'data' =>
$data]);
135 Customer $initialCustomer,
141 $initialCustomer->persist();
144 $this->objectManager->create(
145 \
Magento\Customer\Test\TestStep\LoginCustomerOnFrontendStep::class,
146 [
'customer' => $initialCustomer]
148 $this->customerAccountIndex->getInfoBlock()->openEditContactInfo();
149 $this->customerAccountEdit->getAccountInfoForm()->fill(
$customer);
150 $this->customerAccountEdit->getAccountInfoForm()->submit();
152 \PHPUnit\Framework\Assert::assertThat($this->getName(), $assertCustomerInfoSuccessSavedMessage);
154 $this->cmsIndex->getCmsPageBlock()->waitPageInit();
155 $this->customerAccountIndex->getDashboardAddress()->editBillingAddress();
156 $this->customerAddressEdit->getEditForm()->fill(
$address);
157 $this->customerAddressEdit->getEditForm()->saveAddress();
160 'customer' => $this->prepareCustomer(
$customer, $initialCustomer),
test(Customer $initialCustomer, Customer $customer, Address $address, AssertCustomerInfoSuccessSavedMessage $assertCustomerInfoSuccessSavedMessage)
__inject(CmsIndex $cmsIndex, FixtureFactory $fixtureFactory, CustomerAccountIndex $customerAccountIndex, CustomerAccountEdit $customerAccountEdit, CustomerAddressEdit $customerAddressEdit)