Synch point for a context is important
Setting up Synchronization point for a Context is very important. During test execution, it provides an automated way to ensure the page is fully loaded before acting on it.
At the same time, when the desired page is not loaded during test execution, you can avoid multiple wait times. Typically system waits at each statement looking for element relevant for that statement. This cumulative wait time can considerably delay test result, which is totally avoidable by setting up a sensible synchronization point at the context level.
Synchronization point provides an easy and implicit check point to abort the test case in case of application errors.
Context is not just limited to a page on your application
A Context is a logical entity that represents a particular state of you application. Although in majority of cases it may be equivalent to a page on the application, there are quite a few exceptions. You may be able to group multiple pages in one Context if all these pages are intimately related and cannot probably accomplish any consistent action independently. Group them into a single Context and have multiple Views associated with it. An action in this Context can freely make use of all the associated views.
On the same note, it is important to realize that minor state changes to a page do not warrant definition of new context. For example, when you hover on a doormat menu, you may be presented with additional fields you can interact with. This is just an additional View to the same context.
In order to ensure long term modularity and reusability of test assets, it is very important to identify Context boundaries appropriately. Keep the following guidelines in mind.
- A Context should offer a distinct set of user actions, not just a few visual differences
- If a page resulted from a trip to the server, it may likely indicate a new Context (but not always).
- If incremental new functionality is a result of slight alteration in a portion of a screen, it may better be considered as an alternate View of the same Context.
Here are a few helpful articles: