From b4cd0bf006b31bb9dcd90897a633264726305d2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20W=C3=A4ckerlin?= Date: Wed, 11 May 2016 09:07:04 +0000 Subject: [PATCH] fix text-selection to exists feature; ignore javascript popups --- ChangeLog | 17 +++++++++++++++++ src/testgui.hxx | 8 +++++--- src/webpage.hxx | 38 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 60 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2dd263b..9bba8a8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,20 @@ +2016-05-05 09:58 + + * build-in-docker.sh: fixed build + +2016-05-05 09:48 + + * build-in-docker.sh: fixed build + +2016-05-05 09:23 + + * debian/control.in: xvfb is not required + +2016-05-05 09:12 + + * ChangeLog, ax_init_standard_project.m4, bootstrap.sh, + build-in-docker.sh: update build system + 2016-05-03 06:52 * src/commands.hxx: some smaller fixes and improvements for joomla diff --git a/src/testgui.hxx b/src/testgui.hxx index c32cebd..250a55e 100644 --- a/src/testgui.hxx +++ b/src/testgui.hxx @@ -352,13 +352,15 @@ class TestGUI: public QMainWindow, protected Ui::TestGUI { // is important, but the text that will be typed _typing = true; } else { - if (_web->page()->selectedText() != "") + if (_web->page()->selectedText() != "") { // user has selected a text, append a check - appendCommand("expect "+map(selected) + appendCommand("exists "+map(selected) +" -> "+_web->page()->selectedText()); - else + _web->page()->findText(QString()); + } else { // user has clicked without selection, append a click appendCommand("click "+map(selected)); + } } } else { appendCommand("# click, but where?"); diff --git a/src/webpage.hxx b/src/webpage.hxx index dfd8b1b..60e0d38 100644 --- a/src/webpage.hxx +++ b/src/webpage.hxx @@ -68,6 +68,44 @@ class TestWebPage: public QWebPage { return filename; } } + virtual void javaScriptAlert(QWebFrame* frame, const QString& msg) { + LOG("javaScriptAlert: "+msg); + if (_unattended) { + return; + } else { + return; + //return QWebPage::javaScriptAlert(frame, msg); + } + } + virtual bool javaScriptConfirm(QWebFrame* frame, const QString& msg) { + LOG("javaScriptConfirm "+msg); + if (_unattended) { + return true; + } else { + return true; + //return QWebPage::javaScriptConfirm(frame, msg); + } + } + virtual void javaScriptConsoleMessage(const QString& msg, + int line, const QString& src) { + LOG("javaScriptConsoleMessage: "+msg); + if (_unattended) { + return; + } else { + return; + //return QWebPage::javaScriptConsoleMessage(msg, line, src); + } + } + virtual bool javaScriptPrompt(QWebFrame* frame, const QString& msg, + const QString& defaultValue, QString* result) { + LOG("javaScriptPrompt: "+msg); + if (_unattended) { + return true; + } else { + return true; + //return QWebPage::javaScriptPrompt(frame, msg, defaultValue, result); + } + } private: bool _unattended; QString _nextFile;