Follow-up to #2752659: [META] Convert SimpleTest Tests to PHPUnit
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.
| Comment | File | Size | Author |
|---|---|---|---|
| #10 | paragraphs-translation_tests-2753891-10.patch | 13.02 KB | jmuzz |
| #2 | 2753891-ParagraphsTranslationTest.patch | 47.04 KB | goz |
Comments
Comment #2
goz commentedComment #6
johnchqueThanks for the patch but I wonder if we really need a javascript based test here? AFAIK extending from BrowserTestBase should be more than enough. Also, extending from JavaScriptTestBase makes the tests slower.
Comment #7
goz commentedWe need JavaScriptTestBase to replace DrupalPostAjaxForm and to "submit" buttons which load embed paragraph entities.
I just figure out this patch is a work in progress. I did it in train yesterday and forgot this morning i hadn't test it. So i continue working on it.
Comment #8
johnchqueI would say that BrowserTestBase::drupalPostForm() can also be called to emulate an Ajax submission. So a browser test should be fine here.
Comment #9
miro_dietikerAs of Berdir: BrowserTestBase does not and will not simulate Ajax.
If you need Ajax emulation, use JavascriptTestBase.
The Paragraphs UI works "perfectly" (although looking ugly) without JS. So the tests can easily do all the things without (simulating or real JS based) Ajax.
IMHO it's fine if we have a few real JS head browser tests that focus on the JS aspects and keep the Translation workflow test non-JS for speed reasons.
Comment #10
jmuzz commentedI think this is a step in the right direction, and testParagraphTranslation() will pass.
The rest of them make use of drupalGetTestFiles() so lets wait until they make a version of the function for PHPUnit before continuing.
Comment #11
berdirClosing as a duplicate.