\Drupal\Tests\outside_in\FunctionalJavascript\OutsideInBlockFormTest tests triggering edit mode and then clicking on a block.

You can also click "Quick Edit" contextual link which will also trigger Edit mode.

We didn't test this before because there were no tests for contextual links.

Now there is #2821724: Create Javascript Tests for Contextual Links

Once that is finished we should use the trait in that patch to test this.

Comments

tedbow created an issue. See original summary.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.0-alpha1 will be released the week of January 30, 2017, which means new developments and disruptive changes should now be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

wim leers’s picture

Status: Postponed » Closed (outdated)
StatusFileSize
new33.09 KB
new42.29 KB

If I do this:

diff --git a/core/modules/outside_in/tests/src/FunctionalJavascript/OutsideInBlockFormTest.php b/core/modules/outside_in/tests/src/FunctionalJavascript/OutsideInBlockFormTest.php
index ba865c7..5734d30 100644
--- a/core/modules/outside_in/tests/src/FunctionalJavascript/OutsideInBlockFormTest.php
+++ b/core/modules/outside_in/tests/src/FunctionalJavascript/OutsideInBlockFormTest.php
@@ -311,9 +311,11 @@ public function testQuickEditLinks() {
       // Open QuickEdit toolbar before going into Edit mode.
       $this->clickContextualLink($node_selector, "Quick edit");
       $web_assert->waitForElementVisible('css', $quick_edit_selector);
+      $this->createScreenshot('/tmp/before-clicking-block-quick-edit.png');
       // Open off-canvas and enter Edit mode via contextual link.
       $this->clickContextualLink($block_selector, "Quick edit");
       $this->waitForOffCanvasToOpen();
+      $this->createScreenshot('/tmp/after-clicking-block-quick-edit.png');
       // QuickEdit toolbar should be closed when opening off-canvas dialog.
       $web_assert->elementNotExists('css', $quick_edit_selector);
       // Open QuickEdit toolbar via contextual link while in Edit mode.

Then I get the attached screenshots. It clearly shows that "edit mode" is not enabled before, but it is after clicking.

Before
After

In other words: this already has test coverage!

tedbow’s picture

Component: outside_in.module » settings_tray.module

Changing to new settings_tray.module component. @drpal thanks for script help! :)