Ricerca dei profili con suggerimenti e foto (#37)
«Aggiungi account» ha una sola casella: mentre Alberto scrive compaiono subito i suggerimenti locali, poi i profili di Instagram con la foto, come chiesto in #37. Il browser di Febe scrive nella casella «Cerca» di Instagram con tasti veri da una mappa chiusa (mai Invio, Tab o Esc), controlla prima il fuoco, legge la risposta della pagina e non clicca mai un risultato. La ricerca ha una categoria propria nel Governatore, con tetti larghi che non consumano quelli della raccolta, e si dà il turno con il motore sull'unica pagina; a fine sessione la pagina torna comunque al riposo. Le foto passano dal CDN con un permesso ciascuna e restano solo in memoria. Le risposte di Alberto del 15 novembre (controllo del fuoco, turni, evento requestWillBeSent, niente foto dei seguiti per ora) sono in §6.1 e in docs/decisioni.md. Su Instagram vero la ricerca parte quando i bersagli search-open e search-box saranno raccolti dal vivo. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
5e417c666d
commit
9941a2fa1f
98 files changed
+8021
-229
No files matched your search
@@ -232,6 +232,28 @@ public sealed partial class SyntheticSiteSeedTests
|
||||
Assert.IsEmpty(hidden.Contents);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
[Timeout(30_000, CooperativeCancellation = true)]
|
||||
public async Task TheSearchOfTheSiteAnswersInTheShapeOfTheCleanedSample()
|
||||
{
|
||||
// Issue #37: the same keys as 000002-ricerca-profili, read by the same search vocabulary as Instagram's.
|
||||
await using var site = await SyntheticSite.StartAsync();
|
||||
var answer = await ReadAsync(site, "/dati/cerca?testo=" + Uri.EscapeDataString("Marta"));
|
||||
Assert.IsNotNull(answer.Search);
|
||||
Assert.AreEqual("marta.prova", answer.Search.Hits[0].Profile.Username);
|
||||
Assert.AreEqual("1001", answer.Search.Hits[0].Profile.Id);
|
||||
Assert.IsNotNull(answer.Search.Hits[0].Profile.Picture, "a photo on the CDN of the site");
|
||||
Assert.IsEmpty(answer.Profiles, "search results are not followed profiles");
|
||||
|
||||
var all = await ReadAsync(site, "/dati/cerca?testo=prova");
|
||||
Assert.IsTrue(all.Search!.Hits.Count is > 1 and <= DataApi.SearchSize);
|
||||
Assert.IsFalse(all.Search.Hits.Any(h => h.Profile.Username == "alberto.prova"), "the connected account is not a result");
|
||||
CollectionAssert.AreEqual(Enumerable.Range(0, all.Search.Hits.Count).ToArray(), all.Search.Hits.Select(h => h.Position).ToArray());
|
||||
|
||||
var none = await ReadAsync(site, "/dati/cerca?testo=qqqzzz");
|
||||
Assert.HasCount(0, none.Search!.Hits);
|
||||
}
|
||||
|
||||
private async Task<ReadResult> ReadAsync(TestSite site, string pathAndQuery)
|
||||
{
|
||||
var result = Reader.Read(await site.GetDataAsync(pathAndQuery, TestContext.CancellationToken));
|
||||
|
||||
Reference in new issue
Block a user