function 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;
}