Issue #2938309 by tedbow, tacituseu, Wim Leers: Only install Quick Edit when necessary for Settings Tray tests

8.6.x
xjm 2018-01-26 12:32:20 -06:00
parent 6f8bc7b1cf
commit e1a7b35c41
1 changed files with 5 additions and 2 deletions

View File

@ -11,6 +11,7 @@ use Drupal\settings_tray_test\Plugin\Block\SettingsTrayFormAnnotationNoneBlock;
use Drupal\Tests\contextual\FunctionalJavascript\ContextualLinkClickTrait;
use Drupal\Tests\system\FunctionalJavascript\OffCanvasTestBase;
use Drupal\user\Entity\Role;
use Drupal\user\RoleInterface;
/**
* Testing opening and saving block forms in the off-canvas dialog.
@ -36,7 +37,6 @@ class SettingsTrayBlockFormTest extends OffCanvasTestBase {
'toolbar',
'contextual',
'settings_tray',
'quickedit',
'search',
'block_content',
'settings_tray_test',
@ -62,7 +62,6 @@ class SettingsTrayBlockFormTest extends OffCanvasTestBase {
'access contextual links',
'access toolbar',
'administer nodes',
'access in-place editing',
'search content',
]);
$this->drupalLogin($user);
@ -294,6 +293,8 @@ class SettingsTrayBlockFormTest extends OffCanvasTestBase {
* Tests QuickEdit links behavior.
*/
public function testQuickEditLinks() {
$this->container->get('module_installer')->install(['quickedit']);
$this->grantPermissions(Role::load(RoleInterface::AUTHENTICATED_ID), ['access in-place editing']);
$quick_edit_selector = '#quickedit-entity-toolbar';
$node_selector = '[data-quickedit-entity-id="node/1"]';
$body_selector = '[data-quickedit-field-id="node/1/body/en/full"]';
@ -511,6 +512,8 @@ class SettingsTrayBlockFormTest extends OffCanvasTestBase {
* "Quick edit settings" is settings_tray.module link.
*/
public function testCustomBlockLinks() {
$this->container->get('module_installer')->install(['quickedit']);
$this->grantPermissions(Role::load(RoleInterface::AUTHENTICATED_ID), ['access in-place editing']);
$this->drupalGet('user');
$page = $this->getSession()->getPage();
$links = $page->findAll('css', "#block-custom .contextual-links li a");