Using the application

Now, we can look back at our end-to-end test. We assumed there that we can just use relative URLs in it like /customers/add, but as we learned in the Routing 101 section, to do so, we need to tweak our web server to understand routes without the index.php related part. Let's assume you've done it already for simplicity.

That's what you should get when you destroy your deploy machine, recreate it, and redeploy your application there, and run the acceptance tests from your own machine pointing to the deploy machine:

Using the application

Let's walk through the UI manually, though.

For exactness, let's assume your deploy machine is reachable at http://localhost:8080/. Then, after the clean deploy, first you open up the Add New Customer UI at http://localhost:8080/customers/add, and fill the fields with something. Remember the phone number you entered. Then you click on the Submit button and end up at the List Customers UI, which tells you that no results were found. Have a look at the following screenshot:

Using the application

It's clear that a feature is missing here: when we are on the List Customers UI we expect to see all the customers recorded in the database. Right now, this UI works like the Query Results UI really.

Manually move to the http://localhost:8080/customers/query, and you end up in the Query Customers UI. Paste the remembered phone number in the query field and hit Search. Have a look at the following screenshot:

Using the application

You should end up on the List Customers UI, which tells you that only one record is found and lists the details about this record. In fact, even if there are several customers with the same phone, we know right from the source code that the system will return only one record to us anyway. That's another feature missing for us. Not mentioning that, we allow only one phone number per customer.

Let's end the session now and get out to conclude this chapter.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.188.119.81