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); } }
public function getProductName() { $css = Tt_MageTest_Helper_Data::getPageConfig('product/productname'); if (empty($css)) { $css = '.product-name'; } return $this->byCssSelector($css)->text(); }
public function testCategories() { $productConfig = self::getCatalogConfig('categories'); $this->_helper->doGeneralTest($productConfig, $this); }
public function testProducts() { $productConfig = self::getProductConfig('products'); $this->_helper->doGeneralTest($productConfig, $this); }
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 }
/** * 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); }
public function testGeneralAdmin() { $salesConfig = self::getAdminConfig('urls'); $this->_helper->doGeneralTest($salesConfig, $this); }