com.funambol.client.test
Interface UserCommands


public interface UserCommands

This component lists all the commands available in the Android automatic test scripting language.


Method Summary
 void BeginTest(java.lang.String name)
          This instruction must be the first one at the beginning of a test.
 void CheckAlertedSyncMode(java.lang.String source, int mode)
          This command checks the alerted sync mode of the last sync.
 void CheckDeletedContact(java.lang.String firstName, java.lang.String lastName)
          This command can used to check that a deleted contact on the server has been correctly deleted in the client.
 void CheckDeletedContactsOnServer(java.lang.String firstName, java.lang.String lastName)
          This command can used to check that a deleted contact sent to the server has been correctly deleted by the server.
 void CheckExchangedData(java.lang.String source, int sentAdd, int sentReplace, int sentDelete, int receivedAdd, int receivedReplace, int receivedDelete)
          This command checks the amount of items exchanged between the server and the client during the last synchronization (for a given source).
 void CheckItemsCount(java.lang.String sourceName, int count)
          This command can used to check that a deleted contact sent to the server has been correctly deleted by the server.
 void CheckItemsCountOnServer(java.lang.String sourceName, int count)
          This command can used to check the total source items count on server side.
 void CheckNewContact(java.lang.String firstName, java.lang.String lastName, boolean checkContent)
          This command can used to check that a new contact created on the server has been correctly received by the client and has the same content of the server's contact as expected.
 void CheckNewContactOnServer(java.lang.String firstName, java.lang.String lastName, boolean checkContent)
          This command can used to check that a new contact sent to the server has been correctly received and has the same content of the device's contact as expected.
 void CheckRequestedSyncMode(java.lang.String source, int mode)
          This command checks the requested sync mode of the last sync.
 void CheckUpdatedContact(java.lang.String firstName, java.lang.String lastName, boolean checkContent)
          This command can used to check that an updated contact on the server has been correctly received by the client and has the same content of the server's contact as expected.
 void CheckUpdatedContactOnServer(java.lang.String firstName, java.lang.String lastName, boolean checkContent)
          This command can used to check that an updated contact sent to the server has been correctly received and has the same content of the device's contact as expected.
 void CreateEmptyContact()
          This command can used to simulate a contact addition.
 void CreateEmptyContactOnServer()
          This command can used to simulate a contact addition on the server.
 void DeleteAllContacts()
          This command can used to simulate the deletion of all the contacts stored in the device.
 void DeleteAllContactsOnServer()
          This command can used to simulate the deletion of all the contacts stored in the server.
 void DeleteContact(java.lang.String firstName, java.lang.String lastName)
          This command can used to simulate a contact deletion.
 void DeleteContactOnServer(java.lang.String firstName, java.lang.String lastName)
          This command can used to simulate a contact deletion on the server.
 void EmptyContactField(java.lang.String fieldName)
          This command can used to simulate a contact update.
 void EndTest()
          Terminates the commands of a test.
 void ForceSlowSync(java.lang.String sourceName)
          This command forces the next sync to be a slow sync for the given source
 void Include(java.lang.String name)
          This command includes another script file.
 void KeyPress(java.lang.String command, int count)
          This command simulates a user action via the device keypad.
 void LoadContact(java.lang.String firstName, java.lang.String lastName)
          This command can used to simulate a contact update.
 void LoadContactOnServer(java.lang.String firstName, java.lang.String lastName)
          This command can used to simulate a contact update on the server.
 void RefreshServer(java.lang.String sourceName)
          This command shall be used everytime the server shall be updated of both client side or server side changes, and before any check command.
 void SaveContact()
          This command can used to simulate a contact addition or update.
 void SaveContactOnServer()
          This command can used to simulate a contact addition or update on the server.
 void SetContactField(java.lang.String fieldName, java.lang.String value)
          This command can used while simulating a contact additon or update.
 void StartMainApp()
          This command starts the main application.
 void Wait(int delay)
          This command suspends the test execution for the given amount of time.
 void WaitForAuthToComplete(java.lang.String minStart, java.lang.String maxTime)
          This command wait for a authentication process to start and finish within a maximum amount of time.
 void WaitForSyncToComplete(java.lang.String minStart, java.lang.String maxTime)
          This command wait for a sync to start and finish within a maximum amount of time.
 void WriteString(java.lang.String text)
          This command simulates a user writing a text through the device keyboard.
 

Method Detail

BeginTest

void BeginTest(java.lang.String name)
This instruction must be the first one at the beginning of a test. For a single test script there is only one of such instruction, while a multi test script may contain several instances.

Parameters:
name - is the name of the test as it will be reported in the final summary.

EndTest

void EndTest()
Terminates the commands of a test.


Include

void Include(java.lang.String name)
This command includes another script file.

Parameters:
name - is the script name. If this is an URL, then the script is fetched from that location, otherwise the base url if the main script is added as prefix to this name

StartMainApp

void StartMainApp()
This command starts the main application. When the test starts the main application is not started until the script triggers this command. This instruction starts the FunambolClient Activity, so it is recommended to run the waitForActivity command in order to verify that it is started correctly.


Wait

void Wait(int delay)
This command suspends the test execution for the given amount of time.

Parameters:
delay - is an integer value expressed in seconds. If the delay is <= 0 then the command wait forever and the script gets interrupted. This is useful if the script shall give the user the possibility to use the application.

WaitForSyncToComplete

void WaitForSyncToComplete(java.lang.String minStart,
                           java.lang.String maxTime)
This command wait for a sync to start and finish within a maximum amount of time. As soon as the sync terminates, the script continues its execution.

Parameters:
minStart - is the time the script waits for the sync to start. If the sync does not start withing this time, the test fails
maxTime - is the maximum time the script is willing for the sync to terminate. If it does not terminate within this limit, the test fails.

WaitForAuthToComplete

void WaitForAuthToComplete(java.lang.String minStart,
                           java.lang.String maxTime)
This command wait for a authentication process to start and finish within a maximum amount of time. As soon as the authentication terminates, the script continues its execution.

Parameters:
minStart - is the time the script waits for the authentication to start. If the authentication does not start withing this time, the test fails
maxTime - is the maximum time the script is willing for the authentication to terminate. If it does not terminate within this limit, the test fails.

KeyPress

void KeyPress(java.lang.String command,
              int count)
This command simulates a user action via the device keypad.

Parameters:
command - the command to simulate. Possible values are:
  • KeyDown to move down
  • KeyUp to move up
  • KeyLeft to move left
  • KeyRight to move right
  • KeyFire to click
  • KeyMenu to open menu
  • KeyBack to return back
  • KeyDelete to delete
count - the number of commands to send (not mandatory)

WriteString

void WriteString(java.lang.String text)
This command simulates a user writing a text through the device keyboard.

Parameters:
text - the text to write (e.g. into an input field)

ForceSlowSync

void ForceSlowSync(java.lang.String sourceName)
This command forces the next sync to be a slow sync for the given source

Parameters:
sourceName - is the name of the source. The value is what is displayed on the main screen for that source.

CheckExchangedData

void CheckExchangedData(java.lang.String source,
                        int sentAdd,
                        int sentReplace,
                        int sentDelete,
                        int receivedAdd,
                        int receivedReplace,
                        int receivedDelete)
This command checks the amount of items exchanged between the server and the client during the last synchronization (for a given source).

Parameters:
source - the source name. The value is what is displayed on the main screen for that source.
sentAdd - the expected number of new items sent
sentReplace - the expected number of replace items sent
sentDelete - the expected number of delete items sent
receivedAdd - the expected number of new received items
receivedReplace - the expected number of replace received items
receivedDelete - the expected number of delete received items

CheckRequestedSyncMode

void CheckRequestedSyncMode(java.lang.String source,
                            int mode)
This command checks the requested sync mode of the last sync.

Parameters:
source - is the source name
mode - an integer representing the expected sync mode

CheckAlertedSyncMode

void CheckAlertedSyncMode(java.lang.String source,
                          int mode)
This command checks the alerted sync mode of the last sync.

Parameters:
source - is the source name
mode - an integer representing the expected sync mode

CreateEmptyContact

void CreateEmptyContact()
This command can used to simulate a contact addition. It creates an empty contact in memory which will be saved as soon as the SaveContact command is called. Once this command is called you shall set the contact's FirstName and LastName fields via the SetContactField command before saving it.


LoadContact

void LoadContact(java.lang.String firstName,
                 java.lang.String lastName)
This command can used to simulate a contact update. It loads an existing contact identified by the given FirstName and LastName fields.

Parameters:
firstName - is the contact firstname
lastName - is the contact lastname

SetContactField

void SetContactField(java.lang.String fieldName,
                     java.lang.String value)
This command can used while simulating a contact additon or update. It sets the given field to the given value.

Parameters:
fieldName - is the contact's field name to edit. It can take one of the following values:
  • DisplayName
  • FirstName
  • LastName
  • MiddleName
  • PrefixName
  • SuffixName
  • NickName
  • TelHome
  • TelWork
  • TelOther
  • TelOther2
  • TelCell
  • TelPager
  • TelFaxHome
  • TelFaxWork
  • TelCompany
  • TelOtherFax
  • EmailHome
  • EmailWork
  • EmailOther
  • Im
  • AddressOther: formatted as post-office;ext-address;street;city; state;cap;country
  • AddressHome: formatted as post-office;ext-address;street;city; state;cap;country
  • AddressWork: formatted as post-office;ext-address;street;city; state;cap;country
  • Website
  • WebsiteHome
  • WebsiteWork
  • Birthday: formatted as yyyymmdd yyyy-mm-dd or yyyy/mm/dd
  • Anniversary: formatted as yyyymmdd yyyy-mm-dd or yyyy/mm/dd
  • Children
  • Spouse
  • Title
  • Organization: formatted as company;department
  • Note
  • Photo
value - is field value to set

EmptyContactField

void EmptyContactField(java.lang.String fieldName)
This command can used to simulate a contact update. It empties the value of the specified field.

Parameters:
fieldName - is the contact's field name to empty.
See Also:
to see the available fields.

SaveContact

void SaveContact()
This command can used to simulate a contact addition or update. It saves the contact actually created or loaded through the CreateEmptyContact and LoadContact respectively.


DeleteContact

void DeleteContact(java.lang.String firstName,
                   java.lang.String lastName)
This command can used to simulate a contact deletion. It removes from the device store the contact identified by the given firstname and lastname.

Parameters:
firstName - is the contact firstname
lastName - is the contact lastname

DeleteAllContacts

void DeleteAllContacts()
This command can used to simulate the deletion of all the contacts stored in the device.


CheckNewContact

void CheckNewContact(java.lang.String firstName,
                     java.lang.String lastName,
                     boolean checkContent)
This command can used to check that a new contact created on the server has been correctly received by the client and has the same content of the server's contact as expected. Remember to run RefreshServer before running check commands.

Parameters:
firstName - is the contact firstname
lastName - is the contact lastname
checkContent - set as true if you want to check the item content.

CheckUpdatedContact

void CheckUpdatedContact(java.lang.String firstName,
                         java.lang.String lastName,
                         boolean checkContent)
This command can used to check that an updated contact on the server has been correctly received by the client and has the same content of the server's contact as expected. Remember to run RefreshServer before running check commands.

Parameters:
firstName - is the contact firstname
lastName - is the contact lastname
checkContent - set as true if you want to check the item content.

CheckDeletedContact

void CheckDeletedContact(java.lang.String firstName,
                         java.lang.String lastName)
This command can used to check that a deleted contact on the server has been correctly deleted in the client. Remember to run RefreshServer before running check commands.

Parameters:
firstName - is the contact firstname
lastName - is the contact lastname

CheckNewContactOnServer

void CheckNewContactOnServer(java.lang.String firstName,
                             java.lang.String lastName,
                             boolean checkContent)
This command can used to check that a new contact sent to the server has been correctly received and has the same content of the device's contact as expected. Remember to run RefreshServer before running check commands.

Parameters:
firstName - is the contact firstname
lastName - is the contact lastname
checkContent - set as true if you want to check the item content.

CheckUpdatedContactOnServer

void CheckUpdatedContactOnServer(java.lang.String firstName,
                                 java.lang.String lastName,
                                 boolean checkContent)
This command can used to check that an updated contact sent to the server has been correctly received and has the same content of the device's contact as expected. Remember to run RefreshServer before running check commands.

Parameters:
firstName - is the contact firstname
lastName - is the contact lastname
checkContent - set as true if you want to check the item content.

CheckDeletedContactsOnServer

void CheckDeletedContactsOnServer(java.lang.String firstName,
                                  java.lang.String lastName)
This command can used to check that a deleted contact sent to the server has been correctly deleted by the server. Remember to run RefreshServer before running check commands.

Parameters:
firstName - is the contact firstname
lastName - is the contact lastname

CheckItemsCount

void CheckItemsCount(java.lang.String sourceName,
                     int count)
This command can used to check that a deleted contact sent to the server has been correctly deleted by the server. Remember to run RefreshServer before running check commands.

Parameters:
sourceName - is the name of the source. The value is what is displayed on the main screen for that source.
count - the items count.

CheckItemsCountOnServer

void CheckItemsCountOnServer(java.lang.String sourceName,
                             int count)
This command can used to check the total source items count on server side. Remember to run RefreshServer before running check commands.

Parameters:
sourceName - is the name of the source. The value is what is displayed on the main screen for that source.
count - the items count.

RefreshServer

void RefreshServer(java.lang.String sourceName)
This command shall be used everytime the server shall be updated of both client side or server side changes, and before any check command. It refresh the server content for the specified source. If the source is not specified then it will refresh all the sources.

Parameters:
sourceName - is the name of the source. The value is what is displayed on the main screen for that source.

CreateEmptyContactOnServer

void CreateEmptyContactOnServer()
This command can used to simulate a contact addition on the server. It creates an empty contact in memory which will be saved as soon as the SaveContactOnServer command is called. Once this command is called you shall set the contact's FirstName and LastName fields via the SetContactField command before saving it.


LoadContactOnServer

void LoadContactOnServer(java.lang.String firstName,
                         java.lang.String lastName)
This command can used to simulate a contact update on the server. It loads an existing contact identified by the given FirstName and LastName fields.

Parameters:
firstName - is the contact firstname
lastName - is the contact lastname

SaveContactOnServer

void SaveContactOnServer()
This command can used to simulate a contact addition or update on the server. It saves the contact actually created or loaded through the CreateEmptyContactOnServer and LoadContactOnServer respectively.


DeleteContactOnServer

void DeleteContactOnServer(java.lang.String firstName,
                           java.lang.String lastName)
This command can used to simulate a contact deletion on the server. It removes from the server the contact identified by the given firstname and lastname.

Parameters:
firstName - is the contact firstname
lastName - is the contact lastname

DeleteAllContactsOnServer

void DeleteAllContactsOnServer()
This command can used to simulate the deletion of all the contacts stored in the server.



Copyright © 2001-2009 Funambol.