Problem/Motivation
There are several tests that have references to Bartik and Seven:
3 core/modules/help_topics/tests/src/Functional/HelpTopicTest.php
3 core/modules/help_topics/tests/src/Functional/HelpTopicTranslatedTestBase.php
1 core/modules/help_topics/tests/src/Functional/HelpTopicsSyntaxTest.php
These tests should be updated to either use Olivero, Claro, or System module's test_theme so we can deprecate Bartik #3249109: Deprecate Bartik and Seven #3084814: Deprecate Seven theme as mentioned at #3278124: Convert various tests that use bartik/seven to olivero/claro.
Steps to reproduce
git grep -E '(bartik)|(seven)' -- 'core/modules/help_topics/tests' | awk -F: '{print $1}' | sort | uniq -c
should return no results when this work is complete.
Remaining tasks
Update the tests.
User interface changes
None.
API changes
None.
Data model changes
None.
Release notes snippet
I don't think we need release notes or a change record.
Comment | File | Size | Author |
---|---|---|---|
#29 | 3281439 MR test.png | 21.64 KB | aarti zikre |
#23 | 3281439-d95-23.patch | 6.65 KB | Spokje |
#23 | interdiff_19-23.txt | 661 bytes | Spokje |
Issue fork drupal-3281439
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
deviantintegral CreditAttribution: deviantintegral at Lullabot commentedComment #3
deviantintegral CreditAttribution: deviantintegral at Lullabot commentedComment #4
_shYReplaced references to the Seven and Bartik.
Comment #6
_shYReworked patch. Correction for the warning message, seems like for the Claro theme they a bit different.
Comment #8
andregp CreditAttribution: andregp at CI&T commented@_shY just a tip for you. It's always a good practice to provide an interdiff between the new patch and the last one so other developers can see clearly what you changed in the code. :)
Comment #9
andregp CreditAttribution: andregp at CI&T commentedThis is what I discovered so far about this issue.
By using the new themes, the element's markup gets completely different and this is part or the reason why the HelpTopicSearchTest.php is failing.
Checking the code and the pages' HTML from inside the tests, I noticed that when we use the method
statusMessageContains('some text', 'warning');
it internally calls forbuildStatusMessageSelector()
that creates a selector like//div[@data-drupal-messages]//div[contains(@aria-label, "Warning message")
(you can see an image of the selector builder attached).The problem is not that the warning message is different with the new themes, but the warning element markup is different (image attached) and because
statusMessageContains()
internally uses a predetermined xpath selector this method can't find the selector. Fortunately we still can check for the warning message by another way, like by replacingwith
It would be nice if that was the only problem (replacing the statusMessageContains() methods), but another problem I found is that the
search/help
page looses the search field with the provided patch (image attached), and I wasn't able to fix this.Comment #10
andregp CreditAttribution: andregp at CI&T commentedThis is a partial patch that fixes the setUp() method and 2 of the 3 tests in HelpTopicSearchTest.php. It still needs work for the testHelpSearch() though.
Comment #11
daffie CreditAttribution: daffie commentedAssign this issue to the parent #3285205: [META] Convert test that use Bartik/Seven to Olivero/Claro.
Comment #12
deviantintegral CreditAttribution: deviantintegral at Lullabot commentedHere's an update that:
Comment #15
deviantintegral CreditAttribution: deviantintegral at Lullabot commentedI converted this to a merge request and fixed the last test failure. This is now ready for review.
Comment #17
nod_added a comment on the MR + needs a reroll
Comment #18
SpokjeHiding now outdated patch files.
Comment #19
SpokjeComment #20
nod_Works for me :) thanks
Comment #21
nod_Need to fix the 9.5 test failures :/
Comment #22
SpokjeMissing file in the d9.5 patch, hang on.
Comment #23
SpokjeComment #24
SpokjeComment #25
nod_all good, thanks :)
Comment #26
lauriiiRemoving the status message type essentially leads into lost test coverage. I think we need to update
\Drupal\Tests\WebAssert::buildStatusMessageSelector
so that it works with Claro 😬Comment #27
nod_updated the 10.x branch to fix the buildStatusMessageSelector method to work with claro
Comment #28
nod_Added a comment
Comment #29
aarti zikre CreditAttribution: aarti zikre as a volunteer and at QED42 commentedVerified merge request for Drupal 9.5.x dev version
https://git.drupalcode.org/project/drupal/-/merge_requests/2476
Testing Steps:
* Install a new Drupal instance
* Add & fetch this issue fork’s repository using
git remote add drupal-3281439 git@git.drupal.org:issue/drupal-3281439.git
git fetch drupal-3281439
* Switch to that branch
git checkout 3281439-update-help-topics
* Clear all catches
* Run git grep -E '(bartik)|(seven)' -- 'core/modules/help_topics/tests' | awk -F: '{print $1}' | sort | uniq -c
Test Result:
This git command return nothing which is expected behaviour
Refer SS
MR result Pass.
Can be move to RTBC.
Comment #30
aarti zikre CreditAttribution: aarti zikre as a volunteer and at QED42 commentedComment #31
lauriiiPosted some feedback on the MR.
Comment #32
nod_adressed feedback, should still be green but waiting on what testbot says.
Comment #34
catch@aarti zikre DrupalCI already indicates whether the MR applies or not, to set something RTBC you should also indicate that you've read the code and that it looks OK. Additionally there's no need to provide a screenshot of command line output. I've removed commit credit for this issue but hopefully it will help for the next one.
Committed/pushed to 10.1.x, cherry-picked to 10.0.x and 9.5.x, thanks!