Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
In #2870453: Convert web tests to browser tests for node module we updated simpletest-based tests to PHPUnit-based ones. However, some were considered out of scope for that issue.
Upgrade tests.(got done in a bulk conversion)- \Drupal\node\Tests\NodeRevisionsTest needs the contextual filter parts moved to a Javascript test
- \Drupal\Tests\node\Functional\NodeTypeTest needs \Drupal\system\Tests\Menu\AssertBreadcrumbTrait
- \Drupal\node\Tests\PagePreviewTest uses drupalPostAjaxForm so that needs to be split to a Javascript test, no issue for that yet on #2809161: Convert Javascript/AJAX testing to use JavascriptTestBase
- Drupal\node\Tests\Views\NodeContextualLinksTest needs to be converted to a Javascript test
This issue catches up on all those.
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
Comment | File | Size | Author |
---|---|---|---|
#10 | 2996030-10.patch | 18.74 KB | Lendude |
#8 | 2996030-8.patch | 18.74 KB | Lendude |
#8 | interdiff-2996030-5-8.txt | 9.21 KB | Lendude |
#5 | 2996030-5.patch | 8.79 KB | Lendude |
#5 | interdiff-2996030-3-5.txt | 5.2 KB | Lendude |
Comments
Comment #2
Mile23#2970017: Fix "Drupal\system\Tests\Menu\AssertBreadcrumbTrait is deprecated in Drupal 8.4.0 and will be removed before Drupal 9.0.0. Instead, use \Drupal\Tests\system\Functional\Menu\AssertBreadcrumbTrait" is postponed on this issue.
Comment #3
Mile23Converts
NodeTypeTest
. Still needs work for the other tests.Needed some assertSession() love because it turns out assertNoRaw() isn't a drop-in replacement.
Comment #4
Lendude@Mile23 thanks for getting the ball rolling here, looks good so far. NW for the rest!
Comment #5
LendudeSome progress.
NodeContextualLinksTest::testNodeContextualLinks isn't actually testing anything at the moment, the actual assertions are all commented out, so we can just take that out and not lose any coverage. We do need a followup to make sure it gets some proper javascript coverage.
Comment #6
dawehnerHere is a follow up #2998393: Add javascript test for NodeContextualLinksTest:: testNodeContextualLinks
The entire contextual links test is weird, not just the one without any assertions.
Comment #7
Mile23#5 still leaves us with two WTB tests:
Drupal\node\Tests\NodeRevisionTest
Drupal\node\Tests\PagePreviewTest
Comment #8
LendudeThis takes care of the remaining tests.
The ajax use is PagePreviewTest was pointless and I've replaced it with normal button clicks.
I've split the contextual links stuff from NodeRevisionTest into a WebDriverTest
Comment #10
LendudeBleh, that was against 8.6.x, now against 8.7.x
Comment #11
borisson_I don't see any nits to pick, so moving this to RTBC.
Comment #12
alexpottCommitted 15ca693 and pushed to 8.7.x. Thanks!
Comment #14
alexpottComment #16
alexpottThe patch does not apply to 8.6.x but it does cherry-pick which means it was patch context conflict and not change conflict so I've gone ahead and backported to 8.6.x to keep the tests aligned.