fortrace.utility.desktop_environments package
Subpackages
- fortrace.utility.desktop_environments.Linux package
- fortrace.utility.desktop_environments.Windows package
- fortrace.utility.desktop_environments.macOS package
Submodules
fortrace.utility.desktop_environments.desktop_environment module
- class fortrace.utility.desktop_environments.desktop_environment.DesktopEnvironment(os_type: OSType, desktop_env: DesktopEnvironmentType, qemu_monitor_session: QEMUMonitorSession)[source]
Bases:
ABCDesktop environment of a domain.
Should be implemented by all desktop environments in ForTrace. This class is responsible for managing application windows and keeping track of the one that is currently in focus. Furthermore, it is also responsible for the login on a graphical domain.
- property active_application: GenericApplication
- close_application(application: GenericApplication)[source]
Close the given application via key-combination alt-f4.
Do not use the application object afterward.
- Parameters:
application – application object which refers to the application that is to be closed
- abstractmethod focus_application(application: GenericApplication)[source]
Bring the given application into focus so that it can receive input commands.
- Parameters:
application – application object to focus
Returns:
- get_application(application_identifier: str | UUID) GenericApplication[source]
Get an application based on its name or uuid
- Parameters:
application_identifier – provide name if only one instance is open, else uuid
- Returns:
handle to application
- is_application_open(application_name: str) bool[source]
Determine if an application is opened, based on its name.
- Parameters:
application_name – the name of the application to test
- Returns:
Status of the application
- abstractmethod login(username: str, password: str | None)[source]
Perform a login for the given user.
- Parameters:
username – name of the user to login
password – password of the given user or None if there is none
Note
This call blocks until the desktop environment is ready to receive input.
- maximize_application()[source]
Maximize the current focused application.
Note
Useful before conducting text recognition.
- abstractmethod open_application(application_type: ApplicationType, application_name: str, **kwargs) GenericApplication[source]
Open the specified application and move focus to it.
Implementation has to add application to list of applications.
- Parameters:
application_type – Type of application to filter for correct sub-factory
application_name – Name of the application to open
**kwargs – Desktop environment specific arguments, e.g. fortrace.utility.desktop_environments.Windows.Windows
- Returns:
handle to newly opened application
- property qemu_monitor_session: QEMUMonitorSession
- property session_unlocked: bool
fortrace.utility.desktop_environments.desktop_environment_factory module
- fortrace.utility.desktop_environments.desktop_environment_factory.get_desktop_env(os_type: OSType, desktop_env: DesktopEnvironmentType, qemu_monitor_session: QEMUMonitorSession) DesktopEnvironment[source]
Construct a new desktop environment object.
This is the entry point for any GUI interaction.
- Parameters:
os_type – OSType of the guest
desktop_env – desktop environment of the guest
qemu_monitor_session – and active QEMUMonitorSession
- Returns:
desktop environment object