/** * Share wish list. * * @param Customer $customer * @param CatalogProductSimple $product * @param array $sharingInfo * @return void */ public function test(Customer $customer, CatalogProductSimple $product, array $sharingInfo) { //Steps $this->objectManager->create('Magento\\Customer\\Test\\TestStep\\LoginCustomerOnFrontendStep', ['customer' => $customer])->run(); $this->objectManager->create('Magento\\Wishlist\\Test\\TestStep\\AddProductsToWishlistStep', ['products' => [$product]])->run(); $this->wishlistIndex->getMessagesBlock()->waitSuccessMessage(); $this->wishlistIndex->getWishlistBlock()->clickShareWishList(); $this->cmsIndex->getCmsPageBlock()->waitPageInit(); $this->wishlistShare->getSharingInfoForm()->fillForm($sharingInfo); $this->wishlistShare->getSharingInfoForm()->shareWishlist(); }
/** * Share wish list * * @param BrowserInterface $browser * @param Customer $customer * @param CatalogProductSimple $product * @param array $sharingInfo * @return void */ public function test(BrowserInterface $browser, Customer $customer, CatalogProductSimple $product, array $sharingInfo) { //Steps $this->loginCustomer($customer); $browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html'); $this->catalogProductView->getViewBlock()->clickAddToWishlist(); $this->wishlistIndex->getMessagesBlock()->waitSuccessMessage(); $this->wishlistIndex->getWishlistBlock()->clickShareWishList(); $this->cmsIndex->getCmsPageBlock()->waitPageInit(); $this->wishlistShare->getSharingInfoForm()->fillForm($sharingInfo); $this->wishlistShare->getSharingInfoForm()->shareWishlist(); }
/** * Assert that success message appears on My Wish List page after adding product to wishlist. * * @param WishlistIndex $wishlistIndex * @param InjectableFixture $product * @return void */ public function processAssert(WishlistIndex $wishlistIndex, InjectableFixture $product) { \PHPUnit_Framework_Assert::assertEquals(sprintf(self::SUCCESS_MESSAGE, $product->getName()), $wishlistIndex->getMessagesBlock()->getSuccessMessage(), "Expected success message doesn't match actual."); }
/** * Assert that success message is displayed after wishlist has been shared * * @param WishlistIndex $wishlistIndex * @return void */ public function processAssert(WishlistIndex $wishlistIndex) { \PHPUnit_Framework_Assert::assertEquals(self::SUCCESS_MESSAGE, $wishlistIndex->getMessagesBlock()->getSuccessMessages(), 'Wrong success message is displayed.'); }