Files
UnrealEngineUWP/Engine/Source/Developer/AutomationDriver/Private/AutomationDriverLogging.cpp
Thomas Sarkanen 8ba3c4c087 Merging //UE4/Dev-Main to Dev-Anim (//UE4/Dev-Anim) @ CL 4643671
#rb none
#jira none

[CL 4665410 by Thomas Sarkanen in Dev-Anim branch]
2018-12-17 06:31:16 -05:00

86 lines
2.9 KiB
C++

// Copyright 1998-2019 Epic Games, Inc. All Rights Reserved.
#include "AutomationDriverLogging.h"
#include "AutomationDriverCommon.h"
#include "IApplicationElement.h"
DEFINE_LOG_CATEGORY(LogAutomationDriver);
void FAutomationDriverLogging::TooManyElementsFound(const TArray<TSharedRef<IApplicationElement>>& Elements)
{
UE_LOG(LogAutomationDriver, Error, TEXT("Multiple elements found when 1 was expected\nExpected 1\n Found %d"), Elements.Num());
for (int32 Index = 0; Index < Elements.Num(); Index++)
{
const TSharedRef<IApplicationElement>& Element = Elements[Index];
UE_LOG(LogAutomationDriver, Error, TEXT(" [%d] -> %s"), Index, *Element->ToDebugString());
}
}
void FAutomationDriverLogging::CannotFindElement(const TSharedPtr<IElementLocator, ESPMode::ThreadSafe>& ElementLocator)
{
UE_LOG(LogAutomationDriver, Error, TEXT("Failed to locate element"));
if (ElementLocator.IsValid())
{
UE_LOG(LogAutomationDriver, Error, TEXT(" %s"), *ElementLocator->ToDebugString());
}
}
void FAutomationDriverLogging::ElementNotVisible(const TSharedPtr<IElementLocator, ESPMode::ThreadSafe>& ElementLocator)
{
UE_LOG(LogAutomationDriver, Error, TEXT("Failed to locate visible element"));
if (ElementLocator.IsValid())
{
UE_LOG(LogAutomationDriver, Error, TEXT(" Element found but not visible: %s"), *ElementLocator->ToDebugString());
}
else
{
UE_LOG(LogAutomationDriver, Error, TEXT(" Element found but not visible"));
}
}
void FAutomationDriverLogging::ElementNotInteractable(const TSharedPtr<IElementLocator, ESPMode::ThreadSafe>& ElementLocator)
{
UE_LOG(LogAutomationDriver, Error, TEXT("Failed to locate interactable element"));
if (ElementLocator.IsValid())
{
UE_LOG(LogAutomationDriver, Error, TEXT(" Element found but not interactable: %s"), *ElementLocator->ToDebugString());
}
else
{
UE_LOG(LogAutomationDriver, Error, TEXT(" Element found but not interactable"));
}
}
void FAutomationDriverLogging::ElementHasNoWindow(const TSharedPtr<IElementLocator, ESPMode::ThreadSafe>& ElementLocator)
{
UE_LOG(LogAutomationDriver, Error, TEXT("Failed to locate window hosting element"));
if (ElementLocator.IsValid())
{
UE_LOG(LogAutomationDriver, Error, TEXT(" Element found but no window is associated with it: %s"), *ElementLocator->ToDebugString());
}
else
{
UE_LOG(LogAutomationDriver, Error, TEXT(" Element found but no window is associated with it"));
}
}
void FAutomationDriverLogging::CannotClickUnhoveredElement(const TSharedPtr<IElementLocator, ESPMode::ThreadSafe>& ElementLocator)
{
UE_LOG(LogAutomationDriver, Error, TEXT("Failed to click element"));
if (ElementLocator.IsValid())
{
UE_LOG(LogAutomationDriver, Error, TEXT(" Element found but not located under the cursor: %s"), *ElementLocator->ToDebugString());
}
else
{
UE_LOG(LogAutomationDriver, Error, TEXT(" Element found but not located under the cursor"));
}
}