Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
PasswordAutocompleteOffTest.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\Mtf\Client\BrowserInterface;
13 use Magento\Mtf\TestCase\Injectable;
14 
27 class PasswordAutocompleteOffTest extends Injectable
28 {
29  /* tags */
30  const MVP = 'yes';
31  /* end tags */
32 
38  protected $configData;
39 
50  public function test(
51  BrowserInterface $browser,
52  CatalogProductView $catalogProductView,
53  CheckoutCart $checkoutCart,
54  CatalogProductSimple $product,
56  ) {
57  $this->configData = $configData;
58 
59  // Preconditions
60  $this->objectManager->create(
61  \Magento\Config\Test\TestStep\SetupConfigurationStep::class,
62  ['configData' => $this->configData]
63  )->run();
64 
65  $product->persist();
66 
67  // Steps
68  $checkoutCart->open();
69  $checkoutCart->getCartBlock()->clearShoppingCart();
70 
71  $browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html');
72  $catalogProductView->getViewBlock()->addToCart($product);
73  $catalogProductView->getMessagesBlock()->waitSuccessMessage();
74  }
75 
81  public function tearDown()
82  {
83  $this->objectManager->create(
84  \Magento\Config\Test\TestStep\SetupConfigurationStep::class,
85  ['configData' => $this->configData, 'rollback' => true]
86  )->run();
87  }
88 }
test(BrowserInterface $browser, CatalogProductView $catalogProductView, CheckoutCart $checkoutCart, CatalogProductSimple $product, $configData)