Problem/Motivation
Proposed resolution
Tests that have been moved out of scope of this issue:
TourTest: #2767275: Convert web tests to browser tests for tour module
Base class is worked on in TourTest. This test should either be converted in that issue or split into a separate issue and postponed on the tour issue.
RowUITest: #2809553: Convert AJAX part of \Drupal\views_ui\Tests\RowUITest to BrowserTestBase
This test requires a JavascriptTestBase conversion.
PreviewTest:#2863563: Convert PreviewTest WebTestBase to BrowserTestBase and JavascriptTestBase
This test requires a partial JavascriptTestBase conversion and requires a new ViewTestBase class for JavascriptTestBase. Split of into a separate issue so we can postpone it on the JTB base class (#2754171: Create a Views and ViewsUI FunctionalJavascriptTestBase class)
ExposedFormUITest:#2864610: Convert ExposedFormUITest in views_ui module to BrowserTestBase
The tests keeps failing on the radio buttons and need more work to get fixed. Moved out of scope to get this issue in quicker.
ViewEditTest:#2864613: Convert ViewEditTest in views_ui module to BrowserTestBase
The tests keeps failing on the language test and need more work to get fixed. Moved out of scope to get this issue in quicker.
Remaining tasks
- Get everything to pass
- Create sub-issues for problematic tests
- Wait for #2862947: Incorrect field assertions in AssertLegacyTrait to get committed.
- Either wait for the views conversion to get in or merge with that patch. (#2863267: Convert web tests of views)
| Comment | File | Size | Author |
|---|---|---|---|
| #115 | 2747167-115.patch | 62.33 KB | michielnugter |
| #115 | interdiff-112-115.txt | 2.65 KB | michielnugter |
| #112 | 2747167-112.patch | 61.22 KB | michielnugter |
| #112 | interdiff-107-112.txt | 2.68 KB | michielnugter |
| #107 | 2747167-107.patch | 60.99 KB | michielnugter |
Comments
Comment #2
dawehnerComment #4
dawehnerTons of test failures still
Comment #5
dawehnerFix a couple of ones.
Comment #6
dawehnerComment #10
klausidebug statement that should be removed?
we use that block creation trait on so many browser tests, i think it should be on BrowserTestBase.
should be ->linkByHref()
same here
should we really do this? Maybe we should fix all invocations to use proper TRUE/FALSE values? We should have at least @todo here to remove this behavior once all invocations are fixed.
Comment #11
dawehnerWell, the trait is part of block module, does it really belong into the generic testing framework?
Comment #12
dawehnerJust rebasing and fixing the feedback
Comment #15
dawehnerJust a reroll for now
Comment #18
lendudeChanges to webassert got committed, reroll without those changes.
Comment #19
lendudeOops this needed to stay in
Comment #22
dawehnerDo you want to move this into a dedicate issue with some explicit test coverage?
Comment #23
lendudeJust looking at the code now and it turn out that this was already added in #2750941: Additional BC assertions from WebTestBase to BrowserTestBase, so Oops, it needs to stay out!
So #18 is the one to build on.
Current HEAD has:
Comment #24
dawehnerAh perfect, thank you for clarifying.
Comment #25
mglamanGiving this a re-roll.
First thing was getting errors over \Drupal\Tests\views_ui\Functional\UITestBase::drupalGet not matching parent.
Comment #26
mglamanThis won't fix everything, but should get us closer.
Comment #28
dawehnerNice to get this patch going again!
This reads a bit dangerous!
Comment #29
mglamanI removed that line because it's tested twice. I might have had a borked merge, patch needed re-roll.
Comment #30
dawehnerAh gotcha, well, than this sounds still like an unnecessary change :)
Comment #31
mglamanPicking this back up at DrupalCon Dublin.
Comment #32
dawehner@mglaman
Feel free to post any progress, no matter how small.
Comment #33
dawehnerThis particular issue could massively profit from #2809181: Provide forward compatibility layer for BrowserTestBase::xpath
Comment #34
mglaman@dawehner, shoot :/ I forgot I had even attempted to pick this up. Drupal Commerce beta ate my time and I don't think I made headway. I think we need some of the other initiative issues to land, like #2784537: Add legacy assertFieldByXPath()/assertNoFieldByXPath() method for browser tests as well to make this simpler.
Unassigning for now.
Comment #36
jofitzRe-roll.
Comment #38
michielnugter commentedWork in progress patch, some namespace and constructor fixes to make some more tests working.
Comment #39
michielnugter commentedReroll for array() to [] conversion.
Comment #40
lendude@michielnugter bit of a jump in patch file size
Comment #41
gaurav.kapoor commentedComment #42
gaurav.kapoor commentedWas trying to build upon #36 and #38 , but none of the patch applies properly.
Comment #43
michielnugter commented@lendude: I forgot the -M tag..
@gaurav.kapoor: I'm planning to work on this issue this week and next week during the Sevilla Dev Days. If you prefer to work on this issue instead, ping me any time on irc or post a message here to let me know so I can work on other issues..
Comment #44
gaurav.kapoor commented@michielnugter : all yours.
Comment #45
dawehner@michielnugter Please ping me if you need any help. Let's run the tests in the meantime.
Comment #49
klausilet's use $this->assertContains() instead the strpos().
unrelated change. This has nothing to do with the conversion, so we need to keep the wrong t() call in place for now.
The (string) cast can be removed, getAttribute() will always return a string.
this change removes the check for the contents, but we should keep it somehow.
same here.
this conversion should not be necessary. The assertFieldByXpath method exists now and should work, right?
same here.
why do we change this everywhere?
I know our assertNoLinkByHref() method ignores the other parameters, but we should change as little as possible in this conversion patch.
same here
Comment #50
michielnugter commentedProgess! Because the list is quite long I decided to to categorize the tests first. What's working with minimal effort and what's not.
Non-working tests
AnalyzeTest.php
CachedDataUITest.php
CustomBooleanTest.php
DisplayAttachmentTest.php
DisplayCRUDTest.php
DisplayPathTest.php
DisplayTest.php
ExposedFormUITest.php
FilterBooleanWebTest.php
FilterNumericWebTest.php
HandlerTest.php
OverrideDisplaysTest.php
PreviewTest.php
RowUITest.php
SettingsTest.php
TaxonomyIndexTidUiTest.php
TokenizeAreaUITest.php
ViewsUITourTest.php
ViewTestBase.php
WizardTest.php
XssTest.php
Working tests
AccessRoleUITest.php
AreaEntityUITest.php
ArgumentValidatorTest.php
ConfigTranslationViewListUiTest.php
ContentTranslationViewsUITest.php
DefaultViewsTest.php
DisplayExtenderUITest.php
DisplayFeedTest.php
DuplicateTest.php
FieldUITest.php
FilterUITest.php
GroupByTest.php
NewViewConfigSchemaTest.php
QueryTest.php
RearrangeFieldsTest.php
RedirectTest.php
ReportFieldsTest.php
ReportTest.php
StorageTest.php
StyleTableTest.php
StyleUITest.php
TranslatedViewTest.php
UITestBase.php
UnsavedPreviewTest.php
ViewEditTest.php
ViewsListTest.php
Gone work some more on this. Will have to postpone on the Tour functional tests and views functional tests, view UI tests are using these bases.
Comment #51
mac_weber commentedI added this missing change.
I reverted this change.
I applied all suggestions from #49.
Tests are still failing on
/core/modules/taxonomy/src/Tests/Views/TaxonomyIndexTidUiTest.php, line 96. I could not find a substitute for methodattributes()in class\Behat\Mink\Element\NodeElement.Comment #52
mac_weber commentedIt seems we sent the patches at the same time.
The error you are getting at
TaxonomyIndexTidUiTest.phpwill be fixed with the first snippet in my comment at #51Comment #55
michielnugter commented@Mac_Weber
I'll merge the patches later this morning and continue working on it at the Sevilla Dev Days. I have @lendude sitting next to me so any question I'll have I can have a quick answer to :)
Comment #56
michielnugter commentedComment #57
michielnugter commentedMerged changes and got another working.
Non-working tests
CachedDataUITest.php
CustomBooleanTest.php
DisplayAttachmentTest.php
DisplayCRUDTest.php
DisplayPathTest.php
DisplayTest.php
ExposedFormUITest.php
FilterBooleanWebTest.php
FilterNumericWebTest.php
HandlerTest.php
OverrideDisplaysTest.php
PreviewTest.php
RowUITest.php
SettingsTest.php
TaxonomyIndexTidUiTest.php
TokenizeAreaUITest.php
ViewsUITourTest.php
ViewTestBase.php
WizardTest.php
XssTest.php
Working tests
AnalyzeTest.php
AccessRoleUITest.php
AreaEntityUITest.php
ArgumentValidatorTest.php
ConfigTranslationViewListUiTest.php
ContentTranslationViewsUITest.php
DefaultViewsTest.php
DisplayExtenderUITest.php
DisplayFeedTest.php
DuplicateTest.php
FieldUITest.php
FilterUITest.php
GroupByTest.php
NewViewConfigSchemaTest.php
QueryTest.php
RearrangeFieldsTest.php
RedirectTest.php
ReportFieldsTest.php
ReportTest.php
StorageTest.php
StyleTableTest.php
StyleUITest.php
TranslatedViewTest.php
UITestBase.php
UnsavedPreviewTest.php
ViewEditTest.php
ViewsListTest.php
Comment #58
michielnugter commentedPostponed on #2862947: Incorrect field assertions in AssertLegacyTrait.
As discussed offline with @klausi the issue will not be postponed on the Tour test. It will be removed from the scope of this issue and moved into the scope of the Tour conversion issue (#2767275: Convert web tests to browser tests for tour module).
Comment #59
michielnugter commentedComment #60
michielnugter commentedUpdate:
Down to the following 'needs work'
DisplayTest.php
ExposedFormUITest.php
FilterNumericWebTest.php
PreviewTest.php
RowUITest.php
WizardTest.php
XssTest.php
Comment #61
michielnugter commentedAlright, after a lot of work I have all but a few that I moved out of scope passing.
WizardTest: #2863267: Convert web tests of views
Base class is in the views module and @lendude is working on that.
TourTest: #2767275: Convert web tests to browser tests for tour module
Base class is worked on in TourTest. This test should either be converted in that issue or split into a separate issue and postponed on the tour issue.
RowUITest: #2809553: Convert AJAX part of \Drupal\views_ui\Tests\RowUITest to BrowserTestBase
This test requires a JavascriptTestBase conversion.
PreviewTest:#2863563: Convert PreviewTest WebTestBase to BrowserTestBase and JavascriptTestBase
This test requires a partial JavascriptTestBase conversion and requires a new ViewTestBase class for JavascriptTestBase. Split of into a separate issue so we can postpone it on the JTB base class (#2754171: Create a Views and ViewsUI FunctionalJavascriptTestBase class)
Some starting notes on the conversion:
Comment #62
michielnugter commentedNote: patch contains other 'stuff' (#2862947: Incorrect field assertions in AssertLegacyTrait and ViewTestBase) that needs to be removed before it can be committed.
Comment #64
dawehner@michielnugter
Thank you for your amazing work here!! A general comment, things like #2747167-61: Convert first part of web tests of views_ui should be also added to the issue summary. This makes it much easier for someone to come in and understand the patch, as they have probably read the issue summary upfront.
This is a nice improvement
This is kind of an unneeded change ;)
Nice improvement!
I wonder whether we could minimize the patch size by applying a string casting inside
clickViewsOperationLinkNitpick: Let's use
$elementinstead of$ElementDo you understand why this was not needed before?
Comment #65
michielnugter commentedThanks very much for the review and kind words!
1,3: Thanks!
2: I inject random 4's into my patches to see if everyone is paying attention ;)
4: Used a string cast, also works!
5: Done!
6: Let's see if the testbot requires them, removed them in this patch. We're having simlar problems in #2863268: Convert web tests to browser tests for tracker module and it only fails on php 7.1.
Furthermore:
- Restored original base classes to make the non-converted tests work
- Still can't get 2 tests to work. One with language problems and 1 with radio buttons. I can't get radio buttons to work, anyone know a place where there are working radio buttons in a BrowserTestBase?
Comment #67
michielnugter commentedI've been discussing with @lendude offline.
Views and views_ui are important to get in fast because a lot of other conversions will be blocked without them. We both have a small set of tests that are giving us a lot of trouble. I propose to split these off into separate issues so we can get the views and views_ui conversions in.
Does this sound like a good idea and should I start splitting them off?
Comment #68
klausiYes, I think that makes sense to make progress here.
Comment #69
michielnugter commentedOk, cool! Thanks for the reply. I'll split the problematic tests into separate issues and make sure the rest pass on all php versions.
Comment #70
michielnugter commentedCreated new issues for the 2 remaining tests (Updated IS here):
#2864610: Convert ExposedFormUITest in views_ui module to BrowserTestBase
#2864613: Convert ViewEditTest in views_ui module to BrowserTestBase
Will post my work-in-progress there.
New patch excludes these tests, let's see what it does now.
Comment #71
dawehnerHow convinced are you about these changes?
Nitpick: Requires an additional new line :P
Oh so the test coverage was actually broken? Negative assertions are always tricky.
Comment #73
michielnugter commentedFixed some incorrect namespaces and the nitpick.
Yeah the negative assertions were broken, really difficult to get those right. The actual fix is in #2862947: Incorrect field assertions in AssertLegacyTrait btw, this patch contains a rough version to make the tests pass. These changes should be removed before commit. The ViewTestBase must also be removed and should use the one @lendude is making in in the views conversion.
Comment #74
michielnugter commented@dawehner
I feel confident on the made changes. They are minimal in every step and were all required to get it to run on phpunit.
Comment #75
lendudeYeah the one in #2863267: Convert web tests of views contains some additional tweaks for BrowserTestBase compatibility.
Comment #77
michielnugter commentedSome wrong namespaces now fixed. Hope it passes, if it does I'll create a clean patch without additions to merge it with views tests.
Comment #78
michielnugter commentedGreen never looked better :) Man it feels good to have this one pass.
Patch without extra's, this one will fail and is only for merging into the views conversion or to be committed after views and the improvement for AssertLegacyTrait is in.
Comment #80
jofitz@michielnugter would you mind summarising the issue IDs this requires and marking this as postponed for now. Feels good to be so close to getting this first chunk in!
Comment #81
michielnugter commentedUpdated the IS and postponed the issue.
Comment #82
jofitz@michielnugter++
Comment #83
michielnugter commentedUpdated patch with deprecation warning on the old UITestbase.
Comment #84
michielnugter commentedMoved the WizardTest out of the views scope and into a separate issue: #2867777: Convert views WizardTestBase tests to phpunit.
IS has been updated.
Comment #85
michielnugter commentedComment #86
michielnugter commentedLet's see what this does now views is in :)
Comment #88
michielnugter commentedRight, slight API changes from the used patch and the one that landed for the field assertions. These are now fixed and the test should go green..
Comment #89
lendudeSome feedback/nits:
$import_test_views should be passed to the parent, this is missed on a number of tests
missing @deprecated
?
if we have a follow up for this, can we add it to the comment? And in the views conversion I did
$data = Json::decode($this->getSession()->getPage()->getContent());and that seemed to do the trick.Comment #90
michielnugter commentedThanks for the review, back to needs work for that.
Comment #91
michielnugter commentedAnd fixed!
Thanks for the hint on FieldTestUI, worked perfectly!
Comment #92
michielnugter commentedGrr, wrong file..
interdiff contains a remove because I rolled the last patch with --find-copies.
Comment #95
lendudeNittiest of nits:
Think we got this to work now! So no need for the @todo
Comment #96
michielnugter commentedMade a bit of a mess I think with my previous patch. I seem to have added deprecation warnings on the new UITestBase class and reverted some of the made changes.
New patch should do everything right and I removed the @todo line :)
Comment #97
lendudeApplied the patch and checked that everything gets moved to the right spot and the deprecations are on the right classes. All looks good. Only thing I can think of is moving
WizardTestback into scope here. The base class is available now and it passes when simply moved.Comment #98
michielnugter commentedSounds like a good plan, I'll work on this sometime today.
Comment #99
michielnugter commentedLots of things changed since the last attempt at ExposedFormUITest and ViewEditTest, lets see if they pass now as well.
Comment #101
michielnugter commentedRight, still failing (among other fails?).
This one only contains the WizardTest extra since #95 and if ok should be able to get committed.
Comment #102
michielnugter commentedComment #103
lendude@michielnugter stop doing too many things at once :)
Pretty sure #101 patch contains a couple of extra lines you didn't want in there, about 30kb worth of them :D
Comment #104
michielnugter commentedLet's see how I do without the massive headache.. :)
Still don't completely understand the interdiff for UiTestBase but that one keeps beeing weird, it's the same as an older version as far as I can tell.
Comment #105
lendudeThis now needs to go inside the setUp method, see #2876145: ConfigTranslationViewListUiTest is a WTB test in the Functional namespace
Comment #106
dawehnerWe could use
assertContainshere. Any thoughts about it?Comment #107
michielnugter commentedFixed #105
#106:
Even though it's not ideal in this way this is the smallest change possible. the goal for the conversions up till now has been to keep the changes to a minimum to ease the review and commit process. Not 100% sure here as I already changed this line of code, should we completely fix each line in the tests to not use deprecated methods and the proper ones or stick with the minimum change policy?
Comment #108
dawehnerI guess I just don't care much enough about that :) We can indeed always come back later and improve things.
Should we postpone this issue for now onto the other one, where we figure out how to actually deprecate test classes?
Comment #109
michielnugter commentedI care up to the level that I know what to do on reviews and conversions. I'm strongly towards not changing if it's not needed to make the conversions low impact, I'm not going to set anything back to Needs review though. We'll have to do the fun initiative to remove all deprecated code some other time, the current BrowserTestBase tests are full of deprecated code usage..
Agree, let's settle that policy first.
Comment #110
dawehnerYou are right, this is totally fair.
Comment #111
michielnugter commentedAs discussed in #2876145: ConfigTranslationViewListUiTest is a WTB test in the Functional namespace the following test needs to either be moved into scope for this issue or a follow-up must be created to convert the ConfigTranslationViewListUiTest test to WebTestBase. Adding Needs followup tag for now.
Comment #112
michielnugter commentedTurned out that ConfigTranslationViewListUiTest was already in this patch :) Deprecation policy was settled and in line with the current state of this issue.
Needed a re-roll now though as the file was moved.
I think it's ready to go, one final review before RTBC and test-bot run would be very much appreciated :)
Comment #113
lendudeManually checked the patch again.
All moves look good. Follow ups have been opened for the remaining 5 tests. Base class deprecation is good. Lets do this!
Removed the wizardtest from the IS since it's in scope now.
Comment #114
lendudeSorry, jumped the gun, I think we missed
\Drupal\taxonomy\Tests\Views\TaxonomyParentUITestComment #115
michielnugter commentedAnd it's back.
Interdiff still contains garbage, it really doesn't like the --find-copies.
Comment #116
lendudeRechecked,
\Drupal\views_ui\Tests\UITestBasenow only gets used by 4 classes, and we have followups for all of them.The rest is still good.
Comment #117
dawehnerNice work!
Comment #119
catchThis looks great, really happy to see this one ready.
Committed/pushed to 8.4.x, thanks!
8.3.x patch release today, so leaving RTBC against 8.3.x for cherry-pick either late today or more likely tomorrow.
Comment #120
lendude@catch thanks so much for committing!
And thanks everybody that put time into this one. Really great to see another big chunk go in.
Comment #121
michielnugter commented@catch++
Thanks for the commit! Awesome to see it finally getting in after so much work!
Comment #123
lendudeQueued the patch for 8.3.x
Comment #124
michielnugter commentedStil green then, back to rtbc
Comment #125
catchCherry-picked to 8.3.x, thanks!