// Probe (screenshot): a real public-ID post, an alias equal to that ID's 8-hex display, // an alias "Anonymous", and a real anonymous post, side by side in the discussion feed. import QtQuick import QtTest import QtQuick.Controls import "../../src/native/forum/qml" as Forum TestCase { id: testCase; name: "ProbeSpoof"; width: 1100; height: 760; visible: true; when: windowShown Component { id: appComponent; Forum.Main { width: 1100; height: 760 } } function test_feed() { var app = createTemporaryObject(appComponent, testCase); tryCompare(app.controller, "ready", true); var c = app.controller, uid = ""; c.call({op: "identity", alias: "victim"}); c.call({op: "settings", mode: "uid"}); c.call({op: "post", board: "general", title: "1 · Real public ID", body: "Posted in Unique ID mode."}, function (r) { c.call({op: "postInfo", id: r.id}, function (p) { uid = p.post.author; }); }); verify(uid.length === 64); c.call({op: "identity", alias: uid.substring(0, 8)}); c.call({op: "settings", mode: "alias"}); c.call({op: "post", board: "general", title: "2 · Alias = victim's displayed ID", body: "Posted in alias mode by someone else."}); c.call({op: "identity", alias: "Anonymous"}); c.call({op: "post", board: "general", title: "3 · Alias = \"Anonymous\"", body: "Signed alias post."}); c.call({op: "settings", mode: "anonymous"}); c.call({op: "post", board: "general", title: "4 · Real anonymous post", body: "No key."}); c.refresh(); wait(1500); grabImage(app).save("/tmp/agora-review/probes/spoof-feed.png"); console.log("PROBE saved feed screenshot; victim display id =", uid.substring(0, 8)); } }