Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assess suitability of TodoMVC functional tests #23

Closed
kitsonk opened this issue Sep 1, 2016 · 6 comments
Closed

Assess suitability of TodoMVC functional tests #23

kitsonk opened this issue Sep 1, 2016 · 6 comments
Assignees
Milestone

Comments

@kitsonk
Copy link
Member

kitsonk commented Sep 1, 2016

Related to #16

We should figure out if reusing the TodoMVC tests makes sense for us maintaining TodoMVC. It is a totally separate toolchain to what we already have integrated into the repo. While they are canonical tests, they may are may not be the sorts of tests we need to utilise TodoMVC as a proving ground to detect regressions in our other packages.

So the suitability of the tests and the ease of integrating and using them should be considered.

@matt-gadd
Copy link
Contributor

matt-gadd commented Sep 1, 2016

I ran the todo-mvc tests with the following results:

TodoMVC - dojo2
    When page is initially opened
      1) should focus on the todo input field
    No Todos
      2) should hide #main and #footer
    New Todo
      ✓ should allow me to add todo items (296ms)
      ✓ should clear text input field when an item is added (111ms)
      3) should append new items to the bottom of the list
      ✓ should trim text input (114ms)
      4) should show #main and #footer when items added
    Mark all as completed
      ✓ should allow me to mark all items as completed (73ms)
      ✓ should correctly update the complete all checked state (128ms)
      ✓ should allow me to clear the completion state of all items (69ms)
      ✓ complete all checkbox should update state when items are completed / cleared (126ms)
    Item
      ✓ should allow me to mark items as complete (306ms)
      ✓ should allow me to un-mark items as complete (272ms)
    Editing
      ✓ should focus the input
      ✓ should hide other controls when editing
      ✓ should save edits on enter (145ms)
      ✓ should save edits on blur (183ms)
      ✓ should trim entered text (158ms)
      5) should remove the item if an empty text string was entered
      ✓ should cancel edits on escape (120ms)
    Counter
      6) should display the current number of todo items
    Clear completed button
      7) should display the correct text
      ✓ should remove completed items when clicked (154ms)
      ✓ should be hidden when there are no items that are completed (119ms)
    Persistence
      8) should persist its data
    Routing
      ✓ should allow me to display active items (142ms)
      9) should respect the back button
      ✓ should allow me to display completed items (242ms)
      ✓ should allow me to display all items (317ms)
      ✓ should highlight the currently applied filter (169ms)


  21 passing (36s)
  9 failing

we should probably make an effort to fix these up so we're at least spec compliant.

the test infrastructure is fairly simple, the travis yml simply downloads chromedriver, sets up a virtual framebuffer then runs the tests:
https://github.com/tastejs/todomvc/blob/master/.travis.yml

the main annoyance overall is that there is no way to pull the tests without pulling down the full github repo with all the frameworks in (which is massive). to go with that the runner will only let you select from frameworks in the folder structure of the todo-mvc repo.

with that in mind, we should probably just port the tests to intern - matching the assertions and selectors where possible (the test themselves test the spec well). the advantages of doing so would be that in future if we officially submit the dojo 2 todo mvc to the todo-mvc project, we can be fairly sure it's going to pass their tests (which are a requirement of submission).
The selectors are here: https://github.com/tastejs/todomvc/blob/master/tests/page.js
The assertions are here: https://github.com/tastejs/todomvc/blob/master/tests/testOperations.js

@tomdye
Copy link
Member

tomdye commented Sep 2, 2016

Nice work @matt-gadd. Porting the tests to intern sounds like a good approach. Keeps us using the same assertions / test spec but within our own framework.

@rishson
Copy link
Contributor

rishson commented Sep 2, 2016

Nice one @matt-gadd . From a product standpoint, I think submission to todoMVC is something we would like to do for D2, so whatever allows us to do that is a worthwhile exercise. @matt-gadd or whoever will fix/port the tests, could you add a real quick points estimate to this issue please and assign yourself?

@agubler
Copy link
Member

agubler commented Sep 2, 2016

@rishson probably needs another issue/story for the porting assuming that is the agreed approach. This ticket was to evaluate integrating these tests, which I think @matt-gadd has done 😄

@rishson rishson added the todoMVC label Sep 2, 2016
@matt-gadd
Copy link
Contributor

as a side note I've also raised an issue on todo-mvc here: tastejs/todomvc#1687

@rishson
Copy link
Contributor

rishson commented Sep 2, 2016

Closing this issue now as the assessment is complete. The progress of writing the actual functional tests will be in #24

@rishson rishson closed this as completed Sep 2, 2016
@rishson rishson added this to the 2016.09 milestone Sep 2, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants