Chris@0: drupalCreateUser([ Chris@0: 'access toolbar', Chris@0: 'administer site configuration', Chris@0: 'access content overview', Chris@0: ]); Chris@0: $this->drupalLogin($admin_user); Chris@0: Chris@17: // Set size for horizontal toolbar. Chris@17: $this->getSession()->resizeWindow(1200, 600); Chris@0: $this->drupalGet(''); Chris@17: $this->assertNotEmpty($this->assertSession()->waitForElement('css', 'body.toolbar-horizontal')); Chris@17: $this->assertNotEmpty($this->assertSession()->waitForElementVisible('css', '.toolbar-tray')); Chris@17: Chris@0: $page = $this->getSession()->getPage(); Chris@0: Chris@0: // Test that it is possible to toggle the toolbar tray. Chris@0: $content = $page->findLink('Content'); Chris@0: $this->assertTrue($content->isVisible(), 'Toolbar tray is open by default.'); Chris@0: $page->clickLink('Manage'); Chris@0: $this->assertFalse($content->isVisible(), 'Toolbar tray is closed after clicking the "Manage" link.'); Chris@0: $page->clickLink('Manage'); Chris@0: $this->assertTrue($content->isVisible(), 'Toolbar tray is visible again after clicking the "Manage" button a second time.'); Chris@0: Chris@0: // Test toggling the toolbar tray between horizontal and vertical. Chris@0: $tray = $page->findById('toolbar-item-administration-tray'); Chris@0: $this->assertFalse($tray->hasClass('toolbar-tray-vertical'), 'Toolbar tray is not vertically oriented by default.'); Chris@0: $page->pressButton('Vertical orientation'); Chris@0: $this->assertTrue($tray->hasClass('toolbar-tray-vertical'), 'After toggling the orientation the toolbar tray is now displayed vertically.'); Chris@0: Chris@0: $page->pressButton('Horizontal orientation'); Chris@0: $this->assertTrue($tray->hasClass('toolbar-tray-horizontal'), 'After toggling the orientation a second time the toolbar tray is displayed horizontally again.'); Chris@0: } Chris@0: Chris@0: }