Example #1
0
 protected function checkProductOnList(\XLite\Model\Product $product, $modes, $sale, $type)
 {
     $listPrice = $this->formatPrice($product->getListPrice());
     foreach ($modes as $mode) {
         $this->click('css=a.' . $mode);
         //$this->waitForAjaxProgress();
         sleep(1);
         $this->assertElementPresent("css=.content .items-list .product.productid-" . $product->getProductId(), "Sale product missing, {$mode} mode, {$sale} {$type}");
         $this->assertElementPresent("css=.content .items-list .productid-" . $product->getProductId() . " .label-orange.sale-price", "Sale label missing, {$mode} mode, {$sale} {$type}");
         $this->assertNotEquals($product->getPrice(), $product->getListPrice(), "Price and list price equals, {$mode} mode, {$sale} {$type}");
         $this->assertElementContainsText("css=.content .items-list .product.productid-" . $product->getProductId() . " .product-price", $listPrice, "Price shown without sale, {$mode} mode, {$sale} {$type}");
     }
 }