The things a page does that are not visible on it: messages to the console, a request over the network, a task that finishes after a beat. Trigger them here and read them back with the tools built for exactly that.
Read the console with read_console_messages, the request with read_network_requests, and pause for the slow result with wait_for.
read_console_messages · read_network_requests · wait_for
Trigger some signals
Each button is harmless: the log writes to the console, the fetch pulls a small same-origin JSON file, the slow task just waits.
The slow task finished. (read_network_requests and wait_for both had something to catch.)