diff --git a/app/src/ui/UiTest.cpp b/app/src/ui/UiTest.cpp index 1b37ca1..48bbec0 100644 --- a/app/src/ui/UiTest.cpp +++ b/app/src/ui/UiTest.cpp @@ -438,13 +438,27 @@ int runUiTest(AgentCore &core, const QString &size) { QStringLiteral("the card carries open and share")); win->setProperty("statusText", QString()); clickMouse(win, QStringLiteral("fileOpen0")); + /* This button lives in the scrolling transcript, and on the NX789J the + * synthesized mouse click does not reach a button there -- the same click + * lands in the header and in the sidebar. What a phone has is a finger, so + * try that too, and say in the message which one it took: neither is a + * failure to hide. */ + const bool byMouse = !win->property("statusText").toString().isEmpty(); + if (!byMouse) + tapTouch(win, touch, QStringLiteral("fileOpen0")); const QString opened = win->property("statusText").toString(); check(opened.startsWith(QLatin1String("opened ")), - QStringLiteral("Open hands the file to the system (%1)").arg(opened)); + QStringLiteral("Open hands the file to the system (%1%2)") + .arg(opened, byMouse ? QString() : QStringLiteral(" after a tap"))); + win->setProperty("statusText", QString()); clickMouse(win, QStringLiteral("fileShare0")); + const bool shareByMouse = !win->property("statusText").toString().isEmpty(); + if (!shareByMouse) + tapTouch(win, touch, QStringLiteral("fileShare0")); const QString shared = win->property("statusText").toString(); check(shared.contains(QLatin1String("report.md")), - QStringLiteral("Share names the file (%1)").arg(shared)); + QStringLiteral("Share names the file (%1%2)") + .arg(shared, shareByMouse ? QString() : QStringLiteral(" after a tap"))); const QString refused = core.openArtifact(QStringLiteral("art-not-one-of-ours.md")); check(refused.contains(QLatin1String("no such file")), @@ -877,6 +891,7 @@ int runUiTest(AgentCore &core, const QString &size) { /* the paste path: an image on the clipboard becomes an attachment */ QGuiApplication *gui = qobject_cast(QCoreApplication::instance()); +#if !defined(Q_OS_ANDROID) if (gui && gui->clipboard()) { QImage img(8, 8, QImage::Format_RGB32); img.fill(Qt::red); @@ -889,6 +904,13 @@ int runUiTest(AgentCore &core, const QString &size) { } else { check(false, QStringLiteral("there is a clipboard to paste from")); } +#else + /* Android's clipboard carries text and URIs, not images: setting one there + * does nothing, and a phone that "fails" this is not a phone that is + * broken. The paste path itself is the same code the desktop runs. */ + (void)gui; + note(QStringLiteral("clipboard image checks skipped (Android)")); +#endif /* --- tool calls: two calls of one tool are two cards ------------------ */ const int rows0 = list ? list->property("count").toInt() : -1;