public function testTitle() { $session = Menta_SessionManager::getSession(); $session->open('http://www.google.com/ncr'); $assertHelper = Menta_ComponentManager::get('Menta_Component_Helper_Assert'); /* @var $assertHelper Menta_Component_Helper_Assert */ $assertHelper->setTest($this)->assertTitle('Google'); Menta_SessionManager::closeSession(); }
/** * Close existing Selenium server sessions * * @return void */ public static function closeSeleniumSession() { try { if (Menta_SessionManager::activeSessionExists()) { echo "\n[Closing remote selenium session]\n"; Menta_SessionManager::closeSession(); } } catch (Exception $e) { echo "[closeSeleniumSession] EXCEPTION: " . $e->getMessage(); } exit; }
/** * Setup * * @return void */ public function setUp() { if (Menta_SessionManager::activeSessionExists()) { if ($this->freshSessionForEachTestMethod) { // Closes previous session if exists. A new session will be started on first call of Menta_SessionManager::getSession() or $this->getSession(); Menta_SessionManager::closeSession(); } elseif ($this->cleanupPreviousSession) { // Deleting all cookies to cleanup any previous application session state Menta_SessionManager::getSession()->deleteAllCookies(); } } parent::setUp(); $GLOBALS['current_testcase'] = $this; }