Proposed commit message:

Issue #1874822 by Cottser, porchlight, lbainbridge, LittleCoding, mojzis | xjm: Add functional test coverage for placing multiple blocks.

Problem/Motivation

This is a followup issue for #1535868: Convert all blocks into plugins

Proposed resolution

Add functional test coverage for placing multiple instances of the same block, including:

  • Placing the same block twice.
  • Placing the same block with different settings.
  • Coverage for multiple menu blocks.
  • Coverage for multiple custom blocks.
  • Coverage for multiple Views blocks.

Remaining tasks

Related issues

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

xjm’s picture

Status: Postponed » Active
xjm’s picture

Issue tags: -Needs tests, -VDC +Block plugins
xjm’s picture

Issue tags: +Needs tests, +VDC
mojzis’s picture

Status: Active » Needs review
FileSize
4.33 KB

3 first bullets for review
this will apply after http://drupal.org/node/1874598#comment-7156136

Status: Needs review » Needs work
Issue tags: -Needs tests, -VDC, -Blocks-Layouts, -Block plugins

The last submitted patch, drupal-multiple-1874822-4.patch, failed testing.

xjm’s picture

Status: Needs work » Needs review

#4: drupal-multiple-1874822-4.patch queued for re-testing.

Status: Needs review » Needs work
Issue tags: +Needs tests, +VDC, +Blocks-Layouts, +Block plugins

The last submitted patch, drupal-multiple-1874822-4.patch, failed testing.

xjm’s picture

@mojzis, I haven't tried to debug the failures, but one quick note is that you need to configure your text editor to show or remove trailing whitespace. The patch is full of it. :)

star-szr’s picture

Status: Needs work » Needs review
Issue tags: -Needs tests, -VDC, -Blocks-Layouts, -Block plugins

#4: drupal-multiple-1874822-4.patch queued for re-testing.

Status: Needs review » Needs work
Issue tags: +Needs tests, +VDC, +Blocks-Layouts, +Block plugins

The last submitted patch, drupal-multiple-1874822-4.patch, failed testing.

LittleCoding’s picture

Removed trailing whitespace.

LittleCoding’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, drupal-multiple-1874822-11.patch, failed testing.

lbainbridge’s picture

Priority: Normal » Major
FileSize
4.04 KB

The patch above tried to urlencode a variable that was later urlencoded by drupal, causing a failure. However we still managed to expose a bug, that being that the user menu block cannot be placed twice on a page. This patch should fail testing because of this, here are the steps to reproduce:

  • Install drupal 8
  • Go to structure > blocks > place block and place a new user account menu block in sidebar first
  • Repeat for sidebar second
  • Rather than place two blocks, the block will move
lbainbridge’s picture

Status: Needs work » Needs review

Escalated to major because things are broken by the way.

Status: Needs review » Needs work

The last submitted patch, drupal-multiple-1874822-14.patch, failed testing.

saltednut’s picture

star-szr’s picture

Assigned: Unassigned » star-szr
Priority: Major » Normal
Issue summary: View changes

Working on updating these tests. Tentatively changing priority to normal because I believe the reported bug (#14) has long since been fixed, we're just adding additional test coverage and I don't think any other issue has added this missing coverage.

star-szr’s picture

Assigned: star-szr » Unassigned
Status: Needs work » Needs review
Issue tags: +SprintWeekend2014
FileSize
5.31 KB

I don't think we need to re-test the whole block UI for this, so I decided to use #1872540: Provide a test helper method for creating block instances and with that this got SO much easier. xjm++

@porchlight and I worked on this during sprint weekend.

No interdiff since this changes almost everything, and also adds a test for placing multiple instances of the same custom block, covering everything in the issue summary. I created \Drupal\custom_block\Tests\CustomBlockInstanceTest for that. Arguably the test added to \Drupal\block\Tests\BlockTest that uses views could be moved to the views namespace, I could go either way on that.

star-szr’s picture

Issue summary: View changes

Adding proposed commit message to the issue summary.

star-szr’s picture

Adding related issue that spun off from working on this.

Status: Needs review » Needs work

The last submitted patch, 19: 1874822-19.patch, failed testing.

star-szr’s picture

Status: Needs work » Needs review

19: 1874822-19.patch queued for re-testing.

joelpittet’s picture

Status: Needs review » Reviewed & tested by the community

I reviewed this patch line by line and tested the tests in the UI. IMO it works and does exactly what it intends to do on the tin.

Nice work, y'all

star-szr’s picture

Thanks @joelpittet! FWIW this patch can be cleaned up a bit/improved if #2181855: Don't let ViewTestBase hog the useful assertBlockAppears and assertNoBlockAppears methods is committed first and I'd be happy to make those updates.

webchick’s picture

Status: Reviewed & tested by the community » Needs work

That did indeed make it in!

star-szr’s picture

Assigned: Unassigned » star-szr

Thanks :)

star-szr’s picture

Assigned: star-szr » Unassigned
Status: Needs work » Needs review
FileSize
5.13 KB
2.28 KB

Now making use of assertBlockAppears.

Status: Needs review » Needs work

The last submitted patch, 28: 1874822-28.patch, failed testing.

star-szr’s picture

28: 1874822-28.patch queued for re-testing.

star-szr’s picture

Status: Needs work » Needs review
jhedstrom’s picture

Status: Needs review » Needs work
Issue tags: -Needs tests +Needs reroll
star-szr’s picture

Working on it.

star-szr’s picture

Status: Needs work » Needs review
Issue tags: -Needs reroll
FileSize
5.54 KB
9.35 KB

Most notable change here is in WebTestBase::findBlockInstance():

Changed the XPath from //div[@id = :id] to //*[@id = :id], not all blocks use DIVs - like menu blocks.

Other than that just updating for PSR-4 and some other things, and splitting the multiple instance tests out of the catch-all BlockTest. I can't figure out why testPlaceBlockTwiceVarious isn't passing, manually testing that block works fine but posting this work in progress since I need to run :)

star-szr’s picture

FileSize
5.42 KB
648 bytes

Removing an unnecessary hunk.

The last submitted patch, 34: 1874822-34.patch, failed testing.

Status: Needs review » Needs work

The last submitted patch, 35: 1874822-35.patch, failed testing.

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

tim.plunkett’s picture

Issue tags: -Blocks-Layouts

Not actively part of the Blocks-Layouts work.

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

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should 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.

joelpittet’s picture

Version: 8.3.x-dev » 8.4.x-dev
Status: Needs work » Needs review
FileSize
32.25 KB

Rerolling

Status: Needs review » Needs work

The last submitted patch, 42: 1874822-35-reroll.patch, failed testing.

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

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

Version: 8.5.x-dev » 8.6.x-dev

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

Version: 8.6.x-dev » 8.7.x-dev

Drupal 8.6.0-alpha1 will be released the week of July 16, 2018, which means new developments and disruptive changes should now be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.