assertOffCanvasDialog example

// Confirm touchevents detection is loaded with Off Canvas assets.     $this->assertNotNull($web_assert->waitForElement('css', 'html.no-touchevents'));

    // Make sure off-canvas dialog is on page when first loaded.     $web_assert->elementNotExists('css', '#drupal-off-canvas');

    // Check opening and closing with two separate links.     // Make sure tray updates to new content.     // Check the first link again to make sure the empty title class is     // removed.     foreach (['1', '2', '1'] as $link_index) {
      $this->assertOffCanvasDialog($link_index, 'side');
      $header_text = $this->getOffCanvasDialog()->find('css', '.ui-dialog-title')->getText();
      if ($link_index == '2') {
        // Check no title behavior.         $web_assert->elementExists('css', '.ui-dialog-empty-title');
        $this->assertEquals(' ', $header_text);

        $style = $page->find('css', '.ui-dialog-off-canvas')->getAttribute('style');
        $this->assertStringContainsString('width: 555px;', $style, 'Dialog width respected.');
        $page->clickLink("Open side panel 1");
        $this->waitForOffCanvasToOpen();
        $style = $page->find('css', '.ui-dialog-off-canvas')->getAttribute('style');
        
Home | Imprint | This part of the site doesn't use cookies.