|
|
|
@ -413,6 +413,7 @@ class Script: public QObject { |
|
|
|
|
Q_OBJECT; |
|
|
|
|
Q_SIGNALS: |
|
|
|
|
void logging(QString); |
|
|
|
|
void progress(QString, int, int); |
|
|
|
|
public: |
|
|
|
|
typedef std::pair<QString, QStringList> Signal; |
|
|
|
|
enum ClickType { |
|
|
|
@ -597,8 +598,10 @@ class Script: public QObject { |
|
|
|
|
testsuite.attr("name") = "Unnamed Test Suite"; |
|
|
|
|
(*_testsuites)<<testsuite; |
|
|
|
|
} |
|
|
|
|
int retries(0), back(0); |
|
|
|
|
for (auto cmd(_script.begin()); cmd!=_script.end(); ++cmd) { |
|
|
|
|
int retries(0), back(0), step(0); |
|
|
|
|
for (auto cmd(_script.begin()); cmd!=_script.end(); ++cmd, ++step) { |
|
|
|
|
progress(QString("%1:%2").arg((*cmd)->file()).arg((*cmd)->line()), |
|
|
|
|
step, steps()); |
|
|
|
|
xml::Node testcase("testcase"); |
|
|
|
|
try { |
|
|
|
|
testcase.attr("classname") = |
|
|
|
@ -628,7 +631,10 @@ class Script: public QObject { |
|
|
|
|
_testsuites->last()<<testcase; |
|
|
|
|
break; // test is successfully finished
|
|
|
|
|
} |
|
|
|
|
} catch (PossibleRetryLoad& e) { |
|
|
|
|
progress(QString("%1:%2").arg((*cmd)->file()).arg((*cmd)->line()), |
|
|
|
|
step, steps()); |
|
|
|
|
|
|
|
|
|
} catch (PossibleRetryLoad& e) { |
|
|
|
|
_timer.stop(); |
|
|
|
|
// timeout may happen during load due to bad internet connection
|
|
|
|
|
if (screenshots) |
|
|
|
@ -646,11 +652,13 @@ class Script: public QObject { |
|
|
|
|
QUrl url(frame->url()); |
|
|
|
|
if ((*cmd)->command()=="expect loadFinished true") { |
|
|
|
|
------cmd; |
|
|
|
|
------step; |
|
|
|
|
back += 3; |
|
|
|
|
_ignoreSignalsUntil = "loadStarted"; |
|
|
|
|
frame->load(url); |
|
|
|
|
} else if ((*cmd)->command()=="expect loadStarted") { |
|
|
|
|
----cmd; |
|
|
|
|
----step; |
|
|
|
|
back += 2; |
|
|
|
|
_ignoreSignalsUntil = "loadStarted"; |
|
|
|
|
frame->page()->triggerAction(QWebPage::Stop); |
|
|
|
@ -659,6 +667,7 @@ class Script: public QObject { |
|
|
|
|
url2.remove("expect urlChanged"); |
|
|
|
|
if (url2.size()) url=url2.trimmed(); |
|
|
|
|
----cmd; |
|
|
|
|
----step; |
|
|
|
|
back += 2; |
|
|
|
|
_ignoreSignalsUntil = "loadStarted"; |
|
|
|
|
frame->load(url); |
|
|
|
@ -667,6 +676,7 @@ class Script: public QObject { |
|
|
|
|
url2.remove("expect load"); |
|
|
|
|
if (url2.size()) url=url2.trimmed(); |
|
|
|
|
----cmd; |
|
|
|
|
----step; |
|
|
|
|
back += 2; |
|
|
|
|
_ignoreSignalsUntil = "loadStarted"; |
|
|
|
|
frame->load(url); |
|
|
|
@ -725,6 +735,7 @@ class Script: public QObject { |
|
|
|
|
} |
|
|
|
|
removeSignals(frame); |
|
|
|
|
if (!_signals.empty()) throw UnhandledSignals(_signals); |
|
|
|
|
progress("success", 0, 0); |
|
|
|
|
return res; |
|
|
|
|
} |
|
|
|
|
Command* command() { |
|
|
|
@ -2261,7 +2272,7 @@ class Check: public Command { |
|
|
|
|
QString description() const { |
|
|
|
|
return |
|
|
|
|
tag()+" <value1> <cmp> <value2>\n"+ |
|
|
|
|
tag()+" <value1>\n" |
|
|
|
|
tag()+" <value1> <cmp>\n" |
|
|
|
|
" <command>" |
|
|
|
|
"\n\n" |
|
|
|
|
"Compares two values (you can use variables) or compares a value to the" |
|
|
|
|