-
Notifications
You must be signed in to change notification settings - Fork 876
test(toh-[234]): add e2e for Dart and TS #1785
Conversation
@Foxandxss @filipesilva @kwalrath @thso : ready for review. |
fa01120
to
e321be7
Compare
I have mixed feelings about this. I understand that the tests shares a lot, but I feel like the tests are now a bit overkill for what they should accomplish. But that is just me :/ |
Do you mean "overkill" in the sense that too much functionality is being tested? |
On the good side, the tests did uncover (minor) problems with the apps. :) |
Overkill in terms that we are creating too many files for something that should be simple. And yes, that is the good side of tests. I want the tests, that for sure. I also understand that toh is an special case for this. |
Right, this is a special case. The given module breakdown allows toh-2, -3, and -4 to reuse the same tests (because the app changes are only internal). This makes for DRY tests. |
The alternative would be to copy-paste tests, which I think we prefer not doing. |
All for tests factoring and reusability. The other option is to use Page Objects with some kind of extention/inheritance but would still imply a fair bit of copy paste so I don't think it's ideal. |
Thanks for pointing out page objects (the Is there any chance that this might get reviewed and merged before the long week-end? :) |
It lgtm tbh. |
399cf30
to
79799a8
Compare
d773b66
to
9c1094c
Compare
Sorry but I have a different perspective on this. I'm generally in favor of DRY. But not when it comes to sharing content-specific material/tests across samples. Test infrastructure? Of course we do! But specific tests? I'm uncomfortable with that. Why? Because it binds the toh parts together. Now I can break tests for toh-2 when I make changes to toh-4. I don't like that kind of vulnerability. I DO like that you uncovered some bugs. Let's fix those independently. Otherwise, ... sorry ... I'm declining this PR. Leaving it open (briefly) to allow comments and so you can mine the bug fixes in a separate PR. |
@wardbell : thanks for the feedback. Allow me to defend this approach one last time (in case it might waver your opinion). I generally agree with you points (e.g., if this were test infrastructure sharing between unrelated chapters), but:
Given the tight coupling between the toh parts, by design, I believe that sharing some test infrastructure has more benefits than risks. And essentially what you are asking me to do now is to proactively ditch the DRYness rather than do it down the line if/when it is needed. My 2 cents. Let me know what you think. |
6d5fe5b
to
8ec4012
Compare
df6e178
to
fad944f
Compare
I'm sorry, Patrice, but I'm going to have to insist on the "non-DRY" part. I hate doing that. I hate it more because my instincts align with yours. But that just isn't how ToH is set up. Observe that the ToH code samples do not share code. They too are far from DRY. Your argument in favor of DRY would apply equally there. And yet we didn't do it. Why? Because we decided - rightly or wrongly - to insulate each ToH tutorial for its comrades. If we change that, we can change the tests. I don't think we should be DRY in the tests and WET in the code. We don't have time to revisit that decision now. I'm sorry. Hate to be heavy handed. Please forgive me. |
I understand your reasons. Will split this up into two PRs (fixes vs e2e tests) and make the e2e tests independent as you recommend. Thanks for hearing me out. |
From the user's perspective toh-2 to -4 all have the same behavior. This PR introduces e2e tests for all these parts by sharing test suites. **3 minor bugs** were detected by the tests and are fixed in this PR. The toh-1 tests introduced in angular#1620 are - Refactored so as to be easier to reuse for the other parts. - Rewritten to benefit from the availability of async/await. Suites passed: - public/docs/_examples/toh-1/dart - public/docs/_examples/toh-1/ts - public/docs/_examples/toh-2/dart - public/docs/_examples/toh-2/ts - public/docs/_examples/toh-3/dart - public/docs/_examples/toh-3/ts - public/docs/_examples/toh-4/dart - public/docs/_examples/toh-4/ts Contributes to angular#1619. Fixes angular#1609. Now the toh-4 index.html is identical to those of the previous parts.
fad944f
to
06b68dc
Compare
Note: tests are identical to those of toh-2. Contributes to angular#1619. Supersedes angular#1785. Suites passed: - public/docs/_examples/toh-4/dart - public/docs/_examples/toh-4/ts
Note: tests are identical to those of toh-2. Contributes to angular#1619. Supersedes angular#1785. Suites passed: - public/docs/_examples/toh-4/dart - public/docs/_examples/toh-4/ts
From the user's perspective toh-2 to -4 all have the same behavior.
This PR introduces e2e tests for all these parts by sharing test suites.
3 minor bugs were detected by the tests and are fixed in this PR.
The toh-1 tests introduced in #1620 are
Suites passed:
Contributes to #1619.
Fixes #1609.
Now the toh-4 index.html is identical to those of the previous parts.