Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions | Data Fields | Protected Member Functions | Protected Attributes
AbandonedCartsReportEntityTest Class Reference
Inheritance diagram for AbandonedCartsReportEntityTest:

Public Member Functions

 __inject (BrowserInterface $browser, FixtureFactory $fixtureFactory, CatalogProductView $catalogProductView)
 
 test ($products, Customer $customer)
 

Data Fields

const MVP = 'no'
 
const STABLE = 'yes'
 

Protected Member Functions

 createProducts ($products)
 
 addProductsToCart (array $products)
 

Protected Attributes

 $catalogProductView
 
 $browser
 
 $fixtureFactory
 

Detailed Description

Preconditions:

  1. Create simple product.
  2. Create customer.
  3. Go to frontend.
  4. Login as customer.
  5. Add simple product to cart.
  6. Logout.

Steps:

  1. Open Backend.
  2. Go to Reports > Abandoned Carts.
  3. Click "Reset Filter".
  4. Perform all assertions.

@group Reports @ZephyrId MAGETWO-28558

Definition at line 33 of file AbandonedCartsReportEntityTest.php.

Member Function Documentation

◆ __inject()

__inject ( BrowserInterface  $browser,
FixtureFactory  $fixtureFactory,
CatalogProductView  $catalogProductView 
)

Inject pages.

Parameters
BrowserInterface$browser
FixtureFactory$fixtureFactory
CatalogProductView$catalogProductView
Returns
void

Definition at line 69 of file AbandonedCartsReportEntityTest.php.

◆ addProductsToCart()

addProductsToCart ( array  $products)
protected

Add products to cart.

Parameters
array$products
Returns
void

Definition at line 126 of file AbandonedCartsReportEntityTest.php.

127  {
128  $addProductsToCart = $this->objectManager->create(
129  \Magento\Checkout\Test\TestStep\AddProductsToTheCartStep::class,
130  ['products' => $products]
131  );
132  $addProductsToCart->run();
133  }

◆ createProducts()

createProducts (   $products)
protected

Create products.

Parameters
string$products
Returns
array

Definition at line 110 of file AbandonedCartsReportEntityTest.php.

111  {
112  $createProductsStep = $this->objectManager->create(
113  \Magento\Catalog\Test\TestStep\CreateProductsStep::class,
114  ['products' => $products]
115  );
116 
117  return $createProductsStep->run()['products'];
118  }

◆ test()

test (   $products,
Customer  $customer 
)

Create product and add it to cart.

Parameters
string$products
Customer$customer
Returns
array

Definition at line 86 of file AbandonedCartsReportEntityTest.php.

87  {
88  // Precondition
90  $customer->persist();
91  $this->objectManager->create(
92  \Magento\Customer\Test\TestStep\LoginCustomerOnFrontendStep::class,
93  ['customer' => $customer]
94  )->run();
96  $this->objectManager->create(
97  \Magento\Customer\Test\TestStep\LogoutCustomerOnFrontendStep::class,
98  ['customer' => $customer]
99  )->run();
100 
101  return ['products' => $products];
102  }
$customer
Definition: customers.php:11

Field Documentation

◆ $browser

$browser
protected

Definition at line 52 of file AbandonedCartsReportEntityTest.php.

◆ $catalogProductView

$catalogProductView
protected

Definition at line 45 of file AbandonedCartsReportEntityTest.php.

◆ $fixtureFactory

$fixtureFactory
protected

Definition at line 59 of file AbandonedCartsReportEntityTest.php.

◆ MVP

const MVP = 'no'

Definition at line 36 of file AbandonedCartsReportEntityTest.php.

◆ STABLE

const STABLE = 'yes'

Definition at line 37 of file AbandonedCartsReportEntityTest.php.


The documentation for this class was generated from the following file: