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

<tfoot id='FoMkd'></tfoot>
  • <legend id='FoMkd'><style id='FoMkd'><dir id='FoMkd'><q id='FoMkd'></q></dir></style></legend>

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

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

        在量角器中測試模板?

        Testing templates in Protractor?(在量角器中測試模板?)

        1. <small id='2UvfT'></small><noframes id='2UvfT'>

            <tbody id='2UvfT'></tbody>

                <bdo id='2UvfT'></bdo><ul id='2UvfT'></ul>
              • <i id='2UvfT'><tr id='2UvfT'><dt id='2UvfT'><q id='2UvfT'><span id='2UvfT'><b id='2UvfT'><form id='2UvfT'><ins id='2UvfT'></ins><ul id='2UvfT'></ul><sub id='2UvfT'></sub></form><legend id='2UvfT'></legend><bdo id='2UvfT'><pre id='2UvfT'><center id='2UvfT'></center></pre></bdo></b><th id='2UvfT'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='2UvfT'><tfoot id='2UvfT'></tfoot><dl id='2UvfT'><fieldset id='2UvfT'></fieldset></dl></div>
                <legend id='2UvfT'><style id='2UvfT'><dir id='2UvfT'><q id='2UvfT'></q></dir></style></legend>
                  <tfoot id='2UvfT'></tfoot>
                  本文介紹了在量角器中測試模板?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  編寫應用于站點中每個頁面的斷言的最佳方法是什么?

                  What's the best way to write assertions that should apply across every page in a site?

                  我正在測試我的網站頁腳中是否存在一個元素,因此該元素應該存在于所有頁面上.

                  I'm testing to see if an element exists in the footer of my site, so the element should exist on all pages.

                  我正在考慮編寫一個單獨的文件來測試網站的模板元素,然后將其包含在所有規(guī)范中.不過好像沒有其他人這樣做?

                  I am thinking of writing a separate file for testing template elements of the site, and then include this in all specs. It doesn't seem like anyone else is doing this though?

                  推薦答案

                  首先,為了編寫更清晰的測試并更好地了解目標站點的組成,請應用 頁面對象模式 并將您的網頁部分拆分為不同的頁面對象.例如,footerheader 可以而且應該是獨立的頁面對象,可以在您網站的不同網頁中重復使用.

                  First of all, for writing cleaner tests and having a better understanding of what your target site consists of, apply the Page Object pattern and split the parts of your web pages into different page objects. For instance, footer, header can and should be separate page objects that would be reused across different web pages of your site.

                  更多主題:

                  • 使用頁面對象組織測試
                  • 量角器頁面對象(教程,非常詳細)
                  • PageObject (Martin Fowler)
                  • 使用頁面對象克服 Protractor 的缺點

                  據我了解的問題,要遵循DRY"原則,您希望擁有某種共享"茉莉花規(guī)格,您可以定義一次并在多個測試套件中運行.

                  As far as I understand the question, to follow the "DRY" principle you want to have some sort of the "shared" jasmine specs that you can define once and run in multiple test suites.

                  這正是 用共享行為干燥 Jasmine Specs 文章正在描述.這個想法相當簡單——在你的測試套件中定義一個函數,并從其他測試套件中調用它.示例:

                  This is exactly what DRYing up Jasmine Specs with Shared Behavior article is describing. The idea is rather simple - define a function with your test suites inside and call it from other test suites. Example:

                  • 創(chuàng)建一個函數,該函數接受上下文 - 頁面對象 - 并包含特定于頁腳的可重用測試:

                  • create a function which accepts a context - page object - and contains the footer specific reusable tests:

                  function testFooter(footer) {
                  
                      describe("(shared)", function () {
                  
                          describe("should show footer with necessary information", function () {
                              it("should show copyright", function () {
                                  expect(footer.copyright.getText()).toEqual('Copyright 2014');
                              });
                          });
                  
                      });
                  }
                  

                1. 從傳遞上下文的其他測試套件調用該函數 - 頁腳頁面對象:

                2. call the function from other test suites passing the context - footer page object:

                  var FooterPage = require('./footer.po.js');
                  
                  describe('Contacts page', function () {
                      var scope = {};
                  
                      beforeEach(function () {
                          browser.get('/contacts/');
                          browser.waitForAngular();
                          scope.page = new ContactsPage();
                      });
                  
                      // other contacts page specific suites 
                      // ...
                  
                      testFooter(new FooterPage());
                  
                  });
                  

                3. 您可能需要調整和改進代碼以使其正常工作,但理念保持不變:定義一次并重用.傳遞頁面對象只會使它更干凈和透明.

                  You may need to adjust and improve the code to make it work, but the idea stays the same: define once and reuse. Passing around page objects just makes it a lot cleaner and transparent.

                  另見:

                  • 什么是重用測試代碼的好方法茉莉花?
                  • 量角器頁面對象繼承

                  這篇關于在量角器中測試模板?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

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

                  相關文檔推薦

                  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屋-程序員軟件開發(fā)技術分
                  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='NFafF'><tr id='NFafF'><dt id='NFafF'><q id='NFafF'><span id='NFafF'><b id='NFafF'><form id='NFafF'><ins id='NFafF'></ins><ul id='NFafF'></ul><sub id='NFafF'></sub></form><legend id='NFafF'></legend><bdo id='NFafF'><pre id='NFafF'><center id='NFafF'></center></pre></bdo></b><th id='NFafF'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='NFafF'><tfoot id='NFafF'></tfoot><dl id='NFafF'><fieldset id='NFafF'></fieldset></dl></div>
                  • <small id='NFafF'></small><noframes id='NFafF'>

                      <tfoot id='NFafF'></tfoot><legend id='NFafF'><style id='NFafF'><dir id='NFafF'><q id='NFafF'></q></dir></style></legend>
                        <bdo id='NFafF'></bdo><ul id='NFafF'></ul>
                          <tbody id='NFafF'></tbody>

                            主站蜘蛛池模板: 日韩欧美国产精品一区二区三区 | 欧美片网站免费 | 亚洲欧美一区二区三区在线 | 一区二区日韩 | 国产一区二区免费电影 | 操操操操操 | 亚洲三区在线观看 | av手机在线免费观看 | 免费视频久久久久 | 欧美一区 | 九九热精品免费 | 九九热精品视频 | 中文字幕av中文字幕 | 日韩久久久久久 | 超碰8 | 一区二区福利视频 | 国产免费一区二区 | 成人免费视频在线观看 | 97在线观视频免费观看 | 91精品午夜窝窝看片 | 精品日韩欧美一区二区 | 黄色网址免费在线观看 | 国产欧美一区二区久久性色99 | 欧美亚洲日本 | 美女一区二区在线观看 | 日韩精品一区二区三区中文字幕 | 欧美福利精品 | 伊人伊成久久人综合网站 | www.99精品 | 黄网站涩免费蜜桃网站 | 午夜影视网 | 亚洲国产精品久久久久婷婷老年 | 久草中文在线观看 | 一区二区小视频 | 祝你幸福电影在线观看 | 国产一区二区三区视频 | 亚洲视频 欧美视频 | 久久99视频这里只有精品 | 黄色在线观看国产 | 中文字幕一区二区三区四区五区 | 国产精品自产av一区二区三区 |