2014-04-29 168 views

回答

39

你可以用量角器調試/暫停功能,暫停端到端運行,這將最終離開瀏覽器中打開:more info here

要做到這一點,沒有一個

browser.pause(); 
之前,您量角器測試中加入這一行

還有一個非常有用的工具叫做elementor,你可能想稍後再看看。

+0

這對我不起作用。輸入「c」後,它會通過所有測試並忽略browser.debugger()行。 breakrs in timers.js:79 77} 79 function listOnTimeout(){ 80 var msecs = this.msecs; 81 var list = this; debug> c – user1679130

+0

如果在沒有調試器的情況下以同樣的方式進行調試,那麼它就是別的,與調試功能無關。 –

+0

通過「通過測試吹」我的意思是browser.debugger()行的增加沒有影響。 – user1679130

1

如果您配置的測試腳本使用咕嚕運行,你可以使用下面的代碼:

grunt.initConfig({ 
    // ... 
    protractor: { 
     options: { 
     configFile: "protractor.conf.js", 
     keepAlive: true, // If false, the grunt process stops when the test fails. 
     noColor: false // If true, protractor will not use colors in its output. 
     }, 
     run: {} 
    }, 
    // ... 
    }); 
1

browser.pause不再需要使用當前節點V8.1.0的作品,看到here,但你可以使用browser.sleep(10000);保持瀏覽器打開例如10秒