Follow-up to #2870459: Convert web tests to browser tests for taxonomy module
Scope:
Convert remaining WebTestBase tests into BrowserTestBase tests.
| Comment | File | Size | Author |
|---|---|---|---|
| #35 | 2887134-34.patch | 14.24 KB | lendude |
| #35 | interdiff-2887134-26-34.txt | 801 bytes | lendude |
| #26 | interdiff.txt | 1.83 KB | mile23 |
| #26 | 2887134_26.patch | 14.01 KB | mile23 |
| #24 | interdiff.txt | 4.24 KB | mile23 |
Comments
Comment #2
naveenvalechaComment #3
naveenvalechaComment #4
goz commentedComment #5
goz commentedComment #7
naveenvalechaBlocker #2887099: Menu: convert system functional tests to PHPUnit has landed
Comment #8
naveenvalechaupdating IS
Comment #10
nlisgo commentedConverting:
Comment #11
nlisgo commentedComment #13
borisson_This was the reason the test failed earlier, I tried to retest to try make this pass, but it gave the same issue.
Comment #14
nlisgo commentedI'm not sure how the entry for phpunit was added to composer, I will remove it and resupply the patch.
Comment #15
nlisgo commentedComment #18
mile23Patch will need a reroll after #2969805: Fix "Drupal\taxonomy\Tests\TaxonomyTranslationTestTrait is deprecated in Drupal 8.4.0 and will be removed before Drupal 9.0.0. Instead, use \Drupal\Tests\taxonomy\Functional\TaxonomyTranslationTestTrait", or this issue might make that one a duplicate.
Comment #19
mile23Golly, what a pain: #2767655-54: Allow WebAssert to inspect also hidden fields :-)
I converted
TermTest::testTermReorder()before I realized it's supposed to be a JS test. However, I think I got it and we don't need the JS coverage, unless dragging the items around is important.In
RssTest::testTaxonomyRss()I was unable to get the css selector to work, so I verified that it's an RSS feed by checking the Content-Type header.Comment #21
mile23Bad namespace! No biscuit!
Comment #22
borisson_Awesome, this is looking great now.
Comment #23
mile23Thanks. But there are still some tests in taxonomy/src/Tests that we need to convert.
Comment #24
mile23This patch finishes the move. All that remains in
taxonomy/src/Testsis a base class and two traits, all deprecated.It also turns #2969805: Fix "Drupal\taxonomy\Tests\TaxonomyTranslationTestTrait is deprecated in Drupal 8.4.0 and will be removed before Drupal 9.0.0. Instead, use \Drupal\Tests\taxonomy\Functional\TaxonomyTranslationTestTrait" into a duplicate.
Comment #25
lendude@Mile23++ looking great.
Not quite a 1:1 conversion, can we check the version too? Did a quick search and I didn't see any other test checking this, so I feel we are loosing a bit of coverage here.
nice!
Nice refactor, but I'm guessing its unrelated to getting the test to pass?
NW to get an answer on #1
Comment #26
mile23Thanks.
Re: #25
1) Lots of hair-pulling about that. It turns out that
$session->getContent()->find()only works for HTML, even using an xpath. Must use$session->getDriver()->find().2) All praise to @berdir. #2767655-54: Allow WebAssert to inspect also hidden fields
3) Reverted.
Comment #27
lendudeRe #26.1: I think it is because of
\Behat\Mink\Element\DocumentElement::getXpaththat every xpath gets prefixed by //htmlThis looks good to me.
Comment #28
alexpottCommitted and pushed 9547959081 to 8.7.x and 917f75bc59 to 8.6.x. Thanks!
Comment #31
tacituseu commentedThis introduced test failures on 8.7.x:
https://www.drupal.org/pift-ci-job/1065875
https://www.drupal.org/pift-ci-job/1065877
Comment #34
alexpott@tacituseu thanks! Reverted from both branches.
Comment #35
lendudeTook out the deprecated call.
Not sure how good of an idea it is to do things like #2970052: Fix "assertNoPattern() is deprecated and scheduled for removal in Drupal 9.0.0. Use $this->assertSession()->responseNotMatches($pattern) instead" already, since it will make doing minimal conversions harder and harder.
Comment #36
volegerChanges in #35 addressed #31
Test looks good
+1 for RTBC
Comment #37
claudiu.cristeaNo, I don't think we should do this. We are quitting the user perspective, which should be the core of functional tests. My point is that this test should be a JS test. We should do what the user is doing and not hack into the form hidden inputs.
I'm moving back to NR for an evaluation.
Comment #38
lendude@claudiu.cristea the scope here is not to make the test better, it's to convert it to BrowserTestBase. The original WebTestBase did exactly the same thing except that Simpletest is way less concerned about what a user can and cannot do, so it didn't involve any hacky workarounds to submit hidden fields.
Would it be nice to also have a Javascript test for this? Sure, but that is not the scope of this issue.
Moving back to RTBC per #36
Comment #39
claudiu.cristea@Lendude, till now the rule was to make the conversion for such cases. But if we plan to keep this patch simple, at least we need a followup to convert TaxonomyTermIndentationTest into a JS test.
Comment #40
lendudeFiled the follow up for this #2999441: Convert or supplement TaxonomyTermIndentationTest with a javascript test
Comment #41
mile23Comment #42
alexpottCommitted and pushed dc4adc5723 to 8.7.x and 277a7055e8 to 8.6.x. Thanks!