|
|
@ -35,6 +35,7 @@ class TestGUI: public QMainWindow, protected Ui::TestGUI { |
|
|
|
_typing(false), |
|
|
|
_typing(false), |
|
|
|
_inEventFilter(false) { |
|
|
|
_inEventFilter(false) { |
|
|
|
setupUi(this); |
|
|
|
setupUi(this); |
|
|
|
|
|
|
|
_progress->hide(); |
|
|
|
QSettings settings("mrw", "webtester"); |
|
|
|
QSettings settings("mrw", "webtester"); |
|
|
|
restoreGeometry(settings.value("geometry").toByteArray()); |
|
|
|
restoreGeometry(settings.value("geometry").toByteArray()); |
|
|
|
restoreState(settings.value("windowstate").toByteArray()); |
|
|
|
restoreState(settings.value("windowstate").toByteArray()); |
|
|
@ -112,6 +113,8 @@ class TestGUI: public QMainWindow, protected Ui::TestGUI { |
|
|
|
_actionRevertToSaved->setEnabled(false); |
|
|
|
_actionRevertToSaved->setEnabled(false); |
|
|
|
} |
|
|
|
} |
|
|
|
void on__run_clicked() { |
|
|
|
void on__run_clicked() { |
|
|
|
|
|
|
|
_progress->reset(); |
|
|
|
|
|
|
|
_progress->show(); |
|
|
|
bool oldRecordState(_record->isChecked()); |
|
|
|
bool oldRecordState(_record->isChecked()); |
|
|
|
_record->setChecked(false); |
|
|
|
_record->setChecked(false); |
|
|
|
_record->setEnabled(false); |
|
|
|
_record->setEnabled(false); |
|
|
@ -119,6 +122,7 @@ class TestGUI: public QMainWindow, protected Ui::TestGUI { |
|
|
|
try { |
|
|
|
try { |
|
|
|
Script script; |
|
|
|
Script script; |
|
|
|
connect(&script, SIGNAL(logging(QString)), SLOT(logging(QString))); |
|
|
|
connect(&script, SIGNAL(logging(QString)), SLOT(logging(QString))); |
|
|
|
|
|
|
|
connect(&script, SIGNAL(progress(QString, int, int)), SLOT(progress(QString, int, int))); |
|
|
|
std::shared_ptr<xml::Node> testsuites(new xml::Node("testsuite")); |
|
|
|
std::shared_ptr<xml::Node> testsuites(new xml::Node("testsuite")); |
|
|
|
if (_setupscriptactive->isEnabled() |
|
|
|
if (_setupscriptactive->isEnabled() |
|
|
|
&& _setupscriptactive->isChecked()) { |
|
|
|
&& _setupscriptactive->isChecked()) { |
|
|
@ -140,6 +144,7 @@ class TestGUI: public QMainWindow, protected Ui::TestGUI { |
|
|
|
_run->setEnabled(true); |
|
|
|
_run->setEnabled(true); |
|
|
|
_record->setEnabled(true); |
|
|
|
_record->setEnabled(true); |
|
|
|
_record->setChecked(oldRecordState); |
|
|
|
_record->setChecked(oldRecordState); |
|
|
|
|
|
|
|
_progress->hide(); |
|
|
|
} |
|
|
|
} |
|
|
|
void on__focused_clicked() { |
|
|
|
void on__focused_clicked() { |
|
|
|
enterText(true); |
|
|
|
enterText(true); |
|
|
@ -165,13 +170,13 @@ class TestGUI: public QMainWindow, protected Ui::TestGUI { |
|
|
|
} |
|
|
|
} |
|
|
|
void on__web_loadProgress(int progress) { |
|
|
|
void on__web_loadProgress(int progress) { |
|
|
|
enterText(true); |
|
|
|
enterText(true); |
|
|
|
_progress->setValue(progress); |
|
|
|
_webprogress->setValue(progress); |
|
|
|
} |
|
|
|
} |
|
|
|
void on__web_loadStarted() { |
|
|
|
void on__web_loadStarted() { |
|
|
|
enterText(true); |
|
|
|
enterText(true); |
|
|
|
if (_record->isChecked()) |
|
|
|
if (_record->isChecked()) |
|
|
|
appendCommand("expect "+map("loadStarted")); |
|
|
|
appendCommand("expect "+map("loadStarted")); |
|
|
|
_progress->setValue(0); |
|
|
|
_webprogress->setValue(0); |
|
|
|
_urlStack->setCurrentIndex(PROGRESS_VIEW); |
|
|
|
_urlStack->setCurrentIndex(PROGRESS_VIEW); |
|
|
|
} |
|
|
|
} |
|
|
|
void on__web_statusBarMessage(const QString&) { |
|
|
|
void on__web_statusBarMessage(const QString&) { |
|
|
@ -281,6 +286,12 @@ class TestGUI: public QMainWindow, protected Ui::TestGUI { |
|
|
|
if (!vb) return; |
|
|
|
if (!vb) return; |
|
|
|
vb->setValue(vb->maximum()); |
|
|
|
vb->setValue(vb->maximum()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
void progress(const QString& txt, int pos, int max) { |
|
|
|
|
|
|
|
_progress->setFormat(QString("%1 — %p%").arg(txt)); |
|
|
|
|
|
|
|
_progress->setMinimum(0); |
|
|
|
|
|
|
|
_progress->setMaximum(max); |
|
|
|
|
|
|
|
_progress->setValue(pos); |
|
|
|
|
|
|
|
} |
|
|
|
void appendCommand(const QString& txt) { |
|
|
|
void appendCommand(const QString& txt) { |
|
|
|
_testscript->appendPlainText(txt); |
|
|
|
_testscript->appendPlainText(txt); |
|
|
|
QScrollBar *vb(_testscript->verticalScrollBar()); |
|
|
|
QScrollBar *vb(_testscript->verticalScrollBar()); |
|
|
|