/** * Logs in as a default admin user on back-end * @return Mage_Selenium_TestCase */ public function loginAdminUser() { $this->admin('log_in_to_admin', false); $loginData = array('user_name' => $this->_configHelper->getDefaultLogin(), 'password' => $this->_configHelper->getDefaultPassword()); if ($this->_findCurrentPageFromUrl() != $this->_firstPageAfterAdminLogin) { $this->validatePage('log_in_to_admin'); $dashboardLogo = $this->_getControlXpath('pageelement', 'admin_logo'); // $closeButton = $this->_getControlXpath('button', 'close'); $this->fillFieldset($loginData, 'log_in'); $this->clickButton('login', false); $this->waitForElement(array($dashboardLogo, $this->_getMessageXpath('general_error'), $this->_getMessageXpath('general_validation'))); // if ($this->controlIsPresent('link', 'go_to_notifications') && $this->waitForElement($closeButton, 5)) { // $this->click($closeButton); // } } $this->validatePage($this->_firstPageAfterAdminLogin); return $this; }
/** * Logs in as a default admin user on back-end * @return Mage_Selenium_TestCase */ public function loginAdminUser() { $this->admin('log_in_to_admin', false); $loginData = array('user_name' => $this->_configHelper->getDefaultLogin(), 'password' => $this->_configHelper->getDefaultPassword()); $currentPage = $this->_findCurrentPageFromUrl($this->getLocation()); if ($currentPage != $this->_firstPageAfterAdminLogin) { $this->validatePage('log_in_to_admin'); $this->fillForm($loginData); $this->clickButton('login', false); $this->waitForElement(array(self::$xpathAdminLogo, self::$xpathErrorMessage, self::$xpathValidationMessage)); if ($this->_findCurrentPageFromUrl($this->getLocation()) != $this->_firstPageAfterAdminLogin) { $this->fail('Admin was not logged in'); } if ($this->isElementPresent(self::$xpathGoToNotifications) && $this->waitForElement(self::$xpathIncomingMessageClose, 5)) { $this->click(self::$xpathIncomingMessageClose); } $this->validatePage($this->_firstPageAfterAdminLogin); } return $this; }
/** * @covers Mage_Selenium_Helper_Config::getDefaultLogin */ public function testGetDefaultLogin() { $configHelper = new Mage_Selenium_Helper_Config($this->_config); $configHelper->setArea('admin'); $login = $configHelper->getDefaultLogin(); $this->assertInternalType('string', $login); $this->assertNotEmpty($login); $configHelper->setArea('frontend'); $login = $configHelper->getDefaultLogin(); $this->assertInternalType('string', $login); }