function WorkspaceToolbarIntegrationTest::testWorkspaceCanvasToggling

Same name in other branches
  1. 9 core/modules/workspaces/tests/src/FunctionalJavascript/WorkspaceToolbarIntegrationTest.php \Drupal\Tests\workspaces\FunctionalJavascript\WorkspaceToolbarIntegrationTest::testWorkspaceCanvasToggling()
  2. 10 core/modules/workspaces/tests/src/FunctionalJavascript/WorkspaceToolbarIntegrationTest.php \Drupal\Tests\workspaces\FunctionalJavascript\WorkspaceToolbarIntegrationTest::testWorkspaceCanvasToggling()
  3. 11.x core/modules/workspaces/tests/src/FunctionalJavascript/WorkspaceToolbarIntegrationTest.php \Drupal\Tests\workspaces\FunctionalJavascript\WorkspaceToolbarIntegrationTest::testWorkspaceCanvasToggling()
  4. 11.x core/modules/workspaces_ui/tests/src/FunctionalJavascript/WorkspaceToolbarIntegrationTest.php \Drupal\Tests\workspaces_ui\FunctionalJavascript\WorkspaceToolbarIntegrationTest::testWorkspaceCanvasToggling()

Test workspace canvas can be toggled with JavaScript.

File

core/modules/workspaces/tests/src/FunctionalJavascript/WorkspaceToolbarIntegrationTest.php, line 40

Class

WorkspaceToolbarIntegrationTest
Tests workspace settings stray integration.

Namespace

Drupal\Tests\workspaces\FunctionalJavascript

Code

public function testWorkspaceCanvasToggling() {
    $page = $this->getSession()
        ->getPage();
    $assert_session = $this->assertSession();
    // Set size for horizontal toolbar.
    $this->getSession()
        ->resizeWindow(1200, 600);
    $this->drupalGet('<front>');
    // Wait for toolbar to appear.
    $this->assertNotEmpty($assert_session->waitForElement('css', 'body.toolbar-horizontal'));
    // Open workspace canvas.
    $page->clickLink('Switch workspace');
    $this->waitForOffCanvasToOpen('top');
    $assert_session->elementExists('css', '.workspaces-dialog');
    // Close Canvas.
    $page->pressButton('Close');
    $this->waitForOffCanvasToClose();
    $assert_session->assertNoElementAfterWait('css', '.workspaces-dialog');
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.