Problem/Motivation
Entity browser is currently lacking test coverage. This is specially noticeable in the area of the Entity reference field widget. Probably the biggest reason for this is lack of support for Javascript testing. Recently we got JavascriptTestBase in core and it seems that we could use it to improve the situation.
Proposed resolution
Create Javascript test which will test Entity reference field widget and related entity browser.
Later we will add more tests in this area, which will cover more complex situations (nested Inline entity forms, nested Paragraphs, ...).
Comments
Comment #2
slashrsm commentedComment #3
thenchev commentedWork in progress. There is still cleanup to do and removing some duplicate code and cs. Currently I have an issue when uploading files with the upload widget and selection on the drop down.
Continuing with the remaining tests and will come back to it later.
Comment #6
thenchev commentedHope this makes it green. some dependency problems and some old code in views yml file so i updated the view.
Comment #7
thenchev commentedexpanded tests, commented out what is currently not working.
Comment #10
chr.fritschLets re-run. Works on my local machine, maybe an unrelated error. But is it correct the the patch runs against Drupal 8.2? It should be against 8.1.7 or 8.1.x-dev
Comment #14
AsadKamil commentedLatest patch applied cleanly to 8.x branch
Thanks
Comment #15
chr.fritschI fixed on of the PluginTests
Comment #18
chr.fritschOk, i fixed one of four failing tests. Any ideas why the others are failing? Locally everything works fine. I don't get it.
Comment #19
thenchev commentedHave also problems with test failing sometimes and then randomly start working. Not exactly sure. Uploaded the patch to see how testbot behaves. Will look into it later but having problems getting consistent behavior...
Comment #20
slashrsm commentedThis is green locally. Let's see what tesbot says about it.
Comment #23
slashrsm commentedLet's try this.
Comment #26
slashrsm commentedComment #28
slashrsm commentedComment #31
mtodor commentedJust to see, what Testbot will say.
Comment #33
mtodor commentedAdjusted failing test.
Btw. This is not finished yet. I'm just testing Testbot.
Comment #34
mtodor commentedSmall refactoring.
@slashrsm: We should continue with this ticket. What is next step?
I would like to see this ticket finished soon, so that we have base for making tests in other tickets too.
A lot of things are fixed these days, but we didn't cover anything with tests.
Comment #37
mtodor commentedAdded @group in Base class.
Comment #40
mtodor commentedAdded @group in Base class.Change Base class to abstract.
Comment #43
slashrsm commentedFew coding standard fixes and added missing schema.
Comment #46
slashrsm commentedComment #49
slashrsm commentedComment #50
slashrsm commentedUncomment few tests/asserts.
Some problems originate in #2771547: In Browser and FunctionalJavascript tests SIMPLETEST_USER_AGENT cookie needs to be set every 5 seconds. We should be able to uncomment more stuff when that lands.
Comment #52
slashrsm commentedI think that we can commit this patch. It is not perfect, but it is waaay better than what we currently have.
I will wait a bit to hear what other contributors to this issue say.
Comment #54
slashrsm commentedYay!
Comment #55
mtodor commentedI see this is already merged. I have attached patch (based on last commit), that should fix test fail (flip-flop) at:
Previous test did check for "llama.jpg" inside entity browser iframe, not in article and I guess that's wrong.
And test would fail on fast execution, that's why it's flip-flopping on PHP 7.
Comment #56
slashrsm commentedCommitted.