예제 #1
0
 /**
  * Wait for the end of ajax by checking the data-loaded attribute
  *
  * @param string $id          the id of the ajax div
  * @param int    $waitTimeout timeout value
  *
  * @return void
  */
 public function waitForAjax($id, $waitTimeout = 10000)
 {
     parent::waitUntil(function () use($id) {
         // data-loaded attritude is added in url.js at onComplete event
         if ($this->byId($id)->attribute("data-loaded") == "1") {
             return true;
         }
         return null;
     }, $waitTimeout);
 }
예제 #2
0
 /**
  * Wait AJAX request
  */
 public function waitForAjax()
 {
     $this->test->waitUntil(function (\PHPUnit_Extensions_Selenium2TestCase $testCase) {
         $status = $testCase->execute(array('script' => "return typeof(jQuery.isActive) == 'undefined' || !jQuery.isActive()", 'args' => array()));
         if ($status) {
             return true;
         } else {
             return null;
         }
     }, intval(MAX_EXECUTION_TIME));
     $this->test->timeouts()->implicitWait(intval(TIME_OUT));
 }
예제 #3
0
 /**
  * Wait AJAX request
  */
 public function waitForAjax()
 {
     $this->test->waitUntil(function ($testCase) {
         $status = $testCase->execute(array('script' => 'return !jQuery.isActive()', 'args' => array()));
         if ($status) {
             return true;
         } else {
             return null;
         }
     }, intval(MAX_EXECUTION_TIME));
     $this->timeouts()->implicitWait(intval(TIME_OUT));
 }
예제 #4
0
    /**
     * Wait AJAX request
     */
    public function waitForAjax()
    {
        $this->test->waitUntil(function (\PHPUnit_Extensions_Selenium2TestCase $testCase) {
            $jsAppActiveCheck = <<<JS
                    var isAppActive = false;
                    try {
                        if (!window.mediatorCachedForSelenium) {
                            window.mediatorCachedForSelenium = require('oroui/js/mediator');
                        }
                        isAppActive = window.mediatorCachedForSelenium.execute('isInAction');
                    } catch(e) {};
                    return !(jQuery && (jQuery.active || jQuery(document.body).hasClass('loading'))) && !isAppActive;
JS;
            $status = $testCase->execute(array('script' => $jsAppActiveCheck, 'args' => array()));
            if ($status) {
                return true;
            } else {
                return null;
            }
        }, intval(MAX_EXECUTION_TIME));
        $this->test->timeouts()->implicitWait(intval(TIME_OUT));
    }