Monday, March 21, 2011

Using FITNesse and Selenium for acceptance testing, example 2

This example is about using FITNesse QueryTable fixture with Selenium. Let's consider next scenario. There is a list of SharePoint sites and an administrator can grant permissions to users for any site in this list. A result of such action is a report that contains list of the users with sites they have permissions for.

The best way to check that the action is competed succefully is to check that given user is presented in this report and has appropriate permissions set. It is very easy to do using the QueryTable fixture.

Just define a class with the query method and a constructor that takes a user name. Pay attention that this QueryTable class should aggregate the Browser class instance to access data on the html page.

But actually here is a problem. An architecture of FITNesse does not allow the PermissionsActionsReport QueryTable class instance to access existed instance of the Browser class that was used to make the action and that contains the result of this action. Fortunately this obstacle can be solved easy using the singleton pattern.

No comments:

Post a Comment