/** * Viewed product report list * * @param string $products * @param array $viewsReport * @param string $total * @return array */ public function test($products, array $viewsReport, $total) { // Preconditions $productsList = $this->prepareProducts($products); $this->openProducts($productsList, $total); $this->productReportView->open(); $this->productReportView->getMessagesBlock()->clickLinkInMessages('notice', 'here'); // Steps $this->productReportView->getFilterBlock()->viewsReport($viewsReport); $this->productReportView->getActionsBlock()->showReport(); return ['productsList' => $productsList]; }
/** * Viewed product report list * * @param string $products * @param array $viewsReport * @param string $total * @return array */ public function test($products, array $viewsReport, $total) { // Preconditions $this->catalogProductIndexPage->open(); $this->catalogProductIndexPage->getProductGrid()->massaction([], 'Delete', true, 'Select All'); $productsList = $this->prepareProducts($products); $this->openProducts($productsList, $total); $this->productReportView->open(); $this->productReportView->getMessagesBlock()->clickLinkInMessage('notice', 'here'); // Steps $this->productReportView->getFilterBlock()->viewsReport($viewsReport); $this->productReportView->getActionsBlock()->showReport(); return ['productsList' => $productsList]; }
/** * Assert product info in report: product name, price and views * * @param ProductReportView $productReportView * @param string $total * @param array $productsList * @return void */ public function processAssert(ProductReportView $productReportView, $total, array $productsList) { $total = explode(', ', $total); $totalForm = $productReportView->getGridBlock()->getViewsResults($productsList); \PHPUnit_Framework_Assert::assertEquals($totalForm, $total); }