2017-10-10 39 views
0

ng e2e沒有在代理/防火牆後面工作,因此全局安裝了量角器,然後更新了webdriver-manager更新(使用代理),然後將輸出複製到我的項目中。 之後,我運行的命令NG E2E和我得到以下錯誤:Angular e2e測試不起作用

webpack: Compiled successfully. 
[11:19:15] I/update - chromedriver: file exists C:\Dev\deviceprofiler\ui\node_modules\protractor\node_modules\webdriver-manager\seleniu 
m\chromedriver_2.33.zip 
[11:19:15] I/update - chromedriver: unzipping chromedriver_2.33.zip 
[11:19:15] I/update - chromedriver: chromedriver_2.33.exe up to date 
[11:19:16] I/launcher - Running 1 instances of WebDriver 
[11:19:16] I/direct - Using ChromeDriver directly... 
Jasmine started 
[11:19:31] E/protractor - Could not find Angular on page http://localhost:49152/ : retries looking for angular exceeded 

有什麼問題,我怎麼可以運行背後代理NG端對端測試。我需要遵循哪些步驟?

+0

「不工作」不是一個技術術語。 – Rob

+0

@Rob我不確定你的意思?我不知道問題是什麼在頁面http:// localhost:49152 /中找不到Angular應用Cleary在瀏覽器中加載這個URL,然後我得到這個錯誤。不知道我還能說什麼。 – Angad

回答

0

這意味着量角器無法在您的網頁中找到"Angular"。如果您的應用程序是非角度應用程序,或者如果Protractor在預定義時間段內在頁面中找不到Angular,則會引發此錯誤。

根據條件,您需要增加超時時間(很可能是由於代理服務器)或配置量角器不等待量角器。

這兩個都已經被討論過here

您可以配置使用量角器

  • browser.waitForAngularEnabled(false)
  • browser.ignoreSynchronization = true

我寧願後來一個做同樣不等待角。

+0

我確實增加了超時時間,但我得到了同樣的錯誤。 – Angad

+0

你嘗試禁用等待Angular? – demouser123

+0

我如何在角度cli中做到這一點? – Angad