prepared for build in a docker instance on jenkins
This commit is contained in:
@@ -440,14 +440,15 @@ class Script: public QObject {
|
||||
.replace(" ", " ").replace("&", "&");
|
||||
}
|
||||
public:
|
||||
Script(): _clicktype(JAVASCRIPT_CLICK), _command(0) {
|
||||
Script(): _clicktype(JAVASCRIPT_CLICK), _command(0), _screenshots(true) {
|
||||
initPrototypes();
|
||||
}
|
||||
Script(const Script& o):
|
||||
QObject(),
|
||||
_prototypes(o._prototypes),
|
||||
_script(o._script),
|
||||
_command(0) {
|
||||
_command(0),
|
||||
_screenshots(true) {
|
||||
set(o);
|
||||
}
|
||||
QString syntax() const {
|
||||
@@ -2363,8 +2364,11 @@ class : public Command {
|
||||
*/
|
||||
|
||||
inline bool Screenshot::execute(Script* script, QWebFrame* frame) {
|
||||
if (!script->screenshots()) return true;
|
||||
Logger log(this, script);
|
||||
if (!script->screenshots()) {
|
||||
log("screenshots disabled");
|
||||
return true;
|
||||
}
|
||||
QString filename(screenshot(line(), script->targetdir(),
|
||||
script->testclass(),
|
||||
script->replacevars(_filename), frame));
|
||||
|
||||
@@ -123,13 +123,15 @@ class TestGUI: public QMainWindow, protected Ui::TestGUI {
|
||||
if (_setupscriptactive->isEnabled()
|
||||
&& _setupscriptactive->isChecked()) {
|
||||
script.parse(_setupscript->toPlainText().split('\n'), "setup");
|
||||
script.run(_web->page()->mainFrame(), testsuites, QString(), false);
|
||||
script.run(_web->page()->mainFrame(), testsuites, QString(),
|
||||
_screenshots->isChecked());
|
||||
script.reset();
|
||||
}
|
||||
QString text(_testscript->textCursor().selection().toPlainText());
|
||||
if (text.isEmpty()) text = _testscript->toPlainText();
|
||||
script.parse(text.split('\n'), "script");
|
||||
script.run(_web->page()->mainFrame(), testsuites, QString(), false);
|
||||
script.run(_web->page()->mainFrame(), testsuites, QString(),
|
||||
_screenshots->isChecked());
|
||||
} catch (std::exception &x) {
|
||||
QMessageBox::critical(this, tr("Script Failed"),
|
||||
tr("Script failed with message:\n%1")
|
||||
@@ -226,7 +228,7 @@ class TestGUI: public QMainWindow, protected Ui::TestGUI {
|
||||
script.run(page.mainFrame(), testsuites, QString(), false);
|
||||
_setupScript.cleanup();
|
||||
_setupScript.parse(_setupscript->toPlainText().split('\n'), "setup");
|
||||
_setupScript.run(page.mainFrame(), testsuites, QString(), false);;
|
||||
_setupScript.run(page.mainFrame(), testsuites, QString(), false);
|
||||
_setupscriptstatus->setText(trUtf8("✔"));
|
||||
_setupscriptactive->setEnabled(true);
|
||||
} catch (std::exception &x) {
|
||||
|
||||
@@ -399,7 +399,7 @@ this.dispatchEvent(evObj);</string>
|
||||
</attribute>
|
||||
<widget class="QWidget" name="dockWidgetContents_12">
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0" rowspan="3">
|
||||
<item row="0" column="0" rowspan="4">
|
||||
<widget class="QPlainTextEdit" name="_testscript"/>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
@@ -422,7 +422,7 @@ this.dispatchEvent(evObj);</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<item row="3" column="1">
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
@@ -435,6 +435,13 @@ this.dispatchEvent(evObj);</string>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QCheckBox" name="_screenshots">
|
||||
<property name="text">
|
||||
<string>Screenshots</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
|
||||
Reference in New Issue
Block a user