/** * Assert that created gift registry type can be found on frontend. * * @param Customer $customer * @param GiftRegistryType $giftRegistryType * @param CustomerAccountIndex $customerAccountIndex * @param GiftRegistryIndex $giftRegistryIndex * @param GiftRegistryAddSelect $giftRegistryAddSelect * @return void */ public function processAssert(Customer $customer, GiftRegistryType $giftRegistryType, CustomerAccountIndex $customerAccountIndex, GiftRegistryIndex $giftRegistryIndex, GiftRegistryAddSelect $giftRegistryAddSelect) { $this->objectManager->create('Mage\\Customer\\Test\\TestStep\\LoginCustomerOnFrontendStep', ['customer' => $customer])->run(); $customerAccountIndex->getAccountNavigationBlock()->openNavigationItem("Gift Registry"); $giftRegistryIndex->getGiftRegistryList()->addNew(); \PHPUnit_Framework_Assert::assertTrue($giftRegistryAddSelect->getGiftRegistryEditForm()->isGiftRegistryVisible($giftRegistryType), "Gift registry '{$giftRegistryType->getLabel()}' is not present on frontend."); }
/** * Create gift registry entity test. * * @param GiftRegistry $giftRegistry * @param Customer $customer * @return void */ public function test(GiftRegistry $giftRegistry, Customer $customer) { // Steps $this->objectManager->create('Mage\\Customer\\Test\\TestStep\\LoginCustomerOnFrontendStep', ['customer' => $customer])->run(); $this->customerAccountIndex->getAccountNavigationBlock()->openNavigationItem("Gift Registry"); $this->giftRegistryIndex->getGiftRegistryList()->addNew(); $this->giftRegistryAddSelect->getGiftRegistryEditForm()->selectGiftRegistryType($giftRegistry->getTypeId()); $this->giftRegistryEdit->getGiftRegistryEditForm()->fill($giftRegistry); $this->giftRegistryEdit->getGiftRegistryEditForm()->save(); }