/** * Delete Customer Group * * @param CustomerGroup $customerGroup * @return void */ public function test(CustomerGroup $customerGroup) { // Precondition $customerGroup->persist(); // Steps $filter = ['code' => $customerGroup->getCustomerGroupCode()]; $this->customerGroupIndex->open(); $this->customerGroupIndex->getCustomerGroupGrid()->searchAndOpen($filter); $this->customerGroupNew->getPageMainActions()->delete(); $this->customerGroupNew->getModalBlock()->acceptAlert(); }
/** * Delete Customer Group. * * @param CustomerGroup $customerGroup * @param Customer $customer [optional] * @return array */ public function test(CustomerGroup $customerGroup, Customer $customer = null) { // Precondition if ($customer !== null) { $customer->persist(); $customerGroup = $customer->getDataFieldConfig('group_id')['source']->getCustomerGroup(); } else { $customerGroup->persist(); } // Steps $filter = ['code' => $customerGroup->getCustomerGroupCode()]; $this->customerGroupIndex->open(); $this->customerGroupIndex->getCustomerGroupGrid()->searchAndOpen($filter); $this->customerGroupNew->getPageMainActions()->delete(); $this->customerGroupNew->getModalBlock()->acceptAlert(); return ['customer' => $customer, 'customerGroup' => $customerGroup]; }