hold_test_response example

$this->getSession()->getPage()->clickLink('Grid');
    // Assert the display change is correctly announced for screen readers.     $this->waitForText('Loading grid view.');
    $this->waitForText('Changed to grid view.');
    $this->assertMediaLibraryGrid();
  }

  /** * Switches to the table display of the widget view. */
  protected function switchToMediaLibraryTable() {
    hold_test_response(TRUE);
    $this->getSession()->getPage()->clickLink('Table');
    // Assert the display change is correctly announced for screen readers.     $this->waitForText('Loading table view.');
    hold_test_response(FALSE);
    $this->waitForText('Changed to table view.');
    $this->assertMediaLibraryTable();
  }

  /** * Asserts that the grid display of the widget view is visible. */
  
$custom_ajax_progress_message = <<<JS Drupal.theme.ajaxProgressMessage = function (message) { return '<div class="custom-ajax-progress-message">Hold door!</div>'; }; JS;

    $this->drupalGet('admin/structure/views/view/content');
    $web_assert->assertNoElementAfterWait('css', '.ajax-progress-fullscreen');

    // Test theming fullscreen throbber.     $session->executeScript($custom_ajax_progress_indicator_fullscreen);
    hold_test_response(TRUE);
    $page->clickLink('Content: Published (grouped)');
    $this->assertNotNull($web_assert->waitForElement('css', '.custom-ajax-progress-fullscreen'), 'Custom ajaxProgressIndicatorFullscreen.');
    hold_test_response(FALSE);
    $web_assert->assertNoElementAfterWait('css', '.custom-ajax-progress-fullscreen');

    // Test theming throbber message.     $web_assert->waitForElementVisible('css', '[data-drupal-selector="edit-options-group-info-add-group"]');
    $session->executeScript($custom_ajax_progress_message);
    hold_test_response(TRUE);
    $page->pressButton('Add another item');
    $this->assertNotNull($web_assert->waitForElement('css', '.ajax-progress-throbber .custom-ajax-progress-message'), 'Custom ajaxProgressMessage.');
    
Home | Imprint | This part of the site doesn't use cookies.