You are here

protected function WebprofilerTestBase::waitForToolbar in Devel 8

Same name and namespace in other branches
  1. 8.3 webprofiler/tests/src/FunctionalJavascript/WebprofilerTestBase.php \Drupal\Tests\webprofiler\FunctionalJavascript\WebprofilerTestBase::waitForToolbar()
  2. 8.2 webprofiler/tests/src/FunctionalJavascript/WebprofilerTestBase.php \Drupal\Tests\webprofiler\FunctionalJavascript\WebprofilerTestBase::waitForToolbar()
  3. 4.x webprofiler/tests/src/FunctionalJavascript/WebprofilerTestBase.php \Drupal\Tests\webprofiler\FunctionalJavascript\WebprofilerTestBase::waitForToolbar()

Wait until the toolbar is present on page.

3 calls to WebprofilerTestBase::waitForToolbar()
ToolbarTest::testToolbarNotAppearsOnExcludedPath in webprofiler/tests/src/FunctionalJavascript/ToolbarTest.php
Tests the toolbar not appears on excluded path.
ToolbarTest::testToolbarOnFrontPage in webprofiler/tests/src/FunctionalJavascript/ToolbarTest.php
Tests if the toolbar appears on front page.
ToolbarTest::testToolbarReportPage in webprofiler/tests/src/FunctionalJavascript/ToolbarTest.php
Tests the toolbar report page.

File

webprofiler/tests/src/FunctionalJavascript/WebprofilerTestBase.php, line 18

Class

WebprofilerTestBase
Class WebprofilerTestBase.

Namespace

Drupal\Tests\webprofiler\FunctionalJavascript

Code

protected function waitForToolbar() {
  $session = $this
    ->getSession();
  $token = $this
    ->getToken();
  $page = $session
    ->getPage();
  $toolbar = $page
    ->findById('webprofiler' . $token);
  $this
    ->assertTrue($toolbar
    ->hasClass('sf-toolbar'), 'Toolbar loader is present in page');
  $session
    ->wait(1000, 'null !== document.getElementById(\'sfToolbarMainContent-' . $token . '\')');
  return $token;
}