don't bother with tests if there are javascript errors

This commit is contained in:
John Bintz 2011-04-12 07:32:04 -04:00
parent 39a1132293
commit a313b9bdfd

View File

@ -153,6 +153,7 @@ void HeadlessSpecRunner::timerEvent(QTimerEvent *event)
if (hasErrors && m_runs > 2)
QApplication::instance()->exit(1);
if (!hasErrors) {
if (!hasElement(".jasmine_reporter") && !hasElement(".runner.running"))
return;
@ -167,7 +168,7 @@ void HeadlessSpecRunner::timerEvent(QTimerEvent *event)
QWebElement desc = m_page.mainFrame()->findFirstElement(".description");
std::cout << "\033[0;31m" << "FAIL: " << qPrintable(desc.toPlainText()) << "\033[m" << std::endl;
m_page.mainFrame()->evaluateJavaScript(DUMP_MSG);
//QDesktopServices::openUrl(m_page.mainFrame()->url());
//QDesktopServices::openUrl(m_page.mainFrame()->url());
QApplication::instance()->exit(1);
return;
}
@ -176,6 +177,7 @@ void HeadlessSpecRunner::timerEvent(QTimerEvent *event)
std::cout << "WARNING: too many runs and the test is still not finished!" << std::endl;
QApplication::instance()->exit(1);
}
}
}
#include "specrunner.moc"