//go:build browser package headless import ( "context" "os" "path/filepath" "strconv" "strings" "testing" "time" "amadan.net/oficina/equipo/internal/browsertest" "amadan.net/oficina/equipo/internal/thintest" "amadan.net/oficina/equipo/internal/wire" "github.com/chromedp/chromedp" ) // notebookEnv is a coordinator that moved in (repo and own notes) and // noted something the person said. func notebookEnv(t *testing.T) (*Env, *thintest.Instance) { env, inst, r := localEnv(t) r.opts.NoMoveIn = false r.start(t) s := open(t, env) s.wait(t, "moved in", time.Minute, func(c *thintest.Conversation) bool { return c.Coordinator.State == wire.CoordinatorReady }) sent := s.send(t, "I like short replies, and plain words please.\ntool:write_note:+person|I like short replies, and plain words please.") s.waitTurn(t, sent.Turn.ID, wire.TurnReplied) if n := notebookText(t, s); !strings.Contains(n, "person") || !strings.Contains(n, "repo") { t.Fatalf("notebook for the page:\n%s", n) } return env, inst } // theme sets the page's theme as the theme switcher does. func (p *page) theme(name string) { p.t.Helper() p.check(`(()=>{document.documentElement.dataset.theme=`+jsonString(name)+`;return true})()`, "theme") } // TestNotebookScreenshots writes notebook-