/** * Assert configurable product, corresponds to the product page * * @param CatalogProductView $catalogProductView * @param Browser $browser * @param CatalogProductConfigurable $configurable * @return void */ public function processAssert(CatalogProductView $catalogProductView, Browser $browser, CatalogProductConfigurable $configurable) { //Open product view page $browser->open($_ENV['app_frontend_url'] . $configurable->getUrlKey() . '.html'); //Process assertions $this->assertOnProductView($configurable, $catalogProductView); }
/** * Assert configurable product, corresponds to the product in the cart * * @param CatalogProductView $catalogProductView * @param CatalogProductConfigurable $configurable * @param Browser $browser * @param CheckoutCart $checkoutCart * @return void */ public function processAssert(CatalogProductView $catalogProductView, CatalogProductConfigurable $configurable, Browser $browser, CheckoutCart $checkoutCart) { //Add product to cart $browser->open($_ENV['app_frontend_url'] . $configurable->getUrlKey() . '.html'); $configurableData = $configurable->getConfigurableAttributesData(); if (!empty($configurableData)) { $configurableOption = $catalogProductView->getCustomOptionsBlock(); foreach ($configurableData['attributes_data'] as $attribute) { $configurableOption->selectProductCustomOption($attribute['title']); } } $catalogProductView->getViewBlock()->clickAddToCart(); $this->assertOnShoppingCart($configurable, $checkoutCart); }