Friday 26 June 2020

Sprint 5 Car Sharing, Load indicators and Lots of Testing

Adding a vehicle to the car share.

The final element of the core features of a trip is the car sharing.  Adding a car involves a form capturing the details.  This introduced the use of time picker components for the leaving and returning times and a slider component for selecting the number of passengers and boats.


A new tab and button to add a car to the trip.



Fill out the details and submit


The car is then added to the trip.

Loading Indication

In an earlier post, I talked about loading indication and disabling parts of the user interface while loading components and data.  In this sprint I implemented these changes based on some of the ideas introduced by the articles that I read.  I decided to use an open source component to hold the loading state, so that my components wouldn't be polluted with loading state variables.

Refactoring Automated Tests

I've spent quite a bit of time this sprint improving the 3 test suites.
  • End 2 End Tests - I have made the web driver functions that drive the suite more generic. These functions mostly now use HTML element by name as the locator which makes the functions more re-usable.  I've also added a mechanism that clears down test data before a run, so that this step doesn't need to be done manually.
  • Angular Component Tests - I've replaced in-test mock test data with a set of re-usable mocks.  As well as being useful to easily mock data for the component testing, I'm finding that they are useful to display some canned data of components when they are being designed.
  • API Controller Tests - I've been using AutoFixture and with and without clauses to build test data and then using FluentAssertions with BeEquivalentTo and ExcludingMissingMembers to build powerful tests with much less code.  I've also anonymised the test data for the shredding tests.

I've also created some more development mode test accounts for manual testing.