2012-11-23 48 views
1

當我測試的內容被裝載異步I可以測試它這樣的網頁上:異步重定向測試與水豚和硒

assert page.should have_content(content) 

這工作,因爲它持續了內容檢查,直到它得到的頁面(或超時)。

你如何做到這一點與重定向?我從/index.html#login重定向到/index.html#main 這是我現在怎麼做的,但那不起作用:page.current_url.include?(uri)

回答

0

未測試,但我想這應該會讓你的網址正確:

current_url = evaluate_script(window.location.href)

而不是href你也可以用hashpathname

工作