Problem/Motivation
Because of #3083275: [meta] Update tests that rely on Classy to not rely on it anymore and Classy being deprecated in Drupal 9 + removed in Drupal 10,: Tests that aren't specifically testing Classy yet declare $defaultTheme = 'classy'; should be refactored to use Stark as the default theme instead.
Proposed resolution
Change all tests in this module to use Stark as the default theme, and refactor the tests where needed so they continue to function properly.
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet
| Comment | File | Size | Author |
|---|---|---|---|
| #11 | interdiff_9-11.txt | 496 bytes | danflanagan8 |
| #11 | 3271507-11.patch | 43.43 KB | danflanagan8 |
| #9 | interdiff_4-9.txt | 5.41 KB | danflanagan8 |
| #9 | 3271507-9.patch | 43.23 KB | danflanagan8 |
| #4 | interdiff_2-4.txt | 737 bytes | danflanagan8 |
Comments
Comment #2
danflanagan8This is a fairly big one. But to the extent that any of these issues are exciting, this one is exciting to me. That's because it's the first one where I get to use the brand new status message assertions! #3268932: Add methods to assert status messages to WebAssert
So that's one thing you'll see here. I refactored to use those status message assertions where possible. I think only one of them NEEDED to be refactored, but the new assertions are more readable while being slightly more robust so it's an easy win.
Other changes are fairly typical of these Classy-to-Stark issues, like selecting block elements using the id instead of a class.
Comment #3
danflanagan8Something that is new to this Classy-to-Stark issue is that there were lots of selectors for block regions. In one instance I made a little map of the corresponding selectors. This is basically the mapping I used anywhere I had to make changes to selectors for regions.
Here's another bit of code I wanted to call out.
Obviously I'm changing
HighlightedtoHeaderhere. But the "Highlighted" region does not appear to be special in any way. So I changed to a region that is easier to select with stark.Comment #4
danflanagan8try that again
Comment #5
danflanagan8Updating priority to Major just like @xjm did for #3248295: Taxonomy tests should not rely on Classy and adding D10 tag.
Comment #6
nod_we could look for the image src too? That would be similar to the next selector that looks for a specific text content.
Haven't tried it in the test itself but a xpath selector to select a text node could be
nice one :)
Comment #7
nod_actually probably doesn't need a NW, just some small comments
Comment #8
danflanagan8Thanks for the review @nod_!
Here's a patch with 6.1 and 6.2 addressed. Thanks for the xpath selector in 6.2. That's pretty slick.
And thanks for 6.3. That's actually a case I included in the CR for the brand new methods for asserting status messages: https://www.drupal.org/node/3270424
I also noticed that I had removed a reference to classy in
BlockDemoTest::testBlockDemothat I should not have removed. I have added it back. That is literally test coverage for classy and it needs to remain as long as classy is in core.Comment #9
danflanagan8Of course I forgot the patch...
Comment #11
danflanagan8Oops. I guess I outsmarted myself. We do indeed need to remove classy from the list of themes in
BlockDemoTest::testBlockDemo. Classy does not have a block demo page because it is marked as "hidden", thus the 404. Previously it was getting removed from the array of themes automatically since it was the default theme. So I'm re-removing classy.Comment #12
nod_All good for me, thanks
Comment #13
alexpottCommitted and pushed f88b4a9a8a to 10.0.x and 1876f3f5b1 to 9.4.x. Thanks!