public function testCustomerAccount()
 {
     $cstConf = self::getCustomerConfig('customers');
     foreach ($cstConf as $customer) {
         $customers = Mage::getModel('customer/customer')->getCollection()->addFieldToFilter('email', $customer['username']);
         $this->setCustomerAsLoggedIn($customers->getFirstItem());
         $pagesConf = self::getCustomerConfig('urls');
         $this->_helper->doGeneralTest($pagesConf, $this);
     }
 }
Beispiel #2
0
 public function getProductName()
 {
     $css = Tt_MageTest_Helper_Data::getPageConfig('product/productname');
     if (empty($css)) {
         $css = '.product-name';
     }
     return $this->byCssSelector($css)->text();
 }
Beispiel #3
0
 public function testCategories()
 {
     $productConfig = self::getCatalogConfig('categories');
     $this->_helper->doGeneralTest($productConfig, $this);
 }
Beispiel #4
0
 public function testProducts()
 {
     $productConfig = self::getProductConfig('products');
     $this->_helper->doGeneralTest($productConfig, $this);
 }
Beispiel #5
0
 public function nextStep()
 {
     $activeStepName = $this->getActiveStepName();
     $currentLocation = (string) $this->url();
     $cssNextStepButton = Tt_MageTest_Helper_Data::getPageConfig('checkout/nextstepbutton');
     if (empty($cssNextStepButton)) {
         $cssNextStepButton = '.buttons-set button';
     }
     $this->getActiveStepElement()->byCssSelector($cssNextStepButton)->click();
     $this->waitUntil(function () use($activeStepName, $currentLocation) {
         try {
             if ($this->getActiveStepName() != $activeStepName || (string) $this->url() != $currentLocation) {
                 return true;
             }
         } catch (Exception $e) {
             return true;
         }
         return null;
     }, 60000);
     sleep(0.5);
     // Rendering Time
 }
Beispiel #6
0
 /**
  * Extracts Item-Id from delete cart-item url
  *
  * @param PHPUnit_Extensions_Selenium2TestCase_Element $tr
  * @return bool|int
  */
 protected function getItemId(PHPUnit_Extensions_Selenium2TestCase_Element $tr)
 {
     $cssItemId = Tt_MageTest_Helper_Data::getPageConfig('cart/itemidcss');
     if (empty($cssItemId)) {
         $cssItemId = 'a';
     }
     $regexItemId = Tt_MageTest_Helper_Data::getPageConfig('cart/itemidregex');
     if (empty($regexItemId)) {
         $regexItemId = '#checkout/cart/delete/id/([0-9]*)/#siU';
     }
     $aList = $this->findElementsByCssSelector($cssItemId, $tr);
     foreach ($aList as $a) {
         /** @var PHPUnit_Extensions_Selenium2TestCase_Element $a */
         if (preg_match($regexItemId, $a->attribute('href'), $matches)) {
             return $matches[1];
         }
     }
     return false;
 }
 public function testRenderUrls()
 {
     $urlsConfig = self::getInteractiveConfig('urls');
     $this->_helper->doGeneralTest($urlsConfig, $this);
 }
Beispiel #8
0
 public function testGeneralAdmin()
 {
     $salesConfig = self::getAdminConfig('urls');
     $this->_helper->doGeneralTest($salesConfig, $this);
 }