Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
ValidateEmailOnCheckoutTest.php
Go to the documentation of this file.
1 <?php
8 
10 use Magento\Catalog\Test\Page\Product\CatalogProductView;
11 use Magento\Checkout\Test\Page\CheckoutCart;
12 use Magento\Checkout\Test\Page\CheckoutOnepage;
14 use Magento\Mtf\Client\BrowserInterface;
15 use Magento\Mtf\TestCase\Injectable;
16 
31 class ValidateEmailOnCheckoutTest extends Injectable
32 {
33  /* tags */
34  const MVP = 'yes';
35  /* end tags */
36 
48  public function test(
49  CatalogProductSimple $product,
50  CheckoutCart $cartPage,
51  CatalogProductView $catalogProductView,
52  BrowserInterface $browser,
53  CheckoutOnepage $checkoutOnepage,
54  Customer $customer
55  ) {
56  //Preconditions
57  $product->persist();
58 
59  $cartPage->open();
60  $cartPage->getCartBlock()->clearShoppingCart();
61 
62  //Steps
63  $browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html');
64  $productView = $catalogProductView->getViewBlock();
65  $productView->fillOptions($product);
66  $productView->setQty($product->getCheckoutData()['qty']);
67  $productView->clickAddToCart();
68  $catalogProductView->getMessagesBlock()->waitSuccessMessage();
69 
70  $checkoutOnepage->open();
71  $checkoutOnepage->getShippingBlock()->fill($customer);
72  $checkoutOnepage->getShippingMethodBlock()->clickContinue();
73  }
74 }
$customer
Definition: customers.php:11
test(CatalogProductSimple $product, CheckoutCart $cartPage, CatalogProductView $catalogProductView, BrowserInterface $browser, CheckoutOnepage $checkoutOnepage, Customer $customer)