This method is available since view component 2.31.0, and greatly simplifies tests depending on the current URL.