2014-10-01 72 views
2

我不確定我是否正確地使用它,因爲我無法看到有關此功能的大量文檔。但我看到有可能使用file://作爲baseUrl選項。量角器使用文件://

現在我使用Chrome來運行我的量角器測試,並希望運行它們,而不是針對服務器運行,因爲實際上沒有任何需要。當此配置中運行量角器它似乎無法獲取文件出現這種情況的唯一的事情是,地址又發表了

data:text/html,<html></html>

,然後給我留下下面的輸出

Failures: 

    1) Test that my App can get Mocked data Should be on the correct page 
    Message: 
    Error: Timed out waiting for page to load after 10000ms 
Wait timed out after 10062ms 
    Stacktrace: 
    Error: Timed out waiting for page to load after 10000ms 
Wait timed out after 10062ms 
==== async task ==== 
Timed out waiting for page to load after 10000ms 
    at null.<anonymous> (/home/nwhite/Sites/apibyexample/abe-protractor/tests/e2e/app/myTestApp.spec.js:3:17) 
==== async task ==== 
Asynchronous test function: beforeEach() 
Error 
    at null.<anonymous> (/home/nwhite/Sites/apibyexample/abe-protractor/tests/e2e/app/myTestApp.spec.js:2:5) 
    at Object.<anonymous> (/home/nwhite/Sites/apibyexample/abe-protractor/tests/e2e/app/myTestApp.spec.js:1:63) 

Finished in 12.435 seconds 
1 test, 1 assertion, 1 failure 

Shutting down selenium standalone server. 

有沒有關於此的任何文檔?是否有可能使用Chrome,因爲我只能看到提及的東西node-webkit?是否有我需要實現的任何不同的配置選項?

在先進的感謝

回答

1

問題爲您的使用情況下,量角器做self.driver.executeScript('return window.location.href;')here

由於沒有JS將有可能在file://執行即使您嘗試黑客量角器和評論這一節別的東西將打破後來。

因此,似乎使用file://作爲baseUrl是死路一條。

+0

https://github.com/angular/protractor/commit/830f51128d1ca6c8858c99617b2752172044a752建議它在更新日誌文件中執行它 – 2014-10-01 19:14:21

+0

您是對的。讓我們等待朱莉或漢克跳進去。 – 2014-10-01 19:35:05

+0

我已經調試了一下,並認爲會在這裏,我已經創建了一個公關https://github.com/angular/protractor/pull/1391 – 2014-10-01 21:18:00