summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorKai Koehne <kai.koehne@theqtcompany.com>2014-12-08 17:34:12 +0100
committerKai Koehne <kai.koehne@theqtcompany.com>2014-12-10 09:44:27 +0100
commit71c248e2704225dc4e361699d08fe3b422a4da4f (patch)
treea9f12e4f3b7f3ec2315f833cfa6e4ac13b7b4285 /tests/auto
parentcb57245ea95d2c1209bcc14f6d119d5ed912a0bf (diff)
Expose findChild, findChildren methods to JS
Re-add the findChild, findChildren methods known from Qt Script. Change-Id: I3db6be53ccd89a09b2c7de14ba7f96ebb26dbdbb Reviewed-by: Leena Miettinen <riitta-leena.miettinen@theqtcompany.com> Reviewed-by: Niels Weber <niels.weber@theqtcompany.com>
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/installer/scriptengine/data/auto-install.qs8
-rw-r--r--tests/auto/installer/scriptengine/tst_scriptengine.cpp7
2 files changed, 13 insertions, 2 deletions
diff --git a/tests/auto/installer/scriptengine/data/auto-install.qs b/tests/auto/installer/scriptengine/data/auto-install.qs
index 26937fc05..8504cd08a 100644
--- a/tests/auto/installer/scriptengine/data/auto-install.qs
+++ b/tests/auto/installer/scriptengine/data/auto-install.qs
@@ -4,6 +4,14 @@ function Controller()
installer.setValue("GuiTestValue", "hello");
}
+Controller.prototype.IntroductionPageCallback = function()
+{
+ var widget = gui.currentPageWidget();
+ var updaterRadioButton = widget.findChild("UpdaterRadioButton");
+ updaterRadioButton.checked = true;
+ gui.clickButton(buttons.NextButton);
+}
+
Controller.prototype.ComponentSelectionPageCallback = function()
{
var notExistingButtonId = 9999999;
diff --git a/tests/auto/installer/scriptengine/tst_scriptengine.cpp b/tests/auto/installer/scriptengine/tst_scriptengine.cpp
index 23cb56dd0..91013d028 100644
--- a/tests/auto/installer/scriptengine/tst_scriptengine.cpp
+++ b/tests/auto/installer/scriptengine/tst_scriptengine.cpp
@@ -56,6 +56,11 @@ public:
setPage(PackageManagerCore::Introduction, new IntroductionPage(core));
setPage(PackageManagerCore::ComponentSelection, new ComponentSelectionPage(core));
setPage(PackageManagerCore::InstallationFinished, new FinishedPage(core));
+
+ foreach (const int id, pageIds()) {
+ packageManagerCore()->controlScriptEngine()->addQObjectChildren(page(id));
+ packageManagerCore()->componentScriptEngine()->addQObjectChildren(page(id));
+ }
}
virtual void init() {}
@@ -306,8 +311,6 @@ private slots:
testGui.loadControlScript(":///data/auto-install.qs");
QCOMPARE(m_core.value("GuiTestValue"), QString("hello"));
- // show event calls automatically the first callback which does not exist
- setExpectedScriptOutput("Control script callback \"IntroductionPageCallback\" does not exist. ");
testGui.show();
// inside the auto-install script we are clicking the next button, with a not existing button