Closed (fixed)
Project:
Drupal core
Version:
8.4.x-dev
Component:
contact.module
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
6 Jun 2016 at 03:32 UTC
Updated:
2 Apr 2017 at 13:13 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
naveenvalechaComment #3
naveenvalechaassigning to myself. will work on it tonight
Comment #4
naveenvalechaComment #5
dawehnerLet's unassign, so someone else could pick it up.
@naveenvalecha of course you can pick it up at any point in time :)
Comment #6
naveenvalechaSorry for being late here. I was busy with my practicals exams. Assigning back to myself.
This test also includes the patch #2750941: Additional BC assertions from WebTestBase to BrowserTestBase as it depends on couple of assertion helpers of that module.
This patch will fails let's see what ci throws.
How about the tests that are extending viewsTestBase, should we cover this in chunks OR rely on views module conversion first ? how are you dealing with those ? cc / @dawehner / @klausi ?
Comment #7
dawehnerLet's do that in their own subissue. They will probably take some time, given the speciality of views.
Comment #9
dawehnerI totally believe that we should have a dedicated issue for those issues.
This code in
ContactSidewideTestis now problematic, asclickLink()no longer supports$i.Note: There are methods which no longer support a $message, like.
$this->assertResponse(200, 'The page exists');Let's drop those unused parameters.
Let's rather rename the usages
PS: @naveenvalecha Do you mind including review only patches? They are really helpful to focus.
Comment #10
naveenvalechaIncluded the patch https://www.drupal.org/node/2750941#comment-11320591
Addressed :
#9.2
This assertion is failing
Failed asserting that false is true. Other ContactPersonalTest.php 111 Drupal\Tests\contact\Functional\ContactPersonalTest->testPersonalContactAccess()Did not find the exact reason of this failure.
The conversion of assertUniqueTextHelper is quite confusing here.
Mink does not provide any helper function out of the box to find the unique text on the page and we can't access the getPage() method of Webassert directly in AssertLegacyTrait. So not sure how to proceed with that.We have only responsePageContains/pageTextContains method exists in it and we have getTextContent method exists in BrowserTestBase
Here's the chunks of code that I tried :
Unassinging from myself until i get some clue/feedback on how to achieve / proceed with this.
Comment #11
naveenvalechaComment #12
dawehner@naveenvalecha
I think the right strategy is to add the helper function to WebAssert in Drupal itself ...
Comment #14
claudiu.cristeaPartial work. Still fails because it seems that \Behat\Mink\WebAssert::pageTextNotContains() is not correctly extracting the text from the HTML page.
Comment #16
dawehnerThank you for this patch!
Please put
into your git config, see https://www.drupal.org/documentation/git/configure
Also note: This patch includes a book module change, even this issue is just about contact module :)
Comment #17
claudiu.cristea@dawehner, yes I noticed. The patch is not usable. Sorry, I'll get back.
Comment #18
claudiu.cristeaHere's the correct patch. interdiff is OK from #14
Comment #22
naveenvalechaThe 2742995-22.patch also used
assertUniqueTextfrom this patch and its also baked into it. https://www.drupal.org/node/2759879#comment-11419115Also it added a new method
assertCacheContextto AssertLegacytrait.phpComment #24
klausiwe should rename the methods same as SimpletTest does so that we don't need to change this line.
we should add the assertNoFieldChecked() method to the AssertLegacy trait instead and not change this line.
same here.
I think for maximum compatibility we should add AssertMailTRait to BrowserTestBase instead to keep parity with SimpleTest.
use assertCotains() instead.
Comment #25
dawehnerWell we should have some BC layer in place, but IMHO putting Drupal on there, just conceptually doesn't make sense.
Comment #27
klausiRerolled and some progress, but this will still fail. Contains:
* #2784263: Move WTB::assertCacheContext() to AssertPageCacheContextsAndTagsTrait
* #2784427: Browser tests: Plain page text contains CSS styles and JS settings
* #2773733: Fix AssertLegacyTrait::assert(No)Text to handle html encoded strings (part 3)
Comment #29
klausiAnd we also need #2784537: Add legacy assertFieldByXPath()/assertNoFieldByXPath() method for browser tests for this conversion patch, rolled that in.
Now all contact module tests are converted, except for Views tests and Update Path tests.
Comment #31
claudiu.cristeaShouldn't be here. Part of #2784537: Add legacy assertFieldByXPath()/assertNoFieldByXPath() method for browser tests.
These changes were deferred to #2773733: Fix AssertLegacyTrait::assert(No)Text to handle html encoded strings (part 3).
So, the parent getText() doesn't remove style and script? Also here the output will contain encoded entities while parent::getText() return decoded entities (as a human would read them). See #2773733: Fix AssertLegacyTrait::assert(No)Text to handle html encoded strings (part 3). I think we should get first parent::getText() and apply changes against that. I'm not sure about the solution and, as we did in every conversion, this should be split in other issue.
Postponing on #2784537: Add legacy assertFieldByXPath()/assertNoFieldByXPath() method for browser tests and #2773733: Fix AssertLegacyTrait::assert(No)Text to handle html encoded strings (part 3).
Comment #32
naveenvalechabetter title
Comment #34
jibranComment #35
jofitzComment #36
jofitzRe-roll. I'm not 100% certain of the file locations - the previous patch was noticeably different to 8.4.x.
Comment #37
klausiLooks like you forgot to move the files to the tests directory?
Comment #38
jofitzAs I said, I'm uncertain of the correct file locations, can you give me a hand @klausi? Which files should be where in this case? That should help me for future issues too. Thanks
Comment #39
klausithey should be in tests/src/Functional of the module. See for example https://www.drupal.org/commitlog/commit/2/4c64f7b840ed4cbd1d075b3f409225...
Comment #40
jofitzHow about this then?
Comment #41
klausiA rename is not enough, you also need to change the namespace in this file.
I think the update path tests are special and we might not be able to convert them in this issue.
unrelated change, we should not change BrowserTestBaseTest in this issue.
same here, this is all coming from other patches form other issues and should not be included in this patch.
Comment #42
jofitznamespace Drupal\Tests\contact\Functional;not correct?Comment #44
jofitzViews/tests back toTests/Views/.Comment #46
bighappyface commentedI can reproduce the exception for
Drupal\Tests\contact\Functional\ContactSitewideTestComment #47
bighappyface commentedSame exception verified for
Drupal\Tests\contact\Functional\ContactStorageTestComment #48
claudiu.cristeaComment #50
claudiu.cristeaMore clear.
Comment #51
bighappyface commented+1 LGTM - #50 verified
Comment #53
jofitzRe-rolled.
Comment #54
jofitzSetting back to RTBC in expectation.
Comment #56
jofitzI forgot to move the files.
Comment #57
klausiLooks good, thanks!
Comment #58
alexpottCommitted and pushed 9e85f54 to 8.4.x and 6755fc9 to 8.3.x. Thanks!
Comment #62
rajab natshah