diff options
author | Saurav Chirania <saurav.chir@gmail.com> | 2018-07-10 18:34:55 +0530 |
---|---|---|
committer | Saurav Chirania <saurav.chir@gmail.com> | 2018-07-12 07:58:05 +0200 |
commit | 7140644302d97869c7ea8d636123755fe04e640b (patch) | |
tree | 485eb2a04fe36730a9825675f8e9558bf043ad99 | |
parent | 3add3e5b70ad991c8351a54b0da62d05e977458f (diff) |
uitest logger: log key according to DSL inside dialogs too
Change-Id: I30cfbf7ba87dda43ecb75ffd5f69253d77b6a00b
Reviewed-on: https://gerrit.libreoffice.org/57233
Tested-by: Jenkins
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
-rw-r--r-- | vcl/source/uitest/logger.cxx | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/vcl/source/uitest/logger.cxx b/vcl/source/uitest/logger.cxx index 69620b0df610..54ac483ed627 100644 --- a/vcl/source/uitest/logger.cxx +++ b/vcl/source/uitest/logger.cxx @@ -96,7 +96,9 @@ void UITestLogger::logKeyInput(VclPtr<vcl::Window> const & xUIElement, const Key if (!mbValid) return; - const OUString& rID = xUIElement->get_id(); + //We need to check for Parent's ID in case the UI Element is SubEdit of Combobox/SpinField + const OUString& rID = xUIElement->get_id().isEmpty() ? + xUIElement->GetParent()->get_id() : xUIElement->get_id(); if (rID.isEmpty()) return; @@ -159,10 +161,17 @@ void UITestLogger::logKeyInput(VclPtr<vcl::Window> const & xUIElement, const Key std::unique_ptr<UIObject> pUIObject = xUIElement->GetUITestFactory()(xUIElement.get()); - OUString parent_id = xUIElement->GetParent()->get_id(); + VclPtr <vcl::Window> pParent = xUIElement->GetParent(); + + while (!pParent->IsTopWindow()) + { + pParent = pParent->GetParent(); + } + + OUString aParentID = pParent->get_id(); OUString aContent = pUIObject->get_type() + " Action:TYPE Id:" + - rID + " Parent:"+ parent_id +" " + aKeyCode; + rID + " Parent:"+ aParentID +" " + aKeyCode; maStream.WriteLine(OUStringToOString(aContent, RTL_TEXTENCODING_UTF8)); } |