/**
  * Assert order is not visible in customer account on frontend
  *
  * @param OrderInjectable $order
  * @param Customer $customer
  * @param CustomerAccountIndex $customerAccountIndex
  * @param OrderHistory $orderHistory
  * @param string $status
  * @return void
  */
 public function processAssert(OrderInjectable $order, Customer $customer, CustomerAccountIndex $customerAccountIndex, OrderHistory $orderHistory, $status)
 {
     $filter = ['id' => $order->getId(), 'status' => $status];
     $this->objectManager->create('Magento\\Customer\\Test\\TestStep\\LoginCustomerOnFrontendStep', ['customer' => $customer])->run();
     $customerAccountIndex->getAccountMenuBlock()->openMenuItem('My Orders');
     \PHPUnit_Framework_Assert::assertFalse($orderHistory->getOrderHistoryBlock()->isVisible() && $orderHistory->getOrderHistoryBlock()->isOrderVisible($filter), 'Order with following data \'' . implode(', ', $filter) . '\' is present in Orders block on frontend.');
 }
 /**
  * Asserts that Default Billing Address and Default Shipping Address equal to data from fixture.
  *
  * @param CustomerAccountIndex $customerAccountIndex
  * @param CustomerAccountAddress $customerAccountAddress
  * @param Address $address
  * @return void
  */
 public function processAssert(CustomerAccountIndex $customerAccountIndex, CustomerAccountAddress $customerAccountAddress, Address $address)
 {
     $customerAccountIndex->getAccountMenuBlock()->openMenuItem('Address Book');
     $addressRenderer = $this->objectManager->create(\Magento\Customer\Test\Block\Address\Renderer::class, ['address' => $address, 'type' => 'html']);
     $addressToVerify = $addressRenderer->render();
     \PHPUnit_Framework_Assert::assertTrue($addressToVerify == $customerAccountAddress->getDefaultAddressBlock()->getDefaultBillingAddress() && $addressToVerify == $customerAccountAddress->getDefaultAddressBlock()->getDefaultShippingAddress(), 'Customer default address on address book tab is not matching the fixture.');
 }
 /**
  * Asserts that Asserts that 'Additional Address Entries' contains expected message
  *
  * @param CustomerAccountIndex $customerAccountIndex
  * @return void
  */
 public function processAssert(CustomerAccountIndex $customerAccountIndex)
 {
     $customerAccountIndex->open();
     $customerAccountIndex->getAccountMenuBlock()->openMenuItem('Address Book');
     $actualText = $customerAccountIndex->getAdditionalAddressBlock()->getBlockText();
     \PHPUnit_Framework_Assert::assertTrue(self::EXPECTED_MESSAGE == $actualText, 'Expected text is absent in Additional Address block.');
 }
 /**
  * Assert that order is present in Orders grid on frontend.
  *
  * @param OrderInjectable $order
  * @param Customer $customer
  * @param ObjectManager $objectManager
  * @param CustomerAccountIndex $customerAccountIndex
  * @param OrderHistory $orderHistory
  * @param string $status
  * @param string $orderId
  * @param string|null $statusToCheck
  * @return void
  */
 public function processAssert(OrderInjectable $order, Customer $customer, ObjectManager $objectManager, CustomerAccountIndex $customerAccountIndex, OrderHistory $orderHistory, $status, $orderId = '', $statusToCheck = null)
 {
     $filter = ['id' => $order->hasData('id') ? $order->getId() : $orderId, 'status' => $statusToCheck === null ? $status : $statusToCheck];
     $objectManager->create('Magento\\Customer\\Test\\TestStep\\LoginCustomerOnFrontendStep', ['customer' => $customer])->run();
     $customerAccountIndex->getAccountMenuBlock()->openMenuItem('My Orders');
     $errorMessage = implode(', ', $filter);
     \PHPUnit_Framework_Assert::assertTrue($orderHistory->getOrderHistoryBlock()->isOrderVisible($filter), 'Order with following data \'' . $errorMessage . '\' is absent in Orders block on frontend.');
 }
 /**
  * Login customer and open Order page.
  *
  * @param Customer $customer
  * @return void
  */
 protected function loginCustomerAndOpenOrderPage(Customer $customer)
 {
     $this->cmsIndex->open();
     $loginCustomerOnFrontendStep = $this->objectManager->create('Magento\\Customer\\Test\\TestStep\\LoginCustomerOnFrontendStep', ['customer' => $customer]);
     $loginCustomerOnFrontendStep->run();
     $this->cmsIndex->getLinksBlock()->openLink('My Account');
     $this->customerAccountIndex->getAccountMenuBlock()->openMenuItem('My Orders');
 }
Exemplo n.º 6
0
 /**
  * Create Customer account on Storefront.
  *
  * @param Customer $customer
  * @param CustomerAccountIndex $customerAccountIndex
  */
 public function test(Customer $customer, CustomerAccountIndex $customerAccountIndex)
 {
     // Steps
     $this->objectManager->create('Magento\\Customer\\Test\\TestStep\\LoginCustomerOnFrontendStep', ['customer' => $customer])->run();
     $customerAccountIndex->getAccountMenuBlock()->openMenuItem('Account Information');
     $customerAccountIndex->getAccountMenuBlock()->openMenuItem('Address Book');
     $customerAccountIndex->getAccountMenuBlock()->openMenuItem('My Orders');
     $customerAccountIndex->getAccountMenuBlock()->openMenuItem('My Wish List');
 }
 /**
  * Assert that product is not present in Wishlist on Frontend.
  *
  * @param CustomerAccountIndex $customerAccountIndex
  * @param WishlistIndex $wishlistIndex
  * @param InjectableFixture[] $products
  * @param Customer $customer
  * @return void
  */
 public function processAssert(CustomerAccountIndex $customerAccountIndex, WishlistIndex $wishlistIndex, $products, Customer $customer)
 {
     $this->objectManager->create('Magento\\Customer\\Test\\TestStep\\LoginCustomerOnFrontendStep', ['customer' => $customer])->run();
     $customerAccountIndex->open()->getAccountMenuBlock()->openMenuItem("My Wish List");
     $itemBlock = $wishlistIndex->getWishlistBlock()->getProductItemsBlock();
     foreach ($products as $itemProduct) {
         \PHPUnit_Framework_Assert::assertFalse($itemBlock->getItemProduct($itemProduct)->isVisible(), 'Product \'' . $itemProduct->getName() . '\' is present in Wish List on Frontend.');
     }
 }
 /**
  * Assert that product is not present in Wishlist on Frontend
  *
  * @param CustomerAccountIndex $customerAccountIndex
  * @param WishlistIndex $wishlistIndex
  * @param InjectableFixture $product
  * @param CustomerInjectable $customer
  * @param CmsIndex $cmsIndex
  * @param CustomerAccountLogin $customerAccountLogin
  * @param CustomerAccountLogout $customerAccountLogout
  * @return void
  */
 public function processAssert(CustomerAccountIndex $customerAccountIndex, WishlistIndex $wishlistIndex, InjectableFixture $product, CustomerInjectable $customer, CmsIndex $cmsIndex, CustomerAccountLogin $customerAccountLogin, CustomerAccountLogout $customerAccountLogout)
 {
     $productName = $product->getName();
     $customerAccountLogout->open();
     $cmsIndex->getLinksBlock()->openLink('Log In');
     $customerAccountLogin->getLoginBlock()->login($customer);
     $customerAccountIndex->open()->getAccountMenuBlock()->openMenuItem("My Wish List");
     \PHPUnit_Framework_Assert::assertFalse($wishlistIndex->getWishlistBlock()->getProductItemsBlock()->isProductPresent($productName), 'Product \'' . $productName . '\' is present in Wishlist on Frontend.');
 }
 /**
  * Assert that customer success log out.
  *
  * @param CustomerAccountIndex $customerAccountIndex
  * @param CmsIndex $cmsIndex
  * @return void
  */
 public function processAssert(CustomerAccountIndex $customerAccountIndex, CmsIndex $cmsIndex)
 {
     $customerAccountIndex->open();
     $cmsIndex->getCmsPageBlock()->waitPageInit();
     $cmsIndex->getLinksBlock()->openLink('Sign Out');
     $cmsIndex->getCmsPageBlock()->waitUntilTextIsVisible(self::LOGOUT_PAGE_TITLE);
     $cmsIndex->getCmsPageBlock()->waitUntilTextIsVisible(self::HOME_PAGE_TITLE);
     $cmsIndex->getCmsPageBlock()->waitPageInit();
     \PHPUnit_Framework_Assert::assertTrue($cmsIndex->getLinksBlock()->isLinkVisible('Sign In'), "Customer wasn't logged out.");
 }
 /**
  * Logout customer.
  *
  * @return void
  */
 public function run()
 {
     $this->customerAccount->open();
     $this->cmsIndex->getCmsPageBlock()->waitPageInit();
     if ($this->cmsIndex->getTitleBlock()->getTitle() != 'Customer Login') {
         $this->cmsIndex->getLinksBlock()->openLink('Sign Out');
         $this->cmsIndex->getCmsPageBlock()->waitUntilTextIsVisible('Home Page');
         $this->cmsIndex->getCmsPageBlock()->waitPageInit();
     }
 }
 /**
  * Assert the product is not displayed on Compare Products block on my account page
  *
  * @param CmsIndex $cmsIndex
  * @param CustomerAccountIndex $customerAccountIndex
  * @param int $countProducts [optional]
  * @param FixtureInterface $product [optional]
  * @return void
  */
 public function processAssert(CmsIndex $cmsIndex, CustomerAccountIndex $customerAccountIndex, $countProducts = 0, FixtureInterface $product = null)
 {
     $cmsIndex->open();
     $cmsIndex->getLinksBlock()->openLink("My Account");
     $compareBlock = $customerAccountIndex->getCompareProductsBlock();
     if ($countProducts > 1 && $product !== null) {
         \PHPUnit_Framework_Assert::assertFalse($compareBlock->isProductVisibleInCompareBlock($product->getName()), 'The product displays on Compare Products block on my account page.');
     } else {
         \PHPUnit_Framework_Assert::assertEquals(self::SUCCESS_MESSAGE, $compareBlock->getEmptyMessage(), 'The product displays on Compare Products block on my account page.');
     }
 }
 /**
  * Asserts that Default Billing Address and Default Shipping Address equal to data from fixture
  *
  * @param CustomerAccountIndex $customerAccountIndex
  * @param AddressInjectable $address
  * @return void
  */
 public function processAssert(CustomerAccountIndex $customerAccountIndex, AddressInjectable $address)
 {
     $customerAccountIndex->getAccountMenuBlock()->openMenuItem('Account Dashboard');
     $defaultBillingAddress = explode("\n", $customerAccountIndex->getDashboardAddress()->getDefaultBillingAddressText());
     $defaultShippingAddress = explode("\n", $customerAccountIndex->getDashboardAddress()->getDefaultShippingAddressText());
     $pattern = $this->makeAddressPattern($address);
     $billingDataDiff = $this->verifyForm($pattern, $defaultBillingAddress);
     $shippingDataDiff = $this->verifyForm($pattern, $defaultShippingAddress);
     $dataDiff = array_merge($billingDataDiff, $shippingDataDiff);
     \PHPUnit_Framework_Assert::assertEmpty($dataDiff, 'Billing or shipping form was filled incorrectly.' . "\nLog:\n" . implode(";\n", $dataDiff));
 }
 /**
  * Assert that product is not present in Wishlist on Frontend
  *
  * @param CustomerAccountIndex $customerAccountIndex
  * @param WishlistIndex $wishlistIndex
  * @param InjectableFixture[] $products
  * @param Customer $customer
  * @param CmsIndex $cmsIndex
  * @param CustomerAccountLogin $customerAccountLogin
  * @param CustomerAccountLogout $customerAccountLogout
  * @return void
  */
 public function processAssert(CustomerAccountIndex $customerAccountIndex, WishlistIndex $wishlistIndex, $products, Customer $customer, CmsIndex $cmsIndex, CustomerAccountLogin $customerAccountLogin, CustomerAccountLogout $customerAccountLogout)
 {
     $customerAccountLogout->open();
     $cmsIndex->getLinksBlock()->openLink('Log In');
     $customerAccountLogin->getLoginBlock()->login($customer);
     $customerAccountIndex->open()->getAccountMenuBlock()->openMenuItem("My Wish List");
     $itemBlock = $wishlistIndex->getWishlistBlock()->getProductItemsBlock();
     foreach ($products as $itemProduct) {
         \PHPUnit_Framework_Assert::assertFalse($itemBlock->getItemProduct($itemProduct)->isVisible(), 'Product \'' . $itemProduct->getName() . '\' is present in Wishlist on Frontend.');
     }
 }
 /**
  * Runs Delete Customer Address test.
  *
  * @param Customer $customer
  * @return array
  */
 public function test(Customer $customer)
 {
     // Precondition:
     $customer->persist();
     $addressToDelete = $customer->getDataFieldConfig('address')['source']->getAddresses()[1];
     // Steps:
     $this->objectManager->create('Magento\\Customer\\Test\\TestStep\\LoginCustomerOnFrontendStep', ['customer' => $customer])->run();
     $this->customerAccountIndex->getAccountMenuBlock()->openMenuItem('Address Book');
     $this->customerAccountIndex->getAdditionalAddressBlock()->deleteAdditionalAddress($addressToDelete);
     return ['deletedAddress' => $addressToDelete];
 }
 /**
  * Test creation for clear all compare products.
  *
  * @param string $products
  * @param ConfigData $config
  * @param CustomerAccountIndex $customerAccountIndex
  * @return void
  */
 public function test($products, ConfigData $config, CustomerAccountIndex $customerAccountIndex)
 {
     // Preconditions
     $config->persist();
     $products = $this->createProducts($products);
     //Steps
     $this->cmsIndex->open();
     $this->loginCustomer();
     $this->addProducts($products);
     $this->cmsIndex->getLinksBlock()->openLink("My Account");
     $customerAccountIndex->getCompareProductsBlock()->clickClearAll();
 }
 /**
  * Asserts that customer name in Contact information block and Account info tab matches name in fixture.
  *
  * @param CustomerAccountIndex $customerAccountIndex
  * @param CustomerAccountEdit $customerAccountEdit
  * @param Customer $customer
  * @return void
  */
 public function processAssert(CustomerAccountIndex $customerAccountIndex, CustomerAccountEdit $customerAccountEdit, Customer $customer)
 {
     $customerName = $customer->getFirstname() . " " . $customer->getLastname();
     $customerAccountIndex->open();
     $infoBlock = $customerAccountIndex->getInfoBlock()->getContactInfoContent();
     $infoBlock = explode(PHP_EOL, $infoBlock);
     $nameInDashboard = $infoBlock[0];
     \PHPUnit_Framework_Assert::assertTrue($nameInDashboard == $customerName, 'Customer name in Contact info block is not matching the fixture.');
     $customerAccountIndex->getInfoBlock()->openEditContactInfo();
     $nameInEdit = $customerAccountEdit->getAccountInfoForm()->getFirstName() . " " . $customerAccountEdit->getAccountInfoForm()->getLastName();
     \PHPUnit_Framework_Assert::assertTrue($nameInEdit == $customerName, 'Customer name on Account info tab is not matching the fixture.');
 }
 /**
  * Runs Delete Customer Address test.
  *
  * @param Customer $customer
  * @return array
  */
 public function test(Customer $customer)
 {
     $this->markTestIncomplete('Bug: MAGETWO-34634');
     // Precondition:
     $customer->persist();
     $addressToDelete = $customer->getDataFieldConfig('address')['source']->getAddresses()[1];
     // Steps:
     $this->cmsIndex->open();
     $this->cmsIndex->getLinksBlock()->openLink("Log In");
     $this->customerAccountLogin->getLoginBlock()->login($customer);
     $this->customerAccountIndex->getAccountMenuBlock()->openMenuItem('Address Book');
     $this->customerAccountIndex->getAdditionalAddressBlock()->deleteAdditionalAddress($addressToDelete);
     return ['deletedAddress' => $addressToDelete];
 }
Exemplo n.º 18
0
 /**
  * Enable Automatic Assignment of Customers to Appropriate VAT Group.
  *
  * @param Customer $customer
  * @param Address $vatId
  * @param ConfigData $vatConfig
  * @param string $configData
  * @param string $customerGroup
  * @return array
  */
 public function test(Customer $customer, Address $vatId, ConfigData $vatConfig, $configData, $customerGroup)
 {
     // Preconditions
     $this->configData = $configData;
     $this->customer = $customer;
     $this->objectManager->create('Magento\\Config\\Test\\TestStep\\SetupConfigurationStep', ['configData' => $this->configData])->run();
     $this->customer->persist();
     $this->prepareVatConfig($vatConfig, $customerGroup);
     // Steps
     $this->objectManager->create('Magento\\Customer\\Test\\TestStep\\LoginCustomerOnFrontendStep', ['customer' => $this->customer])->run();
     $this->customerAccountIndex->getDashboardAddress()->editBillingAddress();
     $this->customerAddressEdit->getEditForm()->fill($vatId);
     $this->customerAddressEdit->getEditForm()->saveAddress();
     return ['customer' => $this->customer];
 }
 /**
  * @inheritdoc
  *
  * @return array
  */
 public function run()
 {
     $this->objectManager->create(\Magento\Customer\Test\TestStep\LoginCustomerOnFrontendStep::class, ['customer' => $this->customer])->run();
     $this->customerAccountIndex->getAccountMenuBlock()->openMenuItem('My Credit Cards');
     $myCreditCardsBlock = $this->myCreditCardsPage->getCreditCardsBlock();
     $creditCardData = $this->creditCard->getData();
     $creditCardNumber = preg_grep('/([a-z]+)_number/', array_flip($creditCardData));
     $lastFourDigits = substr(key($creditCardNumber), -4, 4);
     $availableCreditCards = $myCreditCardsBlock->getCreditCards();
     if (key_exists($lastFourDigits, $availableCreditCards)) {
         $myCreditCardsBlock->deleteCreditCard($availableCreditCards[$lastFourDigits]);
     }
     $this->assertCreditCardDeletedMessage->processAssert($this->myCreditCardsPage);
     return ['deletedCreditCard' => $lastFourDigits];
 }
Exemplo n.º 20
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('Magento\\Customer\\Test\\TestStep\\LoginCustomerOnFrontendStep', ['customer' => $initialCustomer])->run();
     $this->cmsIndex->getLinksBlock()->openLink('My Account');
     $this->customerAccountIndex->getInfoBlock()->openChangePassword();
     $this->customerAccountEdit->getAccountInfoForm()->fill($customer);
     $this->customerAccountEdit->getAccountInfoForm()->submit();
 }
 /**
  * Open Downloadable Link.
  *
  * @param OrderInjectable $order
  * @param int $downloads
  * @return void
  */
 protected function openDownloadableLink(OrderInjectable $order, $downloads)
 {
     $customerLogin = $this->objectManager->create('Magento\\Customer\\Test\\TestStep\\LoginCustomerOnFrontendStep', ['customer' => $order->getDataFieldConfig('customer_id')['source']->getCustomer()]);
     $customerLogin->run();
     $this->customerAccount->getAccountMenuBlock()->openMenuItem('My Downloadable Products');
     $downloadableProductsUrl = $this->browser->getUrl();
     foreach ($order->getEntityId()['products'] as $product) {
         foreach ($product->getDownloadableLinks()['downloadable']['link'] as $link) {
             for ($i = 0; $i < $downloads; $i++) {
                 $this->browser->open($this->customerProducts->getMainBlock()->getLinkUrl($link['title']));
                 $this->browser->open($downloadableProductsUrl);
             }
         }
     }
 }
 /**
  * Run Update Customer Entity test
  *
  * @param Customer $initialCustomer
  * @param Customer $customer
  * @param Address $address
  * @param AssertCustomerInfoSuccessSavedMessage $assertCustomerInfoSuccessSavedMessage
  * @return void
  */
 public function test(Customer $initialCustomer, Customer $customer, Address $address, AssertCustomerInfoSuccessSavedMessage $assertCustomerInfoSuccessSavedMessage)
 {
     // Preconditions
     $initialCustomer->persist();
     // Steps
     $this->objectManager->create('Magento\\Customer\\Test\\TestStep\\LoginCustomerOnFrontendStep', ['customer' => $initialCustomer])->run();
     $this->customerAccountIndex->getInfoBlock()->openEditContactInfo();
     $this->customerAccountEdit->getAccountInfoForm()->fill($customer);
     $this->customerAccountEdit->getAccountInfoForm()->submit();
     \PHPUnit_Framework_Assert::assertThat($this->getName(), $assertCustomerInfoSuccessSavedMessage);
     $this->cmsIndex->getCmsPageBlock()->waitPageInit();
     $this->customerAccountIndex->getDashboardAddress()->editBillingAddress();
     $this->customerAddressEdit->getEditForm()->fill($address);
     $this->customerAddressEdit->getEditForm()->saveAddress();
 }
Exemplo n.º 23
0
 /**
  * Run Update Customer Entity test
  *
  * @param CustomerInjectable $initialCustomer
  * @param CustomerInjectable $customer
  * @param AddressInjectable $address
  * @param AssertCustomerInfoSuccessSavedMessage $assertCustomerInfoSuccessSavedMessage
  * @return void
  */
 public function test(CustomerInjectable $initialCustomer, CustomerInjectable $customer, AddressInjectable $address, AssertCustomerInfoSuccessSavedMessage $assertCustomerInfoSuccessSavedMessage)
 {
     // Preconditions
     $initialCustomer->persist();
     // Steps
     $this->cmsIndex->open();
     $this->cmsIndex->getLinksBlock()->openLink('Log In');
     $this->customerAccountLogin->getLoginBlock()->fill($initialCustomer);
     $this->customerAccountLogin->getLoginBlock()->submit();
     $this->customerAccountIndex->getInfoBlock()->openEditContactInfo();
     $this->customerAccountEdit->getAccountInfoForm()->fill($customer);
     $this->customerAccountEdit->getAccountInfoForm()->submit();
     \PHPUnit_Framework_Assert::assertThat($this->getName(), $assertCustomerInfoSuccessSavedMessage);
     $this->customerAccountIndex->getDashboardAddress()->editBillingAddress();
     $this->customerAddressEdit->getEditForm()->fill($address);
     $this->customerAddressEdit->getEditForm()->saveAddress();
 }
 /**
  * Asserts that deleted address is not present on Frontend.
  *
  * @param CustomerAccountIndex $customerAccountIndex
  * @param CustomerAddressEdit $customerAddressEdit
  * @param Customer $customer
  * @param Address $addressToDelete
  * @return void
  */
 public function processAssert(CustomerAccountIndex $customerAccountIndex, CustomerAddressEdit $customerAddressEdit, Customer $customer, Address $addressToDelete)
 {
     $this->objectManager->create(\Magento\Customer\Test\TestStep\LoginCustomerOnFrontendStep::class, ['customer' => $customer])->run();
     $customerAccountIndex->getAccountMenuBlock()->openMenuItem('Address Book');
     $addressRenderer = $this->objectManager->create(\Magento\Customer\Test\Block\Address\Renderer::class, ['address' => $addressToDelete, 'type' => 'html']);
     $deletedAddress = $addressRenderer->render();
     $isAddressDeleted = false;
     if ($customerAddressEdit->getEditForm()->isVisible() || $customerAccountIndex->getAdditionalAddressBlock()->getBlockText() !== null && $deletedAddress != $customerAccountIndex->getAdditionalAddressBlock()->getBlockText() || $customerAccountIndex->getDefaultAddressBlock()->getBlockText() !== null && $deletedAddress != $customerAccountIndex->getAdditionalAddressBlock()->getBlockText()) {
         $isAddressDeleted = true;
     }
     \PHPUnit_Framework_Assert::assertTrue($isAddressDeleted, 'Customer address was not deleted.');
 }
 /**
  * Run Lock customer on edit page test.
  *
  * @param Customer $initialCustomer
  * @param Customer $customer
  * @param int $attempts
  * @param string $configData
  * @return void
  */
 public function test(Customer $initialCustomer, Customer $customer, $attempts, $configData = null)
 {
     $this->configData = $configData;
     // Preconditions
     $this->objectManager->create('Magento\\Config\\Test\\TestStep\\SetupConfigurationStep', ['configData' => $this->configData])->run();
     $initialCustomer->persist();
     // Steps
     $this->objectManager->create('Magento\\Customer\\Test\\TestStep\\LoginCustomerOnFrontendStep', ['customer' => $initialCustomer])->run();
     $this->cmsIndex->getLinksBlock()->openLink('My Account');
     $this->customerAccountIndex->getInfoBlock()->openChangePassword();
     for ($i = 0; $i < $attempts; $i++) {
         if ($i > 0) {
             $this->customerAccountIndex->getInfoBlock()->checkChangePassword();
         }
         $this->customerAccountEdit->getAccountInfoForm()->fill($customer);
         $this->customerAccountEdit->getAccountInfoForm()->submit();
     }
 }
 /**
  * Assert that product is present in default wishlist
  *
  * @param CmsIndex $cmsIndex
  * @param CustomerAccountIndex $customerAccountIndex
  * @param WishlistIndex $wishlistIndex
  * @param InjectableFixture $product
  * @return void
  */
 public function processAssert(CmsIndex $cmsIndex, CustomerAccountIndex $customerAccountIndex, WishlistIndex $wishlistIndex, InjectableFixture $product)
 {
     $cmsIndex->getLinksBlock()->openLink('My Account');
     $customerAccountIndex->getAccountMenuBlock()->openMenuItem('My Wish List');
     \PHPUnit_Framework_Assert::assertTrue($wishlistIndex->getItemsBlock()->getItemProduct($product)->isVisible(), $product->getName() . ' is not visible on wishlist page.');
 }
 /**
  * Assert that after clicking to "Create account" button customer redirected to Dashboard.
  *
  * @param CustomerAccountIndex $accountIndexPage
  * @return void
  */
 public function processAssert(CustomerAccountIndex $accountIndexPage)
 {
     \PHPUnit_Framework_Assert::assertEquals(self::DASHBOARD_MESSAGE, $accountIndexPage->getTitleBlock()->getTitle(), 'Wrong dashboard title is displayed.');
 }
 /**
  * Assert that edit page of customer account contains correct title.
  *
  * @param CustomerAccountIndex $pageCustomerIndex
  * @param Customer $customer
  * @return void
  */
 public function processAssert(CustomerAccountIndex $pageCustomerIndex, Customer $customer)
 {
     \PHPUnit_Framework_Assert::assertEquals($customer->getFirstname() . ' ' . $customer->getLastname(), $pageCustomerIndex->getTitleBlock()->getTitle(), 'Wrong page title is displayed.');
 }
 /**
  * Asserts that success message equals to expected message
  *
  * @param CustomerAccountIndex $customerAccountIndex
  * @return void
  */
 public function processAssert(CustomerAccountIndex $customerAccountIndex)
 {
     $successMessage = $customerAccountIndex->getMessages()->getSuccessMessages();
     \PHPUnit_Framework_Assert::assertEquals(self::SUCCESS_MESSAGE, $successMessage, 'Wrong success message is displayed.' . "\nExpected: " . self::SUCCESS_MESSAGE . "\nActual: " . $successMessage);
 }
 /**
  * Assert that login again to frontend with new password was success.
  *
  * @param FixtureFactory $fixtureFactory
  * @param CustomerAccountIndex $customerAccountIndex
  * @param Customer $initialCustomer
  * @param Customer $customer
  * @return void
  */
 public function processAssert(FixtureFactory $fixtureFactory, CustomerAccountIndex $customerAccountIndex, Customer $initialCustomer, Customer $customer)
 {
     $customer = $fixtureFactory->createByCode('customer', ['dataset' => 'default', 'data' => ['email' => $initialCustomer->getEmail(), 'password' => $customer->getPassword(), 'password_confirmation' => $customer->getPassword()]]);
     $this->objectManager->create('Magento\\Customer\\Test\\TestStep\\LoginCustomerOnFrontendStep', ['customer' => $customer])->run();
     \PHPUnit_Framework_Assert::assertTrue($customerAccountIndex->getAccountMenuBlock()->isVisible(), 'Customer Account Dashboard is not visible.');
 }