/** * 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."); }
/** * Assert that gift registry data on edit page equals passed from fixture. * * @param GiftRegistryIndex $giftRegistryIndex * @param GiftRegistryEdit $giftRegistryEdit * @param GiftRegistry $giftRegistry * @return void */ public function processAssert(GiftRegistryIndex $giftRegistryIndex, GiftRegistryEdit $giftRegistryEdit, GiftRegistry $giftRegistry) { $giftRegistryIndex->open(); $fixtureData = $giftRegistry->getData(); $giftRegistryIndex->getGiftRegistryList()->eventAction($fixtureData['title'], 'Edit'); $formData = $giftRegistryEdit->getGiftRegistryEditForm()->getData(); $errors = $this->verifyData($fixtureData, $formData); \PHPUnit_Framework_Assert::assertEmpty($errors, $errors); }
/** * 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(); }