summaryrefslogtreecommitdiff
path: root/include/vcl/uitest
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2017-03-20 00:45:28 +0100
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2017-03-20 01:48:20 +0000
commit26ee34d1332e164cf938fcf78902df7d0cc3fe8f (patch)
treef481eabc219192eedc32385bee922d1b53a60e1c /include/vcl/uitest
parent2356bfdb1b99a93fcb35fefc0f587158e7d160c2 (diff)
uitest: add logging for UI actions
The long term goal for this logging is that it generates content in a DSL for the UI testing. The generated file can then be interpreted by the UI testing and replay the interaction with the UI. For now the plan is to have a readable output of what happens in the UI layer that allows to quickly transform it to a UI test. Change-Id: Ic536db766e41d03d048c920f6d551047af6fbb74 Reviewed-on: https://gerrit.libreoffice.org/35447 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Diffstat (limited to 'include/vcl/uitest')
-rw-r--r--include/vcl/uitest/logger.hxx37
-rw-r--r--include/vcl/uitest/uiobject.hxx7
2 files changed, 44 insertions, 0 deletions
diff --git a/include/vcl/uitest/logger.hxx b/include/vcl/uitest/logger.hxx
new file mode 100644
index 000000000000..32625c7f60a7
--- /dev/null
+++ b/include/vcl/uitest/logger.hxx
@@ -0,0 +1,37 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#include <vcl/dllapi.h>
+
+#include <tools/stream.hxx>
+#include <vcl/ctrl.hxx>
+
+class UITEST_DLLPUBLIC UITestLogger
+{
+private:
+
+ SvFileStream maStream;
+
+ bool mbValid;
+
+public:
+
+ UITestLogger();
+
+ void logCommand(const OUString& rAction);
+
+ void logAction(VclPtr<Control>& xUIElement, VclEventId nEvent);
+
+ void log(const OUString& rString);
+
+ static UITestLogger& getInstance();
+
+};
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/uitest/uiobject.hxx b/include/vcl/uitest/uiobject.hxx
index c2de7d4652b1..4641b999722c 100644
--- a/include/vcl/uitest/uiobject.hxx
+++ b/include/vcl/uitest/uiobject.hxx
@@ -92,6 +92,11 @@ public:
*
*/
virtual OUString dumpHierarchy() const;
+
+ /**
+ * Gets the corresponding Action string for the event.
+ */
+ virtual OUString get_action(VclEventId nEvent) const;
};
class UITEST_DLLPUBLIC WindowUIObject : public UIObject
@@ -117,6 +122,8 @@ public:
virtual OUString dumpHierarchy() const override;
+ virtual OUString get_action(VclEventId nEvent) const override;
+
static std::unique_ptr<UIObject> create(vcl::Window* pWindow);
protected: