/** * Creation customer from backend. * * @param Customer $customer * @param Address $address * @return void */ public function test(Customer $customer, Address $address) { // Prepare data $address = $address->hasData() ? $address : null; // Steps $this->pageCustomerIndex->open(); $this->pageCustomerIndex->getPageActionsBlock()->addNew(); $this->pageCustomerIndexNew->getCustomerForm()->fillCustomer($customer, $address); $this->pageCustomerIndexNew->getPageActionsBlock()->save(); }