There are examples in other tests how to do this using $crawler.