Core is deprecating SimpleTest for Drupal 9 and converting all the tests #2735005: Convert all Simpletest web tests to BrowserTestBase (or UnitTestBase/KernelTestBase).
We should also do this.
#2753877: Convert ParagraphsAccessTest and ParagraphsExperimentalAccessTest to PHPUnit
#3077720: Convert ParagraphsExperimentalTypesTest to PHPUnit
#3077844: Convert ParagraphsExperimentalPreviewTest to phpunit
#3077846: Convert ParagraphsAddModesTest and ParagraphsExperimentalAddModesTest to PHPUnit
#3077847: Convert ParagraphsAdministrationTest and ParagraphsExperimentalAdministrationTest to PHPUnit
#3077848: Convert ParagraphsEditModesTest and ParagraphsExperimentalEditModesTest to PHPUnit
#3077849: Convert ParagraphsTranslationTest and ParagraphsExperimentalTranslationTestto PHPUnit
#3077851: Convert ParagraphsLibraryItemTest to PHPUnit
Comment | File | Size | Author |
---|---|---|---|
#18 | 2752659-18.patch | 97.32 KB | Lendude |
#18 | interdiff-2752659-16-18.txt | 76.39 KB | Lendude |
#16 | 2752659-16.patch | 161.15 KB | Lendude |
#16 | interdiff-2752659-13-16.txt | 15.94 KB | Lendude |
#13 | 2752659-13.patch | 149.02 KB | Lendude |
Comments
Comment #2
yobottehg CreditAttribution: yobottehg commentedComment #3
yobottehg CreditAttribution: yobottehg commentedComment #4
GoZ CreditAttribution: GoZ at Centarro commentedComment #5
GoZ CreditAttribution: GoZ at Centarro commentedComment #6
jmuzz CreditAttribution: jmuzz commentedFieldUiTestTrait uses assertFieldByXPath so the tests using this trait may need to wait for either #2784537: Add legacy assertFieldByXPath()/assertNoFieldByXPath() method for browser tests to be done or the field_ui module to get converted to unit tests for #2735005: Convert all Simpletest web tests to BrowserTestBase (or UnitTestBase/KernelTestBase). field_ui doesn't seem to have its own issue currently.
Comment #7
jmuzz CreditAttribution: jmuzz commentedI made a patch for field_ui. Together the patches in these two issues should make it possible to convert the paragraphs tests that are using using FieldUiTestTrait.
#2784537: Add legacy assertFieldByXPath()/assertNoFieldByXPath() method for browser tests
#2794347: Convert web tests to browser tests for field_ui module
Comment #8
chr.fritschHere is an patch, to convert all tests with one big bang. Currently there are some issues:
But that should be the only issues. I would like to push this issue forward, to have more possibilities in future tests.
Comment #10
Lendude#8 doesn't apply more (at all), this is a start from scratch since core moved quite a bit forward since this was last done. This just moves everything to the right place and namespace, removes some uses of traits that are already in the parent class, and renames drupalPostAjaxForm to drupalPostForm (pretty much what happened in #8 I think).
Lets see what breaks now.
Comment #11
LendudeOk moved the sub module tests too, lets see if it actually runs now....
Comment #12
LendudeOk..moved
ParagraphsCoreVersionUiTestTrait
to a spot where it can actually be found during test runs (I hope).Comment #13
LendudeMissed one
Comment #15
BerdirThanks for starting this. Maybe we should split it up a bit, make it easier to review and get the easy parts in first?
Comment #16
Lendude@Berdir absolutely. This still feels like the easy part though :)
This renames drupalGetTestFiles to getTestFile which is made available in one of the parent classes, so lets see if that caches everything.
And removes one instance of
asXML
So far the only changes are:
There seems to be an issue with the settings of entity_usage (leads to config fails) and I think the messages that this shows, haven't looked into why this does work in simpletest.
Comment #18
LendudeOk so this reverts some of the failing tests back to simpletest so we can work on those separately.
Only other changes are a fix for
Cannot use object of type Behat\Mink\Element\NodeElement as array
.Interdiff might not be that useful due to all the reverting.
Lets see what I missed..
Comment #20
BerdirI wasn't aware that this actually works in so many cases :)
I usually converted them to click() and similar things, this is nice.
Hm..
Probably off-topic to do something about this one here. And I guess it's used a lot.
Maybe just drop the actual logic of the version check and just always do that? Maybe even add a @deprecated and follow-up to remove it?
I'll want to apply it and check what/how much is left, but this seems to be a really good start. Maybe we could create a child issue for this first chunk as this is a meta? There are also various existing per-class child issues, we can probably clean that up and close the duplicate ones, maybe keep some if they happen to be not-yet-converted and complex.
Comment #21
Lendude#20.1 yeah it works but you lose even the pseudo js coverage, so it should really get a follow up to add some basic real JS coverage, but mich less hassle then trying to convert everything to real JS now
#20.2 yeah probably better handled in a follow up
Continuing the work in #2753889: Convert ParagraphsTestBase and the easy-to-convert tests extending it to BrowserTestBase which seems to fit the bill nicely
Comment #22
LendudeMade a new list of child issues since some earlier issues are no longer relevant.
Added #3077720: Convert ParagraphsExperimentalTypesTest to PHPUnit
Comment #23
LendudeComment #24
LendudeAdded issues for the remaining tests, grouped them together if there was a classic and experimental version
Comment #25
LendudeOnly #3077851: Convert ParagraphsLibraryItemTest to PHPUnit still open
Comment #26
BerdirCommitted all of them. Leaving the base classes for now, we still have subclasses of them in paragraphs_collection for example.