Testing a facebook application

I am wondering how to go about testing a Facebook application using the included testing framework.

The idea is that a Facebook application is just a web app (ember app in this case) inside an iframe on the Facebook page.

The trick is, if a use goes to this page from outside Facebook, they will be immediately directed back to the Facebook url for this application.

All this being said, how would i go about running tests? How would i address the DOM inside the iframe?

Thanks!