The expected URL is not always the id one but it could be also the path one as Web UI rewrites the URL to be the path one when displaying a document based on its id URL.
Sample failure message:
expected:<...st:8080/nuxeo/ui/#!/[doc/default/0a8ed094-6806-4870-9cea-c2e0003c47fd]> but was:<...st:8080/nuxeo/ui/#!/[browse/default-domain/workspaces/Workspace]>