Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AssertAdditionalAddressCreatedFrontend.php
Go to the documentation of this file.
1 <?php
8 
9 use Magento\Customer\Test\Page\CustomerAccountIndex;
10 use Magento\Customer\Test\Fixture\Address;
11 use Magento\Mtf\Constraint\AbstractConstraint;
12 
16 class AssertAdditionalAddressCreatedFrontend extends AbstractConstraint
17 {
25  public function processAssert(CustomerAccountIndex $customerAccountIndex, Address $shippingAddress)
26  {
27  $customerAccountIndex->open();
28  $customerAccountIndex->getAccountMenuBlock()->openMenuItem('Address Book');
29  $addressRenderer = $this->objectManager->create(
30  \Magento\Customer\Test\Block\Address\Renderer::class,
31  ['address' => $shippingAddress, 'type' => 'html']
32  )->render();
33  $isAddressExists = $customerAccountIndex->getAdditionalAddressBlock()
34  ->isAdditionalAddressExists($addressRenderer);
35  \PHPUnit\Framework\Assert::assertTrue(
36  $isAddressExists,
37  'Customers address is absent in customer address book.'
38  );
39  }
40 
46  public function toString()
47  {
48  return 'Customers address is absent in customer address book.';
49  }
50 }
$shippingAddress
Definition: order.php:40
processAssert(CustomerAccountIndex $customerAccountIndex, Address $shippingAddress)