Chris@0: drupalCreateUser(['administer blocks']); Chris@0: $this->drupalLogin($admin_user); Chris@0: $this->drupalGet('admin/structure/block'); Chris@0: $session = $this->getSession(); Chris@0: $assert_session = $this->assertSession(); Chris@0: $page = $session->getPage(); Chris@0: Chris@0: // Open the dialog using the place block link. Chris@0: $placeBlockLink = $page->findLink('Place block'); Chris@0: $this->assertTrue($placeBlockLink->isVisible(), 'Place block button exists.'); Chris@0: $placeBlockLink->click(); Chris@0: $assert_session->assertWaitOnAjaxRequest(); Chris@0: $dialog = $page->find('css', '.ui-dialog'); Chris@0: $this->assertTrue($dialog->isVisible(), 'Dialog is opened after clicking the Place block button.'); Chris@0: Chris@0: // Close the dialog again. Chris@0: $closeButton = $page->find('css', '.ui-dialog-titlebar-close'); Chris@0: $closeButton->click(); Chris@0: $assert_session->assertWaitOnAjaxRequest(); Chris@0: $dialog = $page->find('css', '.ui-dialog'); Chris@0: $this->assertNull($dialog, 'Dialog is closed after clicking the close button.'); Chris@0: Chris@0: // Resize the window. The test should pass after waiting for Javascript to Chris@0: // finish as no Javascript errors should have been triggered. If there were Chris@0: // javascript errors the test will fail on that. Chris@0: $session->resizeWindow(625, 625); Chris@0: $assert_session->assertWaitOnAjaxRequest(); Chris@0: } Chris@0: Chris@0: }