libaurum: clear dirty logs up
authorWonki Kim <wonki_.kim@samsung.com>
Thu, 24 Sep 2020 09:47:58 +0000 (18:47 +0900)
committerWonki Kim <wonki_.kim@samsung.com>
Thu, 24 Sep 2020 09:50:52 +0000 (18:50 +0900)
that's it

Change-Id: I100788e1df34fec93ae176b685c1f6b5beb45ace

14 files changed:
libaurum/capi/inc/capi_uidevice.h [new file with mode: 0644]
libaurum/capi/src/capi_uidevice.c [new file with mode: 0644]
libaurum/inc/Accessibility/AccessibleNode.h
libaurum/inc/PartialMatch.h
libaurum/inc/UiSelector.h
libaurum/src/Accessibility/AccessibleApplication.cc
libaurum/src/Accessibility/AccessibleNode.cc
libaurum/src/Comparer.cc
libaurum/src/PartialMatch.cc
libaurum/src/UiDevice.cc
libaurum/src/UiObject.cc
libaurum/src/UiSelector.cc
libaurum/src/Until.cc
libaurum/src/Waiter.cc

diff --git a/libaurum/capi/inc/capi_uidevice.h b/libaurum/capi/inc/capi_uidevice.h
new file mode 100644 (file)
index 0000000..b91be75
--- /dev/null
@@ -0,0 +1,164 @@
+#pragma once
+
+
+typedef enum _KeyRequestType {
+    STROKE,
+    LONG_STROKE,
+    PRESS,
+    RELEASE,
+} KeyRequestType;
+
+typedef enum _TimeRequestType {
+    WALLCLOCK,
+    MONOTONIC,
+} TimeRequestType;
+
+/**
+ * @brief TBD
+ * @since_tizen 5.5
+ */
+int aurum_uidevice_click(const int x, const int y);
+
+/**
+ * @brief TBD
+ * @since_tizen 5.5
+ */
+int aurum_uidevice_interval_click(const int x, const int y, const unsigned int intv);
+
+/**
+ * @brief TBD
+ * @since_tizen 5.5
+ */
+int aurum_uidevice_drag(const int sx, const int sy, const int ex, const int ey,
+            const int steps, const int durationMs);
+
+/**
+ * @brief TBD
+ * @since_tizen 5.5
+ */
+int aurum_uidevice_touchDown(const int x, const int y);
+
+/**
+ * @brief TBD
+ * @since_tizen 5.5
+ */
+int aurum_uidevice_touchMove(const int x, const int y, const int seq);
+
+/**
+ * @brief TBD
+ * @since_tizen 5.5
+ */
+int aurum_uidevice_touchUp(const int x, const int y, const int seq);
+
+/**
+ * @brief TBD
+ * @since_tizen 5.5
+ */
+int aurum_uidevice_wheelUp(int amount, const int durationMs);
+
+/**
+ * @brief TBD
+ * @since_tizen 5.5
+ */
+int aurum_uidevice_wheelDown(int amount, const int durationMs);
+
+/**
+ * @brief TBD
+ * @since_tizen 5.5
+ */
+int aurum_uidevice_pressBack(KeyRequestType type);
+
+/**
+ * @brief TBD
+ * @since_tizen 5.5
+ */
+int aurum_uidevice_pressHome(KeyRequestType type);
+
+/**
+ * @brief TBD
+ * @since_tizen 5.5
+ */
+int aurum_uidevice_pressMenu(KeyRequestType type);
+
+/**
+ * @brief TBD
+ * @since_tizen 5.5
+ */
+int aurum_uidevice_pressVolUp(KeyRequestType type);
+
+/**
+ * @brief TBD
+ * @since_tizen 5.5
+ */
+int aurum_uidevice_pressVolDown(KeyRequestType type);
+
+/**
+ * @brief TBD
+ * @since_tizen 5.5
+ */
+int aurum_uidevice_pressPower(KeyRequestType type);
+
+/**
+ * @brief TBD
+ * @since_tizen 5.5
+ */
+int aurum_uidevice_pressKeyCode(char* keycode, KeyRequestType type);
+
+/**
+ * @brief TBD
+ * @since_tizen 5.5
+ */
+int aurum_uidevice_takeScreenshot(char* path, float scale, int quality);
+
+/**
+ * @brief TBD
+ * @since_tizen 5.5
+ */
+long long aurum_uidevice_getSystemTime(TimeRequestType type);
+
+/**
+ * @brief TBD
+ * @since_tizen 5.5
+ */
+int aurum_uidevice_hasObject(const std::shared_ptr<UiSelector> selector);
+
+/**
+ * @brief TBD
+ * @since_tizen 5.5
+ */
+std::shared_ptr<UiObject> aurum_uidevice_findObject(
+    const std::shared_ptr<UiSelector> selector) const;
+
+/**
+ * @brief TBD
+ * @since_tizen 5.5
+ */
+std::vector<std::shared_ptr<UiObject>> aurum_uidevice_findObjects(
+    const std::shared_ptr<UiSelector> selector) const;
+
+/**
+ * @brief TBD
+ * @since_tizen 5.5
+ */
+/*
+bool aurum_uidevice_waitFor(
+    const std::function<bool(const ISearchable *)> condition) const;
+*/
+/**
+ * @brief TBD
+ * @since_tizen 5.5
+ */
+std::shared_ptr<UiObject> aurum_uidevice_waitFor(
+    const std::function<std::shared_ptr<UiObject>(const ISearchable *)>
+        condition) const;
+/**
+ * @brief TBD
+ * @since_tizen 5.5
+ */
+std::shared_ptr<UiDevice> aurum_uidevice_getInstance(IDevice *deviceImpl = nullptr);
+
+/**
+ * @brief TBD
+ * @since_tizen 5.5
+ */
+std::vector<std::shared_ptr<AccessibleNode>> aurum_uidevice_getWindowRoot() const;
diff --git a/libaurum/capi/src/capi_uidevice.c b/libaurum/capi/src/capi_uidevice.c
new file mode 100644 (file)
index 0000000..da98682
--- /dev/null
@@ -0,0 +1 @@
+#include "capi_uidevice.h"
\ No newline at end of file
index 4e56478..65a6d83 100644 (file)
@@ -73,6 +73,12 @@ public:  // Constructor & Destructor
      */
     virtual ~AccessibleNode();
 
+    /**
+     * @brief TBD
+     * @since_tizen 5.5
+     */
+    std::string description();
+
 public:
     /**
      * @brief TBD
index 7248d58..c06c3ad 100644 (file)
@@ -43,7 +43,7 @@ public:
      * @brief TBD
      * @since_tizen 5.5
      */
-    void debugPrint();
+    std::string debugPrint();
 
 public:
     static std::shared_ptr<PartialMatch> accept(const std::shared_ptr<AccessibleNode> node,
index 489aeb6..bbd789f 100644 (file)
@@ -15,6 +15,7 @@ public:
      * @since_tizen 5.5
      */
     UiSelector();
+
     /**
      * @brief TBD
      * @since_tizen 5.5
@@ -24,6 +25,12 @@ public:
     // UiSelector(const UiSelector &src);
     //        UiSelector &operator= (const UiSelector& src);
 
+    /**
+     * @brief TBD
+     * @since_tizen 5.5
+     */
+    std::string description();
+
 public:
     /**
      * @brief TBD
index cd0e1de..6fe51d6 100644 (file)
@@ -32,7 +32,5 @@ std::vector<std::shared_ptr<AccessibleWindow>> AccessibleApplication::getActiveW
                         return !(child->isActive() && child->isShowing()); // && child->isShowing() && child->isVisible());
                     }), children.end());
 
-    LOG_SCOPE_F(INFO, "getActiveWindows app(%s) for %p, size:%d", getPackageName().c_str(), getAccessibleNode()->getRawHandler(), children.size());
-
     return children;
 }
\ No newline at end of file
index 0679aa3..b2670b6 100644 (file)
@@ -5,6 +5,7 @@
 
 #include <loguru.hpp>
 #include "config.h"
+#include <sstream>
 
 
 AccessibleNode::~AccessibleNode()
@@ -12,11 +13,57 @@ AccessibleNode::~AccessibleNode()
 }
 
 AccessibleNode::AccessibleNode()
-    : mText{""}, mPkg{""}, mRole{""}, mId{""}, mType{""}, mStyle{""},
+    : mText{""}, mPkg{""}, mRole{""}, mId{""}, mAutomationId{""}, mType{""}, mStyle{""},
       mBoundingBox{0,0,0,0}, mSupportingIfaces(0), mFeatureProperty(0)
 {
 }
 
+std::string AccessibleNode::description() {
+    std::stringstream ss{};
+    ss << "{";
+    ss << "\"mId\":\"" << this->mId << "\", ";
+    ss << "\"mAutomationId\":\"" << this->mAutomationId << "\", ";
+    ss << "\"mRole\":\"" << this->mRole << "\", ";
+    ss << "\"mText\":\"" << this->mText << "\", ";
+    ss << "\"mPkg\":\"" << this->mPkg << "\", ";
+    ss << "\"mType\":\"" << this->mType << "\", ";
+    ss << "\"mStyle\":\"" << this->mStyle << "\", ";
+    /*
+    if(this->mMatchId) ss << "\"mMatchId\":\"" << ((*this->mMatchId)?"true":"false") << "\", ";
+    if(this->mMatchAutomationId) ss << "\"mMatchAutomationId\":\"" << ((*this->mMatchAutomationId)?"true":"false") << "\", ";
+    if(this->mMatchRole) ss << "\"mMatchRole\":\"" << ((*this->mMatchRole)?"true":"false") << "\", ";
+    if(this->mMatchText) ss << "\"mMatchText\":\"" << ((*this->mMatchText)?"true":"false") << "\", ";
+    if(this->mMatchPkg) ss << "\"mMatchPkg\":\"" << ((*this->mMatchPkg)?"true":"false") << "\", ";
+    if(this->mMatchType) ss << "\"mMatchType\":\"" << ((*this->mMatchType)?"true":"false") << "\", ";
+    if(this->mMatchStyle) ss << "\"mMatchStyle\":\"" << ((*this->mMatchStyle)?"true":"false" )<< "\", ";
+    if(this->mMinDepth) ss << "\"mMinDepth\":\"" << *this->mMinDepth << "\", ";
+    if(this->mMaxDepth) ss << "\"mMaxDepth\":\"" << *this->mMaxDepth << "\", ";
+    if(this->mIschecked) ss << "\"mIschecked\":\"" << ((*this->mIschecked)?"true":"false") << "\", ";
+    if(this->mIscheckable) ss << "\"mIscheckable\":\"" << ((*this->mIscheckable)?"true":"false") << "\", ";
+    if(this->mIsclickable) ss << "\"mIsclickable\":\"" << ((*this->mIsclickable)?"true":"false") << "\", ";
+    if(this->mIsenabled) ss << "\"mIsenabled\":\"" << ((*this->mIsenabled)?"true":"false") << "\", ";
+    if(this->mIsfocused) ss << "\"mIsfocused\":\"" << ((*this->mIsfocused)?"true":"false") << "\", ";
+    if(this->mIsfocusable) ss << "\"mIsfocusable\":\"" << ((*this->mIsfocusable)?"true":"false") << "\", ";
+    if(this->mIsscrollable) ss << "\"mIsscrollable\":\"" << ((*this->mIsscrollable)?"true":"false") << "\", ";
+    if(this->mIsselected) ss << "\"mIsselected\":\"" << ((*this->mIsselected)?"true":"false") << "\", ";
+    if(this->mIsshowing) ss << "\"mIsshowing\":\"" << ((*this->mIsshowing)?"true":"false") << "\", ";
+    if(this->mIsactive) ss << "\"mIsactive\":\"" << ((*this->mIsactive)?"true":"false") << "\", ";
+    if(this->mIsvisible) ss << "\"mIsvisible\":\"" << ((*this->mIsvisible)?"true":"false") << "\", ";
+    if(this->mIsselectable) ss << "\"mIsselectable\":\"" << ((*this->mIsselectable)?"true":"false") << "\", ";
+    if(this->mParent) {
+        ss << "\"mParent\":" << this->mParent->description();
+    }
+    ss << "\"mChild\":[";
+    for ( auto child = mChild.begin(); child != mChild.end(); child++) {
+        ss << (*child)->description();
+        if (child+1 != mChild.end()) ss << ", " ;
+    }
+    ss << "]";
+    */
+    ss << "}";
+    return ss.str();
+}
+
 void AccessibleNode::print(int depth, int maxDepth)
 {
     if (maxDepth <= 0 || depth > maxDepth) return;
@@ -31,9 +78,7 @@ void AccessibleNode::print(int depth, int maxDepth)
 void AccessibleNode::print(int d)
 {
     this->refresh();
-    LOG_F(INFO, "%s - %p(%s)  /  pkg:%s, text:%s",
-          std::string(d, ' ').c_str(), getRawHandler(), getText().c_str(),
-          getPkg().c_str(), getText().c_str());
+    LOG_F(INFO, "%s%s",std::string(d, ' ').c_str(), description().c_str());
 }
 
 bool AccessibleNode::isSupporting(AccessibleNodeInterface thisIface) const
index 0a6adef..b68869b 100644 (file)
@@ -14,7 +14,7 @@ std::shared_ptr<AccessibleNode> Comparer::findObject(const std::shared_ptr<UiDev
                                      const std::shared_ptr<UiSelector> selector,
                                      const std::shared_ptr<AccessibleNode> root)
 {
-    std::vector<std::shared_ptr<AccessibleNode>> ret = findObjects(device, selector, root);
+    std::vector<std::shared_ptr<AccessibleNode>> ret = findObjects(device, selector, root, true);
     if (ret.size() > 0)
         return std::move(ret[0]);
     else
@@ -24,10 +24,11 @@ std::shared_ptr<AccessibleNode> Comparer::findObject(const std::shared_ptr<UiDev
 std::vector<std::shared_ptr<AccessibleNode>> Comparer::findObjects(const std::shared_ptr<UiDevice> device,
                                                     const std::shared_ptr<UiSelector> selector,
                                                     const std::shared_ptr<AccessibleNode> root, bool earlyReturn)
-                                                    const std::shared_ptr<AccessibleNode> root)
 {
     Comparer comparer(device, selector, false);
 
+    LOG_SCOPE_F(INFO, "findObjects selector(%s) from (type:%s style:%s, role:%s, text:%d) earlyReturn:%d", selector->description().c_str(), root->getType().c_str(),  root->getStyle().c_str(),  root->getRole().c_str(),  root->getText().c_str(), earlyReturn);
+
     if (selector->mParent) {
         auto ret = Comparer::findObjects(device, selector->mParent, root);
         std::vector<std::shared_ptr<AccessibleNode>> merged{};
@@ -46,6 +47,7 @@ std::vector<std::shared_ptr<AccessibleNode>> Comparer::findObjects(const std::sh
 {
     std::list<std::shared_ptr<PartialMatch>> partialList{};
     std::vector<std::shared_ptr<AccessibleNode>> ret = findObjects(root, 0, 0, partialList);
+    LOG_F(INFO, "%d object(s) found", ret.size());
     return ret;
 }
 
@@ -54,9 +56,9 @@ std::vector<std::shared_ptr<AccessibleNode>> Comparer::findObjects(
     std::list<std::shared_ptr<PartialMatch>> &partialMatches)
 {
     std::vector<std::shared_ptr<AccessibleNode>> ret;
-    root->refresh();
-    LOG_SCOPE_F(INFO, "findObjects %s, %s, %s / i:%d d:%d / p.matches:%d", root->getText().c_str(), root->getType().c_str(), root->getStyle().c_str(), index, depth, partialMatches.size());
+    //LOG_SCOPE_F(INFO, "findObjects idx:%d, depth:%d, partialMatches.size:%d", index, depth, partialMatches.size());
 
+    root->refresh();
     for (auto &match : partialMatches)
         match->update(root, index, depth, partialMatches);
 
@@ -77,11 +79,11 @@ std::vector<std::shared_ptr<AccessibleNode>> Comparer::findObjects(
             if (!ret.empty() && mEarlyReturn) return ret;
         }
     } else {
-        LOG_F(INFO, "no need to search children(maxDepth limit overflow, %d < %d < %d)", mSelector->mMinDepth?*(mSelector->mMinDepth):-1, depth, mSelector->mMaxDepth?*(mSelector->mMaxDepth):9999999);
+        LOG_F(INFO, "Abort searching! No need to search children(maxDepth limit overflow, %d < %d < %d)", mSelector->mMinDepth?*(mSelector->mMinDepth):-1, depth, mSelector->mMaxDepth?*(mSelector->mMaxDepth):9999999);
     }
 
     if (currentMatch && currentMatch->finalizeMatch()){
-        LOG_F(INFO, "child 3 %p(raw:%p)", root.get(), root->getRawHandler());
+        LOG_F(INFO, "Found matched = %s with criteria %s", root->description().c_str(), currentMatch->debugPrint().c_str());
         ret.push_back(root);
     }
 
index e78a981..3abc783 100644 (file)
@@ -3,9 +3,11 @@
 #include <iostream>
 #include <set>
 #include <regex>
+#include <sstream>
 
 #include <loguru.hpp>
 
+
 bool PartialMatch::checkCriteria(const std::string *textA, const std::string textB, const bool *match)
 {
     if (!textA || !match) return false;
@@ -26,18 +28,9 @@ bool PartialMatch::checkCriteria(const bool *boolA, const bool boolB)
     return *boolA != boolB;
 }
 
-void PartialMatch::debugPrint()
+std::string PartialMatch::debugPrint()
 {
-    if (mSelector->mPkg)
-        LOG_F(INFO, "selector->pkg :%s", mSelector->mPkg->c_str());
-    if (mSelector->mId)
-        LOG_F(INFO, "selector->id :%s", mSelector->mId->c_str());
-    if (mSelector->mText)
-        LOG_F(INFO, "selector->text :%s", mSelector->mText->c_str());
-    if (mSelector->mType)
-        LOG_F(INFO, "selector->type :%s", mSelector->mType->c_str());
-    if (mSelector->mStyle)
-        LOG_F(INFO, "selector->style :%s", mSelector->mStyle->c_str());
+    return mSelector->description();
 }
 
 bool PartialMatch::checkCriteria(const std::shared_ptr<UiSelector> selector,
@@ -87,20 +80,15 @@ std::shared_ptr<PartialMatch> PartialMatch::accept(const std::shared_ptr<Accessi
                                                    int index, int absoluteDepth,
                                                    int relativeDepth)
 {
-    LOG_SCOPE_F(INFO, "accept checking i:%d a:%d r:%d / %d < %d < %d", index, absoluteDepth, relativeDepth, selector->mMinDepth?*(selector->mMinDepth):-1, relativeDepth, selector->mMaxDepth?*(selector->mMaxDepth):9999999);
+    //LOG_SCOPE_F(INFO, "PartialMatch::accept idx:%d abs:%d rel:%d / %d < %d < %d", index, absoluteDepth, relativeDepth, selector->mMinDepth?*(selector->mMinDepth):-1, relativeDepth, selector->mMaxDepth?*(selector->mMaxDepth):9999999);
     PartialMatch *match = nullptr;
 
     if ((selector->mMinDepth && (relativeDepth < *(selector->mMinDepth))) ||
         (selector->mMaxDepth && (relativeDepth > *(selector->mMaxDepth)))) {
-        LOG_F(INFO, "depth limit overflow %d < %d < %d", selector->mMinDepth?*(selector->mMinDepth):-1, relativeDepth, selector->mMaxDepth?*(selector->mMaxDepth):9999999);
         return std::shared_ptr<PartialMatch>(nullptr);
     }
-
-    if (PartialMatch::checkCriteria(selector, node)) {
-        LOG_F(INFO, "New Match found %p %d", selector, absoluteDepth);
+    if (PartialMatch::checkCriteria(selector, node))
         match = new PartialMatch(selector, absoluteDepth);
-    }
-
     return std::shared_ptr<PartialMatch>(match);
 }
 
index 05d8f04..6b6a788 100644 (file)
@@ -86,7 +86,6 @@ std::shared_ptr<UiObject> UiDevice::findObject(const std::shared_ptr<UiSelector>
         if (foundNode)
             return std::make_shared<UiObject>(getInstance(), selector, foundNode);
     }
-    LOG_F(INFO, "object not found");
     return std::shared_ptr<UiObject>{nullptr};
 }
 
index 428c39c..03f07e1 100644 (file)
@@ -85,13 +85,11 @@ std::shared_ptr<UiObject> UiObject::findObject(const std::shared_ptr<UiSelector>
 std::vector<std::shared_ptr<UiObject>> UiObject::findObjects(
     const std::shared_ptr<UiSelector> selector) const
 {
-    LOG_SCOPE_F(INFO, "findObjects");
     std::vector<std::shared_ptr<UiObject>> result{};
     auto nodes = Comparer::findObjects(mDevice, selector, getAccessibleNode());
-    LOG_SCOPE_F(INFO, "size : %d", nodes.size());
     for ( auto& node : nodes) {
         if (!node) {
-            LOG_F(INFO, "skipped(node == nullptr)");
+            LOG_F(INFO, "Skipped! (node == nullptr)");
             continue;
         }
         result.push_back(std::make_shared<UiObject>(mDevice, selector, std::move(node)));
@@ -140,7 +138,8 @@ std::shared_ptr<UiObject> UiObject::getChildAt(int index) const {
 
 std::vector<std::shared_ptr<UiObject>> UiObject::getChildren() const
 {
-    return this->findObjects(Sel::depth(1));
+    auto sel = Sel::depth(1);
+    return this->findObjects(sel);
 }
 
 std::shared_ptr<Node> UiObject::getDescendant()
@@ -272,7 +271,6 @@ const Rect<int> UiObject::getBoundingBox() const
 
 void UiObject::click() const
 {
-    LOG_SCOPE_F(INFO, "click on obj %p", this);
     mNode->refresh();
     const Rect<int> rect = mNode->getBoundingBox();
     const Point2D<int> midPoint = rect.midPoint();
@@ -281,7 +279,6 @@ void UiObject::click() const
 
 void UiObject::longClick(const unsigned int intv) const
 {
-    LOG_SCOPE_F(INFO, "click on obj %p", this);
     mNode->refresh();
     const Rect<int> rect = mNode->getBoundingBox();
     const Point2D<int> midPoint = rect.midPoint();
index 663c24d..ae14799 100644 (file)
@@ -1,8 +1,6 @@
 #include "UiSelector.h"
 #include <string>
-
-
-
+#include <sstream>
 
 UiSelector::UiSelector()
 : mId{}, mAutomationId{}, mRole{}, mText{}, mPkg{}, mType{}, mStyle{},
@@ -13,6 +11,53 @@ UiSelector::UiSelector()
   mChild{}, mParent{}
 {
 }
+
+std::string UiSelector::description()
+{
+    std::stringstream ss{};
+    ss << "{";
+    if(this->mId) ss << "\"mId\":\"" << *this->mId << "\", ";
+    if(this->mAutomationId) ss << "\"mAutomationId\":\"" << *this->mAutomationId << "\", ";
+    if(this->mRole) ss << "\"mRole\":\"" << *this->mRole << "\", ";
+    if(this->mText) ss << "\"mText\":\"" << *this->mText << "\", ";
+    if(this->mPkg) ss << "\"mPkg\":\"" << *this->mPkg << "\", ";
+    if(this->mType) ss << "\"mType\":\"" << *this->mType << "\", ";
+    if(this->mStyle) ss << "\"mStyle\":\"" << *this->mStyle << "\", ";
+    if(this->mMatchId) ss << "\"mMatchId\":\"" << ((*this->mMatchId)?"true":"false") << "\", ";
+    if(this->mMatchAutomationId) ss << "\"mMatchAutomationId\":\"" << ((*this->mMatchAutomationId)?"true":"false") << "\", ";
+    if(this->mMatchRole) ss << "\"mMatchRole\":\"" << ((*this->mMatchRole)?"true":"false") << "\", ";
+    if(this->mMatchText) ss << "\"mMatchText\":\"" << ((*this->mMatchText)?"true":"false") << "\", ";
+    if(this->mMatchPkg) ss << "\"mMatchPkg\":\"" << ((*this->mMatchPkg)?"true":"false") << "\", ";
+    if(this->mMatchType) ss << "\"mMatchType\":\"" << ((*this->mMatchType)?"true":"false") << "\", ";
+    if(this->mMatchStyle) ss << "\"mMatchStyle\":\"" << ((*this->mMatchStyle)?"true":"false" )<< "\", ";
+    if(this->mMinDepth) ss << "\"mMinDepth\":\"" << *this->mMinDepth << "\", ";
+    if(this->mMaxDepth) ss << "\"mMaxDepth\":\"" << *this->mMaxDepth << "\", ";
+    if(this->mIschecked) ss << "\"mIschecked\":\"" << ((*this->mIschecked)?"true":"false") << "\", ";
+    if(this->mIscheckable) ss << "\"mIscheckable\":\"" << ((*this->mIscheckable)?"true":"false") << "\", ";
+    if(this->mIsclickable) ss << "\"mIsclickable\":\"" << ((*this->mIsclickable)?"true":"false") << "\", ";
+    if(this->mIsenabled) ss << "\"mIsenabled\":\"" << ((*this->mIsenabled)?"true":"false") << "\", ";
+    if(this->mIsfocused) ss << "\"mIsfocused\":\"" << ((*this->mIsfocused)?"true":"false") << "\", ";
+    if(this->mIsfocusable) ss << "\"mIsfocusable\":\"" << ((*this->mIsfocusable)?"true":"false") << "\", ";
+    if(this->mIsscrollable) ss << "\"mIsscrollable\":\"" << ((*this->mIsscrollable)?"true":"false") << "\", ";
+    if(this->mIsselected) ss << "\"mIsselected\":\"" << ((*this->mIsselected)?"true":"false") << "\", ";
+    if(this->mIsshowing) ss << "\"mIsshowing\":\"" << ((*this->mIsshowing)?"true":"false") << "\", ";
+    if(this->mIsactive) ss << "\"mIsactive\":\"" << ((*this->mIsactive)?"true":"false") << "\", ";
+    if(this->mIsvisible) ss << "\"mIsvisible\":\"" << ((*this->mIsvisible)?"true":"false") << "\", ";
+    if(this->mIsselectable) ss << "\"mIsselectable\":\"" << ((*this->mIsselectable)?"true":"false") << "\", ";
+    if(this->mParent) {
+        ss << "\"mParent\":" << this->mParent->description();
+    }
+    ss << "\"mChild\":[";
+    for ( auto child = mChild.begin(); child != mChild.end(); child++) {
+        ss << (*child)->description();
+        if (child+1 != mChild.end()) ss << ", " ;
+    }
+    ss << "]";
+
+    ss << "}";
+    return ss.str();
+}
+
 /*
 UiSelector::UiSelector(const UiSelector &src)
 {
index 9ca27e1..dea7f6d 100644 (file)
@@ -7,7 +7,7 @@ std::function<bool(const ISearchable *)> Until::hasObject(
     const std::shared_ptr<UiSelector> selector)
 {
     return [=](const ISearchable *searchable) -> bool {
-        LOG_SCOPE_F(INFO, "sel:%p, search:%p", selector, searchable);
+        LOG_SCOPE_F(INFO, "Until::hasObject sel:%p, search:%p", selector, searchable);
         std::shared_ptr<UiObject> obj = searchable->findObject(selector);
         return obj.get() != nullptr;
     };
@@ -17,7 +17,7 @@ std::function<std::shared_ptr<UiObject>(const ISearchable *)> Until::findObject(
     const std::shared_ptr<UiSelector> selector)
 {
     return [=](const ISearchable *searchable) -> std::shared_ptr<UiObject> {
-        LOG_SCOPE_F(INFO, "sel:%p, search:%p", selector, searchable);
+        LOG_SCOPE_F(INFO, "Until::findObject sel:%p, search:%p", selector, searchable);
         std::shared_ptr<UiObject> obj = searchable->findObject(selector);
         return obj;
     };
@@ -26,8 +26,7 @@ std::function<std::shared_ptr<UiObject>(const ISearchable *)> Until::findObject(
 std::function<bool(const UiObject *)> Until::checkable(const bool isCheckable)
 {
     return [=](const UiObject *object) -> bool {
-        LOG_SCOPE_F(INFO, "waitfor ischeckable %d for obj %p", isCheckable,
-                    object);
+        LOG_SCOPE_F(INFO, "Until::checkable checkable:%d for obj %p", isCheckable, object);
         return object->isClickable() == isCheckable;
     };
 }
\ No newline at end of file
index 5e419b5..dcbc048 100644 (file)
@@ -32,6 +32,7 @@ template bool Waiter::waitFor(
 template <typename R>
 R Waiter::waitFor(const std::function<R(const ISearchable *)> condition) const
 {
+    LOG_SCOPE_F(INFO, "Waiter::waitFor %p", condition);
     // startTime = currentTime();
     std::chrono::system_clock::time_point start =
         std::chrono::system_clock::now();
@@ -50,13 +51,11 @@ R Waiter::waitFor(const std::function<R(const ISearchable *)> condition) const
 template <typename R>
 R Waiter::waitFor(const std::function<R(const UiObject *)> condition) const
 {
-    LOG_F(INFO, "1");
+    LOG_SCOPE_F(INFO, "Waiter::waitFor %p", condition);
     if (mUiObject) {
-        LOG_F(INFO, "2");
         std::chrono::system_clock::time_point start =
             std::chrono::system_clock::now();
         R result = condition(mUiObject);
-        LOG_F(INFO, "3 : %d", result);
         while (!result) {
             if ((std::chrono::system_clock::now() - start) >
                 std::chrono::milliseconds{WAIT_TIMEOUT_MS})
@@ -64,7 +63,6 @@ R Waiter::waitFor(const std::function<R(const UiObject *)> condition) const
             std::this_thread::sleep_for(
                 std::chrono::milliseconds{WAIT_INTERVAL_MS});
             result = condition(mUiObject);
-            LOG_F(INFO, "4 : %d", result);
         }
         return result;
     }