Exemple #1
0
 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();
 }
Exemple #2
0
 /**
  * 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;
 }
Exemple #3
0
 /**
  * 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;
 }