fix timing problem

master
Marc Wäckerlin 8 years ago
parent 23240097ee
commit 706ef30b71
  1. 2
      COPYING
  2. 2
      INSTALL
  3. 3
      configure.ac
  4. 4
      src/commands.hxx

@ -1 +1 @@
/usr/share/automake-1.13/COPYING /usr/share/automake-1.14/COPYING

@ -1 +1 @@
/usr/share/automake-1.13/INSTALL /usr/share/automake-1.14/INSTALL

@ -34,8 +34,7 @@ export QT_SELECT=5
AC_SUBST(QT_SELECT) AC_SUBST(QT_SELECT)
# qt features # qt features
AX_REQUIRE_QT([QT], [QtCore QtGui QtNetwork QtWebKit], AX_REQUIRE_QT([QT], [QtCore QtGui QtNetwork QtWebKit], [QtWidgets QtWebKitWidgets])
[QtWidgets QtWebKitWidgets])
AM_CPPFLAGS="${AM_CPPFLAGS} -DQT_NO_KEYWORDS" AM_CPPFLAGS="${AM_CPPFLAGS} -DQT_NO_KEYWORDS"
# libraries used # libraries used

@ -1508,16 +1508,16 @@ class Exists: public Command {
QString selector(script->replacevars(_selector)); QString selector(script->replacevars(_selector));
QString text(script->replacevars(_text)); QString text(script->replacevars(_text));
QStringList notfound; QStringList notfound;
QWebElement firstelement(find(frame, selector));
Q_FOREACH(QWebElement element, frame->findAllElements(selector)) { Q_FOREACH(QWebElement element, frame->findAllElements(selector)) {
if (text.isEmpty()) return true; // just find element if (text.isEmpty()) return true; // just find element
if (element.toOuterXml().indexOf(text)!=-1) return true; if (element.toOuterXml().indexOf(text)!=-1) return true;
if (element.toPlainText().indexOf(text)!=-1) return true; if (element.toPlainText().indexOf(text)!=-1) return true;
notfound += element.toOuterXml(); notfound += element.toOuterXml();
} }
QWebElement element(find(frame, selector));
if (text.isEmpty()) if (text.isEmpty())
error(log, AssertionFailed("element not found: "+selector)); error(log, AssertionFailed("element not found: "+selector));
else if (element.isNull()) else if (firstelement.isNull())
error(log, AssertionFailed("expected \""+text+"\" in non existing element " error(log, AssertionFailed("expected \""+text+"\" in non existing element "
+selector)); +selector));
else else

Loading…
Cancel
Save