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
To ease conversion from WebTestCase, we're adding a bc layer to browsertestbase so that assertions don't have to be converted when tests are.
Some of these might be deprecated, some might be actually useful and need to be part of the API.
This should happen before conversions land so that there is minimal work to do apart from the conversion itself.
Comments
Comment #2
catchComment #3
dawehnerWell, we already have this BC layer, we just expand it over time.
Comment #4
dawehnerIgnore my previous comment, well this is just a tracking issue.
Comment #5
catchLet's make that more obvious from the title :)
Comment #6
dawehnerAnother one: #2795607: Provide a settingsSet method on BrowserTestBase but use an @deprecated tag on it
Comment #7
dawehnerAnother novice one: #2795611: Provide a assertHeader legacy assertion
Comment #8
jmuzz CreditAttribution: jmuzz commentedI have been converting some tests to BTB and I noticed a few small but common changes that had to be made several times. I'm wondering if they should be fixed in BTB rather than the individual tests, if only temporarily for this issue and #2770921: Feb 21st: Convert chunk of WTB to BTB by just moving classes, changing use statements adding traits.
Thoughts? I could create separate issues if these seem like good ideas.
Comment #9
klausiGood ideas, I'm not sure about drupalPostAjaxForm() because those tests should really be converted to JavascriptTestBase if they need to test AJAX functionality. Yes, please create those child issues!
Comment #10
dawehner@jmuzz++
Comment #11
klausiOpened #2814047: BrowserTestBase should implement AssertMailTrait for backwards compatibility
Comment #12
klausiOh, and we have decided to NOT provide compatibility for drupalPostAjaxForm(). Instead, we will convert those tests doing AJAX to proper JavasscriptTestBase tests. See #2809161: Convert Javascript/AJAX testing to use JavascriptTestBase.
Comment #13
catchYep +1 to #12, better to convert once to the right thing.
Comment #14
dawehnerAdded #2820182: Add a LegacyBrowserTestBase which uses every legacy trait we have to make things a bit easier with the trait conversions.
Comment #16
klausiOpened #2862470: Add assertOptionByText() to AssertLegacyTrait for better browser test compatibility.
Comment #17
michielnugter CreditAttribution: michielnugter as a volunteer and at Synetic commentedComment #18
dawehnerI think we have a path for individual conversions now, so I don't consider this as be longer useful. Feel free to disagree and reopen the issue :)
Comment #19
Mile23There are still some pending child issues...