Interface IAutomationDevice
- Namespace
- GroupeIsa.Neos.EndToEndTests.UI.Devices
- Assembly
- GroupeIsa.Neos.EndToEndTests.UI.dll
Provides the functionalities of the automation of an application for a device.
public interface IAutomationDevice : IDisposable
- Inherited Members
Properties
DropdownIsVisible
Gets a value indicating whether the dropdown is visible.
bool DropdownIsVisible { get; }
Property Value
Remarks
Don't use GetDropdown() if you just need to check visibility.
WebDriverProcessName
Gets the name of the web driver process.
string? WebDriverProcessName { get; }
Property Value
Methods
CreateActions()
Creates actions.
IAutomationAction CreateActions()
Returns
- IAutomationAction
A automation action.
FindAndClickMenuItem(string)
Finds and clicks on the specified menu item.
void FindAndClickMenuItem(string path)
Parameters
pathstringThe path to access the menu item.
Remarks
Loop through and open the sub menus until we find the menu entry associated to the path Path is built with the template {MenuName}/{ChildMenuItemName}/{GrandChildMenuItemName}/... A menu can display maximum two depth level, so if a path have a depth greater than 3 (menuName, menuHeader, menuItem, someSubMenuItem), it is necessary to navigate to the sub-menu to display the desired item.
Exceptions
- AutomationException
The menu item was not found.
FindErrorMessageBox()
Finds and waits until the displaying error message box is visible.
IErrorMessageBoxComponent? FindErrorMessageBox()
Returns
- IErrorMessageBoxComponent
Error handler message box or
nullwhen no error message box is displayed.
FindFocusedComponent<TComponent>()
Finds the focused component.
TComponent? FindFocusedComponent<TComponent>() where TComponent : IAutomationComponent
Returns
- TComponent
The focused component or
nullif not found.
Type Parameters
TComponentThe component type.
FindMessageBox()
Finds and waits until the displaying message box is visible.
IMessageBoxComponent? FindMessageBox()
Returns
- IMessageBoxComponent
Message box component or
nullwhen no message box is displayed.
FindMessageBoxWithInput()
Finds and waits until the message box with input is visible.
IMessageBoxWithInputComponent? FindMessageBoxWithInput()
Returns
- IMessageBoxWithInputComponent
Message box with input component or
nullwhen no message box with input is displayed.
FindToastNow(int)
Searches whether an n-th toast exists.
IToastComponent? FindToastNow(int index = 0)
Parameters
indexintIndex of the toast.
0is the first toast displayed.
Returns
- IToastComponent
Toast component or
nullwhen no toast is displayed.
Remarks
First tries to find the toast immediately without waiting for anything.
Additionally, instead of throwing an exception, this method returns null if the toast does not exist.
=> This is useful for negative tests, for checking that there isn't any unexpected toasts.
Please note that if you intend to use this for positive tests, you may need to call WaitUntilVisible() on the retrieved element.
GetBrowserLogs()
Gets the browser logs.
string GetBrowserLogs()
Returns
- string
The browser logs.
GetDropdown()
Gets the displaying dropdown.
IDropdownComponent? GetDropdown()
Returns
- IDropdownComponent
Dropdown component or
nullwhen no dropdown is displayed.
GetErrorMessageBox()
Gets and waits until the displaying error message box is visible.
IErrorMessageBoxComponent GetErrorMessageBox()
Returns
- IErrorMessageBoxComponent
Message box component or
nullwhen no message box is displayed.
Exceptions
- AutomationException
Thrown when no message box component was found.
GetGlobalSearchButton()
Gets the global search button.
IGlobalSearchButtonComponent GetGlobalSearchButton()
Returns
- IGlobalSearchButtonComponent
Global search button component.
Exceptions
- AutomationException
Thrown when no global search button component was found.
GetKeyboardValue(KeyboardKeys)
Gets the string value of the specified key of a keyboard.
string GetKeyboardValue(KeyboardKeys key)
Parameters
keyKeyboardKeysKey of the keyboard.
Returns
- string
The string value.
GetLookupModal()
Gets and waits until the displaying modal is visible.
ILookupModalComponent GetLookupModal()
Returns
- ILookupModalComponent
Lookup Modal component.
Exceptions
- AutomationException
Thrown when no lookup modal component was found.
GetMessageBox()
Gets and waits until the displaying message box is visible.
IMessageBoxComponent GetMessageBox()
Returns
- IMessageBoxComponent
Message box component.
Exceptions
- AutomationException
Thrown when no message box component was found.
GetMessageBoxWithInput()
Gets and waits until the displaying message box with input is visible.
IMessageBoxWithInputComponent GetMessageBoxWithInput()
Returns
- IMessageBoxWithInputComponent
Message box component.
Exceptions
- AutomationException
Thrown when no message box with input component was found.
GetModal(IContentComponent?)
Gets and waits until the displaying modal is visible.
IModalComponent GetModal(IContentComponent? containingUIViewRootComponent = null)
Parameters
containingUIViewRootComponentIContentComponent
Returns
- IModalComponent
Modal component.
Exceptions
- AutomationException
Thrown when no modal component was found.
GetPopover(IContentComponent)
Gets and waits until the displaying popover is visible.
IPopoverComponent GetPopover(IContentComponent containingUIViewRootComponent)
Parameters
containingUIViewRootComponentIContentComponent
Returns
- IPopoverComponent
Popover component.
Exceptions
- AutomationException
Thrown when no popover component was found.
GetReportToast(int)
Gets and waits until a report toast is visible.
[Obsolete("Use GetToast instead.")]
IReportToastComponent GetReportToast(int index = 1)
Parameters
indexintIndex of the toast.
1is the first toast displayed.
Returns
- IReportToastComponent
Report toast component.
Remarks
WARNING!
This method is no longer able to determine whether a toast is a report toast or not.
It now returns the first toast that matches index.
Exceptions
- AutomationException
Thrown when no report toast component was found.
GetScreenInfo()
Gets current screen information to help debug.
string GetScreenInfo()
Returns
- string
Current screen information.
GetScreenShot()
Gets current screen screenshot in base 64 format.
string GetScreenShot()
Returns
- string
String representing the image in base 64.
GetToast(int)
Gets and waits until the n-th toast is visible.
IToastComponent GetToast(int index = 0)
Parameters
indexintIndex of the toast.
0is the first toast displayed.
Returns
- IToastComponent
Toast component.
Exceptions
- AutomationException
Thrown when no toast component was found.
GetUserButton()
Gets the user button.
IUserButtonComponent GetUserButton()
Returns
- IUserButtonComponent
User button component.
Exceptions
- AutomationException
Thrown when no user button component was found.
GetWindowSize()
Gets the size of the navigator window.
(int Width, int Height) GetWindowSize()
Returns
Launch(LaunchOptions?)
Launch the application.
Task<IContentComponent> Launch(LaunchOptions? options = null)
Parameters
optionsLaunchOptionsLaunch options.
Returns
- Task<IContentComponent>
The root component of the application.
Exceptions
- AutomationException
Thrown when no root component was found.
LaunchNeosManager(LaunchOptions?)
Launches Neos Manager for the application.
Task<IContentComponent> LaunchNeosManager(LaunchOptions? options = null)
Parameters
optionsLaunchOptionsLaunch options.
Returns
- Task<IContentComponent>
The root component of the application.
Exceptions
- AutomationException
Thrown when no root component was found.
LaunchNeosStudio(LaunchOptions?)
Launches Neos Studio for the application.
Task<IContentComponent> LaunchNeosStudio(LaunchOptions? options = null)
Parameters
optionsLaunchOptionsLaunch options.
Returns
- Task<IContentComponent>
The root component of the application.
Exceptions
- AutomationException
Thrown when no root component was found.
OpenUIViewByMenuEntry(string, bool)
Opens a UI view from a menu entry.
Task<IFrameComponent> OpenUIViewByMenuEntry(string path, bool closeMenu = true)
Parameters
pathstringThe menu entry path. It must be defined using the following syntax : {MenuName}/{menuItemName}/{childMenuItemName}/...
Example :
A menu item 'Products' is a child of 'Catalog' item from the menu 'SalesAndCatalog'.
The resulting path is 'SalesAndCatalog/Catalog/Products'.closeMenuboolBy default, the menu sidebar is closed after navigating to the UI. This can lead to the lost of the focus on the opened UI view.
Returns
- Task<IFrameComponent>
The frame that contains the UIView.
OpenUIViewByMenuEntry<T>(string, bool)
Opens a UI view from a menu entry.
Task<T> OpenUIViewByMenuEntry<T>(string path, bool closeMenu = true) where T : IFrameComponent
Parameters
pathstringThe menu entry path. It must be defined using the following syntax : {MenuName}/{menuItemName}/{childMenuItemName}/...
Example :
A menu item 'Products' is a child of 'Catalog' item from the menu 'SalesAndCatalog'.
The resulting path is 'SalesAndCatalog/Catalog/Products'.closeMenuboolBy default, the menu sidebar is closed after navigating to the UI. This can lead to the lost of the focus on the opened UI view.
Returns
- Task<T>
The frame that contains the UIView.
Type Parameters
TThe frame component type.
PublishScreenShot(string?)
Takes a screenshot and publish it in folder defined by the environment variable NEOS_AUTOMATION_SCREENSHOTS_FOLDER.
string? PublishScreenShot(string? name = null)
Parameters
namestringThe name of screenshot.
Returns
- string
The path of published screenshot or
nullwhen NEOS_AUTOMATION_SCREENSHOTS_FOLDER variable is not defined.
ResizeWindow(int, int)
Resizes the navigator window.
void ResizeWindow(int width, int height)
Parameters
SaveScreenshot(string)
Saves a screenshot of the current screen with the specified file path.
void SaveScreenshot(string filePath)
Parameters
filePathstringThe path of the screenshot file to save.
SelectFile(string, byte[])
Selects a file.
void SelectFile(string name, byte[] content)
Parameters
SendKeys(params KeyboardKeys[])
Sends a sequence of keystrokes.
void SendKeys(params KeyboardKeys[] keys)
Parameters
keysKeyboardKeys[]The keystrokes to send to the component.
SendKeys(string)
Sends a sequence of keystrokes.
void SendKeys(string keys)
Parameters
keysstringThe keystrokes to send to the component.
WaitUntil(Func<bool>)
Waits until the condition is true.
bool WaitUntil(Func<bool> condition)
Parameters
Returns
- bool
trueif the condition became true before the timeout,falseotherwise.
WaitUntil(Func<bool>, int, int)
Waits until a condition is met.
bool WaitUntil(Func<bool> condition, int timeoutInMs, int sleepIntervalInMs = 200)
Parameters
conditionFunc<bool>The condition to meet.
timeoutInMsintThe timeout value in milliseconds indicating how long to wait.
sleepIntervalInMsintDelay in milliseconds between each evaluation.
Returns
- bool
A value indicating whether the condition has been met during the alloted time.