久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

<small id='2EVgq'></small><noframes id='2EVgq'>

<tfoot id='2EVgq'></tfoot>

      <bdo id='2EVgq'></bdo><ul id='2EVgq'></ul>
    <legend id='2EVgq'><style id='2EVgq'><dir id='2EVgq'><q id='2EVgq'></q></dir></style></legend>
    <i id='2EVgq'><tr id='2EVgq'><dt id='2EVgq'><q id='2EVgq'><span id='2EVgq'><b id='2EVgq'><form id='2EVgq'><ins id='2EVgq'></ins><ul id='2EVgq'></ul><sub id='2EVgq'></sub></form><legend id='2EVgq'></legend><bdo id='2EVgq'><pre id='2EVgq'><center id='2EVgq'></center></pre></bdo></b><th id='2EVgq'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='2EVgq'><tfoot id='2EVgq'></tfoot><dl id='2EVgq'><fieldset id='2EVgq'></fieldset></dl></div>

        “window.angular 未定義."當使用量角器進行自動

        quot;window.angular is undefined.quot; when using protractor for automated testing?(“window.angular 未定義.當使用量角器進行自動化測試時?)
          <tbody id='ba3p4'></tbody>

          <small id='ba3p4'></small><noframes id='ba3p4'>

          <tfoot id='ba3p4'></tfoot>

            <i id='ba3p4'><tr id='ba3p4'><dt id='ba3p4'><q id='ba3p4'><span id='ba3p4'><b id='ba3p4'><form id='ba3p4'><ins id='ba3p4'></ins><ul id='ba3p4'></ul><sub id='ba3p4'></sub></form><legend id='ba3p4'></legend><bdo id='ba3p4'><pre id='ba3p4'><center id='ba3p4'></center></pre></bdo></b><th id='ba3p4'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='ba3p4'><tfoot id='ba3p4'></tfoot><dl id='ba3p4'><fieldset id='ba3p4'></fieldset></dl></div>

              <legend id='ba3p4'><style id='ba3p4'><dir id='ba3p4'><q id='ba3p4'></q></dir></style></legend>
              • <bdo id='ba3p4'></bdo><ul id='ba3p4'></ul>

                  本文介紹了“window.angular 未定義."當使用量角器進行自動化測試時?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  使用量角器提供的示例 conf.js 時似乎出現錯誤.我正在使用 grunt-protractor-runner 運行我的測試,但即使使用提供的示例配置也會出錯.

                  I seem to have an error when using the example conf.js provided with protractor. I am running my tests with grunt-protractor-runner but it errors even when using the example config provided.

                  我的 Gruntfile.js 看起來像這樣:

                  My Gruntfile.js looks like this:

                  /*global module:false*/
                  module.exports = function(grunt) {
                    // Project configuration.
                      grunt.initConfig({
                        protractor: {
                          options: {
                            configFile: "smoketest.conf.js", // Default config file
                            keepAlive: false, // If false, the grunt process stops when the test fails.
                            noColor: false, // If true, protractor will not use colors in its output.
                            webdriverManagerUpdate: true,
                            args: {
                              seleniumServerJar: './node_modules/protractor/selenium/selenium-server-standalone-2.51.0.jar'
                            }
                          },
                          smoke_test: {   // Grunt requires at least one target to run so you can simply put 'all: {}' here too.
                            options: {
                              configFile: "smoketest.conf.js", // Target-specific config file
                              args: {
                                }
                            }
                          },
                          protractor_test: {   // Grunt requires at least one target to run so you can simply put 'all: {}' here too.
                              options: {
                                  configFile: "./node_modules/protractor/example/conf.js", // Target-specific config file
                                  args: {
                                  }
                              }
                          },
                  
                  
                        },
                      })
                  
                    grunt.loadNpmTasks('grunt-protractor-runner');
                    // Default task.
                    grunt.registerTask('default', ['protractor:smoke_test']);
                  
                  };
                  

                  我正在運行使用此文件的 grunt protractor:protractor_test:

                  I am running grunt protractor:protractor_test which uses this file:

                  describe('angularjs homepage', function() {
                    it('should greet the named user', function() {
                      browser.get('http://www.angularjs.org');
                  
                      element(by.model('yourName')).sendKeys('Julie');
                  
                      var greeting = element(by.binding('yourName'));
                  
                      expect(greeting.getText()).toEqual('Hello Julie!');
                    });
                  
                    describe('todo list', function() {
                      var todoList;
                  
                      beforeEach(function() {
                        browser.get('http://www.angularjs.org');
                  
                        todoList = element.all(by.repeater('todo in todoList.todos'));
                      });
                  
                      it('should list todos', function() {
                        expect(todoList.count()).toEqual(2);
                        expect(todoList.get(1).getText()).toEqual('build an angular app');
                      });
                  
                      it('should add a todo', function() {
                        var addTodo = element(by.model('todoList.todoText'));
                        var addButton = element(by.css('[value="add"]'));
                  
                        addTodo.sendKeys('write a protractor test');
                        addButton.click();
                  
                        expect(todoList.count()).toEqual(3);
                        expect(todoList.get(2).getText()).toEqual('write a protractor test');
                      });
                    });
                  });
                  

                  但是,當它運行時,我會遇到錯誤

                  however, when this runs i am presented with the error

                  Error while waiting for Protractor to sync with the page: "window.angular is undefined.  This could be either because this is a non-angular page or because your test involves client-side navigation, which can interfere with Protractor's bootstrapping.  See http://git.io/v4gXM for details"`enter code here`
                  

                  我去過 http://git.io/v4gXM 但我似乎找不到任何可以解決的問題我的問題?有沒有其他人遇到過這個問題,示例測試應該總是有效嗎?

                  I have been to http://git.io/v4gXM but i cannot seem to find anything to fix my issue? Has anybody else had this issue, surely the example test should work always??

                  推薦答案

                  Exclaimer!!:這并不能回答您的問題,但提供了解決問題的技巧.

                  Exclaimer!!: This doesn't answer your question as such but provides a hack to solve it.

                  Protractor 要求 Angular 頁面在按預期運行之前完成同步.因此,為了解決此問題,您可以使用:

                  Protractor requires the Angular page to finish synchronization before it runs it's expectations. Therefore, in order to work around this issue you can use:

                  browser.ignoreSynchronization = true;
                  browser.waitForAngular();
                  browser.sleep(500); 
                  

                  這告訴瀏覽器量角器打開不要等待 Angular 同步(ignoreSynchronization),然后等待 Angular 完成它正在做的所有其他事情,然后它增加了 500 毫秒的等待時間,讓量角器有機會找到 addButton.click().當等待完成時,它會強制量角器移動到包含您期望的下一行代碼,在此之前,它停止在 addButton.click() 行并等待同步(這是'沒有發生),在它繼續之前.

                  This tells the browser that protractor opens to not wait for the Angular to synchronize (ignoreSynchronization), then it waits for angular to finish everything else it's doing, then it adds a 500 millisecond wait to give protractor a chance to find addButton.click(). When the wait finishes, it forces protractor to move onto the next line of code which contains your expect, before this, it was stopping at the addButton.click() line and waiting for the sync (which wasn't happening), before it moved on.

                  (我認為...)

                  這篇關于“window.angular 未定義."當使用量角器進行自動化測試時?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  Browser waits for ajax call to complete even after abort has been called (jQuery)(即使在調用 abort (jQuery) 之后,瀏覽器也會等待 ajax 調用完成)
                  JavaScript innerHTML is not working for IE?(JavaScript innerHTML 不適用于 IE?)
                  XMLHttpRequest cannot load, No #39;Access-Control-Allow-Origin#39; header is present on the requested resource(XMLHttpRequest 無法加載,請求的資源上不存在“Access-Control-Allow-Origin標頭) - IT屋-程序員軟件開發技術分
                  Is it possible for XHR HEAD requests to not follow redirects (301 302)(XHR HEAD 請求是否有可能不遵循重定向 (301 302))
                  XMLHttpRequest 206 Partial Content(XMLHttpRequest 206 部分內容)
                  Restrictions of XMLHttpRequest#39;s getResponseHeader()?(XMLHttpRequest 的 getResponseHeader() 的限制?)
                  <i id='irIf3'><tr id='irIf3'><dt id='irIf3'><q id='irIf3'><span id='irIf3'><b id='irIf3'><form id='irIf3'><ins id='irIf3'></ins><ul id='irIf3'></ul><sub id='irIf3'></sub></form><legend id='irIf3'></legend><bdo id='irIf3'><pre id='irIf3'><center id='irIf3'></center></pre></bdo></b><th id='irIf3'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='irIf3'><tfoot id='irIf3'></tfoot><dl id='irIf3'><fieldset id='irIf3'></fieldset></dl></div>

                  <small id='irIf3'></small><noframes id='irIf3'>

                    <bdo id='irIf3'></bdo><ul id='irIf3'></ul>
                        <legend id='irIf3'><style id='irIf3'><dir id='irIf3'><q id='irIf3'></q></dir></style></legend>

                              <tbody id='irIf3'></tbody>

                          • <tfoot id='irIf3'></tfoot>
                            主站蜘蛛池模板: 九九热免费观看 | 色伊人| 国产一区二区三区 | 狠狠爱免费视频 | 国产免费观看久久黄av片涩av | 男人的天堂久久 | 欧美日韩在线观看一区 | www.久 | 黄色av一区| 激情久久网 | 夜夜操天天艹 | av网站免费看 | 亚洲国产精品久久久久秋霞不卡 | 亚洲国产一区在线 | 特级丰满少妇一级aaaa爱毛片 | 精品久久电影 | 黄页网址在线观看 | 另类 综合 日韩 欧美 亚洲 | 每日更新av| 亚洲成人福利在线观看 | 亚洲日本激情 | 人人干人人看 | 久久久久免费精品国产小说色大师 | 天天精品综合 | 精品一区国产 | 一区二区三区福利视频 | 成人做爰www免费看视频网站 | 精品国产不卡一区二区三区 | 国产精品视频一 | 亚州精品天堂中文字幕 | 亚洲区一区二 | 日韩在线欧美 | 国产欧美综合在线 | 久久精品亚洲精品国产欧美 | 秋霞在线一区 | 欧美xxxx日本 | 久久综合久色欧美综合狠狠 | 国产精品美女久久久久aⅴ国产馆 | 欧美精品一区二区三区四区 在线 | 国产精品久久久久久高潮 | 久久国产精品久久 |