don't bother with tests if there are javascript errors
This commit is contained in:
parent
39a1132293
commit
a313b9bdfd
@ -153,6 +153,7 @@ void HeadlessSpecRunner::timerEvent(QTimerEvent *event)
|
|||||||
if (hasErrors && m_runs > 2)
|
if (hasErrors && m_runs > 2)
|
||||||
QApplication::instance()->exit(1);
|
QApplication::instance()->exit(1);
|
||||||
|
|
||||||
|
if (!hasErrors) {
|
||||||
if (!hasElement(".jasmine_reporter") && !hasElement(".runner.running"))
|
if (!hasElement(".jasmine_reporter") && !hasElement(".runner.running"))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -167,7 +168,7 @@ void HeadlessSpecRunner::timerEvent(QTimerEvent *event)
|
|||||||
QWebElement desc = m_page.mainFrame()->findFirstElement(".description");
|
QWebElement desc = m_page.mainFrame()->findFirstElement(".description");
|
||||||
std::cout << "\033[0;31m" << "FAIL: " << qPrintable(desc.toPlainText()) << "\033[m" << std::endl;
|
std::cout << "\033[0;31m" << "FAIL: " << qPrintable(desc.toPlainText()) << "\033[m" << std::endl;
|
||||||
m_page.mainFrame()->evaluateJavaScript(DUMP_MSG);
|
m_page.mainFrame()->evaluateJavaScript(DUMP_MSG);
|
||||||
//QDesktopServices::openUrl(m_page.mainFrame()->url());
|
//QDesktopServices::openUrl(m_page.mainFrame()->url());
|
||||||
QApplication::instance()->exit(1);
|
QApplication::instance()->exit(1);
|
||||||
return;
|
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;
|
std::cout << "WARNING: too many runs and the test is still not finished!" << std::endl;
|
||||||
QApplication::instance()->exit(1);
|
QApplication::instance()->exit(1);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#include "specrunner.moc"
|
#include "specrunner.moc"
|
||||||
|
Loading…
Reference in New Issue
Block a user