コード例 #1
0
 /**
  * Login customer.
  *
  * @return void
  */
 public function run()
 {
     $this->cmsIndex->open();
     $this->cmsIndex->getTopLinksBlock()->openAccount();
     if ($this->cmsIndex->getLinksBlock()->isLinkVisible("Log Out")) {
         $this->cmsIndex->getLinksBlock()->openLink("Log Out");
         $this->cmsIndex->getCmsPageBlock()->waitUntilTextIsVisible('Home Page');
         $this->cmsIndex->getTopLinksBlock()->openAccount();
     }
     $this->cmsIndex->getLinksBlock()->openLink("Log In");
     $this->customerAccountLogin->getLoginBlock()->login($this->customer);
 }
コード例 #2
0
 /**
  * Run create existing customer account on frontend test.
  *
  * @param Customer $customer
  * @return void
  */
 public function test(Customer $customer)
 {
     //Steps
     $this->cmsIndex->open();
     $this->cmsIndex->getTopLinksBlock()->openAccount();
     $this->cmsIndex->getLinksBlock()->openLink('Register');
     $this->customerAccountCreate->getRegisterForm()->registerCustomer($customer);
 }
コード例 #3
0
 /**
  * Assert that the correct option details are displayed on the "View Details" tool tip.
  *
  * @param CmsIndex $cmsIndex
  * @param WishlistIndex $wishlistIndex
  * @param InjectableFixture $product
  * @param FixtureFactory $fixtureFactory
  * @return void
  */
 public function processAssert(CmsIndex $cmsIndex, WishlistIndex $wishlistIndex, InjectableFixture $product, FixtureFactory $fixtureFactory)
 {
     $cmsIndex->getTopLinksBlock()->openAccount();
     $cmsIndex->getLinksBlock()->openLink("My Wishlist");
     $actualOptions = $wishlistIndex->getItemsBlock()->getItemProductBlock($product)->getOptions();
     $cartFixture = $fixtureFactory->createByCode('cart', ['data' => ['items' => ['products' => [$product]]]]);
     $expectedOptions = $this->prepareOptions($cartFixture);
     $errors = $this->verifyData($expectedOptions, $this->sortDataByPath($actualOptions, '::title'));
     \PHPUnit_Framework_Assert::assertEmpty($errors, $errors);
 }
コード例 #4
0
 /**
  * Assert that products are present in custom wishlist.
  *
  * @param CmsIndex $cmsIndex
  * @param Wishlist $multipleWishlist
  * @param WishlistIndex $wishlistIndex
  * @param InjectableFixture[] $products
  * @param int[]|null $qtyToAction
  * @return void
  */
 public function processAssert(CmsIndex $cmsIndex, Wishlist $multipleWishlist, WishlistIndex $wishlistIndex, array $products, $qtyToAction = null)
 {
     $this->wishlistIndex = $wishlistIndex;
     $cmsIndex->getTopLinksBlock()->openAccount();
     $cmsIndex->getLinksBlock()->openLink("My Wishlist");
     $wishlistIndex->getManagementBlock()->selectWishlist($multipleWishlist);
     foreach ($products as $key => $product) {
         $expectedQty = $qtyToAction !== null && isset($qtyToAction[$key]) ? $qtyToAction[$key] : null;
         $this->verifyItemProduct($product, $expectedQty);
     }
 }
コード例 #5
0
 /**
  * Run Change customer password test.
  *
  * @param Customer $initialCustomer
  * @param Customer $customer
  * @return void
  */
 public function test(Customer $initialCustomer, Customer $customer)
 {
     // Preconditions
     $initialCustomer->persist();
     // Steps
     $this->objectManager->create('Mage\\Customer\\Test\\TestStep\\LoginCustomerOnFrontendStep', ['customer' => $initialCustomer])->run();
     $this->cmsIndex->getTopLinksBlock()->openAccount();
     $this->cmsIndex->getLinksBlock()->openLink('My Account');
     $this->customerAccountIndex->getInfoBlock()->openChangePassword();
     $this->customerAccountEdit->getAccountInfoForm()->fill($customer);
     $this->customerAccountEdit->getAccountInfoForm()->submit();
 }
コード例 #6
0
 /**
  * Assert compare products link is NOT visible at the top of page.
  *
  * @param CmsIndex $cmsIndex
  * @return void
  */
 public function processAssert(CmsIndex $cmsIndex)
 {
     \PHPUnit_Framework_Assert::assertFalse($cmsIndex->getLinksBlock()->isLinkVisible("Compare Products"), 'The link "Compare Products..." is visible at the top of page.');
 }
コード例 #7
0
 /**
  * Assert that product is present in default wishlist.
  *
  * @param CmsIndex $cmsIndex
  * @param WishlistIndex $wishlistIndex
  * @param InjectableFixture $product
  * @return void
  */
 public function processAssert(CmsIndex $cmsIndex, WishlistIndex $wishlistIndex, InjectableFixture $product)
 {
     $cmsIndex->getTopLinksBlock()->openAccount();
     $cmsIndex->getLinksBlock()->openLink("My Wishlist");
     \PHPUnit_Framework_Assert::assertTrue($wishlistIndex->getItemsBlock()->getItemProductBlock($product)->isVisible(), $product->getName() . ' is not visible on wishlist page.');
 }