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
checkForMetaRefresh() is used in drupalGet() and drupalPostForm() in old Simpletest. We need to do the same for BrowserTestBase so that tests involving Batch API work.
Proposed resolution
Implement that on BrowserTEstBase and convert Batch API tests to prove it works.
Remaining tasks
Patch.
Comment | File | Size | Author |
---|---|---|---|
#16 | interdiff-2855942-14-16.txt | 665 bytes | dagmar |
#16 | 2855942-16.patch | 6.7 KB | dagmar |
#16 | 2855942-16-test-only.patch | 3.24 KB | dagmar |
#14 | 2855942-14.patch | 6.82 KB | dagmar |
#14 | 2855942-14-test-only.patch | 3.37 KB | dagmar |
Comments
Comment #2
claudiu.cristeaPatch.
Comment #3
claudiu.cristeaComment #5
claudiu.cristeaNo, this issue should redefine its objectives because: The workaround for a trait to serve both,
WebTestBase
andBrowserTestBase
is too ugly and we don't want to push such ugliness in core. My proposal is to create a clean trait ONLY forBrowserTestBase
tests and let theWebTestBase
as it is. Anyway we'll get rid of it in D9.The problem now is that we don't have a use-case to test the new trait/method. For this reason I think we should move this trait addition back to #2757023: Convert all aggregator web tests to BrowserTestBase wher we have such a case. Opinions?
Comment #6
claudiu.cristeaComment #7
dawehnerCan we somehow provide a test to check that this works? Can we maybe convert one of the tests, like the batch tests to see whether stuff works?
Comment #8
claudiu.cristea@dawehner, quoting myself from #5:
TL;DR: Close this in favour of #2757023: Convert all aggregator web tests to BrowserTestBase
Comment #9
GoZ CreditAttribution: GoZ at Barbe-Rousse, Centarro commentedmoved to #2757023: Convert all aggregator web tests to BrowserTestBase
Comment #10
dagmarSorry to reopen this, but I checked #2757023: Convert all aggregator web tests to BrowserTestBase and don't see how this trait is being used.
From #7
I found a use case here #2863372: Convert dblog web tests to BrowserTestBase where canceling a user account trigger the batch api. As I mentioned in #2863372-7: Convert dblog web tests to BrowserTestBase I'm not sure if the way the trait functionality is used is the right one.
Anyway, I'm reopening this because now we have 3 tests that require this trait, maybe we can use the use case I mentioned before to check if this is working as expected.
Comment #11
dawehnerI agree with @dagmar here, we should fix this here as its needed in multiple places.
We should also note that just adding the method will not make
drupalGet
magically work.Comment #12
dagmarHere is the conversion of the
UserCancelTest
because almost doesn't need major changes and basically fails due the lack of batch api support by BTB. It proves theMetaRefreshTrait
provides a really useful feature.Locally I have one fail. I'm not sure if is an error on the batch implementation or in the user module.
Comment #14
dagmarComment #16
dagmarFor some reason I couldn't determinate the
getTextContent()
is not returning the content of the admin/people screen. I'm removing the problematic line of code for now, maybe someone else can say what is going on here.Comment #18
klausiIt looks like we will need checkForMetaRefresh() on BrowserTestBase directly because drupalGet() and drupalPostForm() also use it in old Simpletest. We want Batch API pages to be executed automatically, same as we did in old Simpletest, so I think we should add this directly. Sorry for the confusion.
So I would propose that we convert modules/system/src/Tests/Batch to browser tests with this issue, that will give us the functional test coverage when we add checkForMetaRefresh() within BrowserTestBase. See also #2862885: Batch: Convert system functional tests to phpunit.
Comment #19
dawehnerI totally agree. I think we should actually not convert the user tests as well and instead just convert the batch ones.
Comment #20
dagmarThe real progress is happening here: #2862885: Batch: Convert system functional tests to phpunit