11 use Magento\Customer\Test\Page\CustomerAccountCreate;
12 use Magento\Cms\Test\Page\CmsIndex;
13 use Magento\Catalog\Test\Page\Product\CatalogProductView;
14 use Magento\Checkout\Test\Page\CheckoutCart;
15 use Magento\Mtf\Client\BrowserInterface;
17 use Magento\Mtf\TestCase\Injectable;
18 use Magento\Mtf\TestStep\TestStepFactory;
52 private $customerAccountCreate;
66 private $catalogProductView;
80 private $checkoutCart;
87 private $logoutCustomerOnFrontendStep;
109 CustomerAccountCreate $customerAccountCreate,
112 CatalogProductView $catalogProductView,
113 BrowserInterface $browser,
115 TestStepFactory $stepFactory
117 $this->customerAccountCreate = $customerAccountCreate;
118 $this->cmsIndex = $cmsIndex;
119 $this->logoutCustomerOnFrontendStep = $logoutCustomerOnFrontendStep;
120 $this->browser = $browser;
121 $this->catalogProductView = $catalogProductView;
122 $this->checkoutCart = $checkoutCart;
123 $this->stepFactory = $stepFactory;
149 $this->configData = $configData;
150 $this->stepFactory->create(
151 \
Magento\Config\Test\TestStep\SetupConfigurationStep::class,
152 [
'configData' => $configData]
156 $this->cmsIndex->open();
157 $this->cmsIndex->getLinksBlock()->openLink(
'Create an Account');
158 $this->customerAccountCreate->getRegisterForm()->registerCustomer(
$customer);
161 $this->checkoutCart->open()->getCartBlock()->clearShoppingCart();
163 $this->browser->open($_ENV[
'app_frontend_url'] .
$product->getUrlKey() .
'.html');
164 $this->catalogProductView->getViewBlock()->addToCart(
$product);
165 $this->catalogProductView->getMessagesBlock()->waitSuccessMessage();
166 $this->logoutCustomerOnFrontendStep->run();
176 $this->stepFactory->create(
177 \
Magento\Config\Test\TestStep\SetupConfigurationStep::class,
178 [
'configData' => $this->configData,
'rollback' =>
true]