34.2 Selected Packages and Procedures
We now take a closer look at a few selected packages and procedures of the standard library.
34.2.1 The Android Package
The package qfs.run-android contains procedures to execute various ADB commands or to interact with the device.
Below is a selection of the available procedures within the package:
- appControl-resetCurrentApp Resets all data and permissions of the currently focused app and restarts it.
- dataTransfer-pull Transfers a file or folder from the Android device to the local system.
- dataTransfer-push Transfers a file or folder from the local system to the Android device.
- runAdbCommand Executes any ADB command.
- device-appSwitch Activates the app switch button on the device.
- device-back Activates the back button on the device.
- device-home Activates the home button on the device.
- device-closeKeyboard Closes a potentially open on-screen keyboard.
- device-setRotation Changes the device's screen orientation.
34.2.2 The Utils Package
The qfs.utils package contains useful procedures for frequently occurring requirements of test development.
Here are some procedures of the package:
- getDate Returns a string that contains a date. By default, the current date is returned. (Other dates are configurable.)
- getTime Returns a string that contains a time. By default, the current time is returned. (Other times are configurable.)
- logMemory Writes the current memory usage to the log.
- printVariable Prints the content of a specified variable to the console.
- printMessage Prints the content of a specified message to the console.
- writeMessageIntoFile Writes a specified string into a specified file.
34.2.3 The Check Package
The qfs.check package contains procedures that perform checks.
The most important procedures are:
- checkEnabledStatus Checks whether a component is enabled or disabled. In case of an error, the procedure writes a corresponding error to the log.
- checkSelectedStatus Checks whether a component is selected or not selected. In case of an error, the procedure writes a corresponding error to the log.
- checkText Checks the text of a component. In case of an error, the procedure writes a corresponding error to the log.
34.2.4 The Databinder Package
The qfs.databinder package contains procedures for execution within a Data driver node to bind data for data-driven testing.
The most important procedures are:
- bindList Binds a list of values to a variable. The values are separated by whitespace or by the delimiter passed as a parameter.
- bindSets Binds sets of values to a set of variables. The sets of values are separated by line breaks, the values within a set by whitespace or by the delimiter passed as a parameter.