diff --git a/src/commands.hxx b/src/commands.hxx index fcb7bdb..c339c07 100644 --- a/src/commands.hxx +++ b/src/commands.hxx @@ -1479,8 +1479,8 @@ class Download: public Command { } QString description() const { return - tag()+" " - "" + tag()+" \n" + " " "\n\n" "Set download file before loading a download link or clicking on a " "download button. The next line must be exactly one command that " @@ -1652,9 +1652,11 @@ class Set: public Command { _next->execute(script, frame); script->set(script->replacevars(_name), script->replacevars(_next->result())); + log(_name+"='"+_next->result().replace("\\", "\\\\").replace("'", "\\'")+"'"); } else { script->set(script->replacevars(_name), script->replacevars(_value)); + log(_name+"='"+_value.replace("\\", "\\\\").replace("'", "\\'")+"'"); } return true; } @@ -1768,7 +1770,7 @@ class ClientCertificate: public Command { } QString description() const { return - tag()+" " + tag()+" " "\n\n" "Load a client certificate to authenticate on SSL connections. " "The password for the keyfile should not contain spaces. " @@ -1938,7 +1940,7 @@ class Function: public Command { tag()+" [, , <...>]\n" " \n" " \n" - " <...>\n" + " <...>" "\n\n" "Define a function with arguments. The arguments are treated like" " local variables. In a sequence of scripts within the same testrun," @@ -2219,6 +2221,40 @@ class Check: public Command { std::shared_ptr _next; }; +class For: public Command { + public: + QString tag() const { + return "for"; + } + QString description() const { + return + tag()+" -> , , <...>\n" + " \n" + " \n" + " <...>" + "\n\n" + "Executes the given commands with the variable set to the specifier values," + "repeated once per given value. Without values, it is simply a no operation.\n\n"; + "If you quote the values, then quote all values with the same" + " quotes. If you need a comma within a value, you must quote."; + } + QString command() const { + return tag()+" "+_variable+" "+_vals.join(" "); + } + std::shared_ptr parse(Script*, QString args, + QStringList&, QString, int, int) { + std::shared_ptr cmd(new For()); + if (!args.size()) throw BadArgument(tag()+" requires a "); + QStringList allargs(args.split("->")); + ... + return cmd; + } + bool execute(Script* script, QWebFrame* frame) { + Logger log(this, script); + return true; + } +}; + /* Template: class : public Command { public: diff --git a/src/networkaccessmanager.hxx b/src/networkaccessmanager.hxx index b2a3e91..f290ac0 100644 --- a/src/networkaccessmanager.hxx +++ b/src/networkaccessmanager.hxx @@ -224,13 +224,16 @@ class NetworkAccessManager: public QNetworkAccessManager { //log(__PRETTY_FUNCTION__); } void sslErrorsLog(const QList& errors) { - Q_FOREACH(const QSslError& error, errors) - log("**** SSL-Error: "+error.errorString()+"\n"+ - " Certificate: "+error.certificate().toText()); - //QNetworkReply* reply(dynamic_cast(QObject::sender())); + Q_FOREACH(const QSslError& error, errors) { + log("**** SSL-Error: "+error.errorString()); + } + QNetworkReply* reply(dynamic_cast(QObject::sender())); + log("#### Ignoring SSL Errors 1"); + reply->ignoreSslErrors(); } - void sslErrorsLog(QNetworkReply*, const QList&) { - //log(__PRETTY_FUNCTION__); + void sslErrorsLog(QNetworkReply* reply, const QList&) { + log("#### Ignoring SSL Errors 2"); + reply->ignoreSslErrors(); } };