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

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

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

  • <tfoot id='Vy3tD'></tfoot>

          <bdo id='Vy3tD'></bdo><ul id='Vy3tD'></ul>
      1. 在量角器測試中設置瀏覽器時區(qū)

        Set browser timezone in a Protractor test(在量角器測試中設置瀏覽器時區(qū))
          <tbody id='NxMPe'></tbody>
        <i id='NxMPe'><tr id='NxMPe'><dt id='NxMPe'><q id='NxMPe'><span id='NxMPe'><b id='NxMPe'><form id='NxMPe'><ins id='NxMPe'></ins><ul id='NxMPe'></ul><sub id='NxMPe'></sub></form><legend id='NxMPe'></legend><bdo id='NxMPe'><pre id='NxMPe'><center id='NxMPe'></center></pre></bdo></b><th id='NxMPe'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='NxMPe'><tfoot id='NxMPe'></tfoot><dl id='NxMPe'><fieldset id='NxMPe'></fieldset></dl></div>

        • <small id='NxMPe'></small><noframes id='NxMPe'>

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

                  <tfoot id='NxMPe'></tfoot>
                  本文介紹了在量角器測試中設置瀏覽器時區(qū)的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我正在做一個使用量角器進行 e2e 測試的項目.

                  I'm working on a project where the e2e tests are made using protractor.

                  一些測試,需要驗證日期/時間.在我們的持續(xù)交付平臺上進行測試,確保時區(qū)保持穩(wěn)定.

                  Some tests, need to validate date/times. Tests are ok on our continuous deliver platforms that ensure the timezone remains stable.

                  但是,當測試在時區(qū)可能更改的本地計算機上運行時,測試會失敗,因為捕獲的瀏覽器在不同的時區(qū)運行.

                  However, when test are run on a local machine, where timezone can change, tests fail because the captured browser is running on a different timezone.

                  我需要以某種方式通過量角器控制時區(qū),以便進行獨立于平臺的測試.

                  I need to, somehow, control the timezone through protractor in order to have platform independent tests.

                  這可能嗎?

                  推薦答案

                  遲到的答案,但也許將來有人可以用這個...有點丑,但我沒有找到更好的東西.可能不會為您工作,這取決于您的應用程序如何檢測時區(qū).如果它與 getTimezoneOffset() 一起使用,這將起作用.

                  Late answer, but maybe someone in the future can use this...It is a bit ugly, but I haven`t found anything prettier.It might not work for you, it depends on how your app detects timezone. If it is with getTimezoneOffset() this will work.

                  基本上它重寫了 Date() 類,并在其中添加了 setTimezoneOffset().

                  Basically it rewrites Date() class, and adds setTimezoneOffset() to it.

                  1. 將 TimeShift.js 添加到您的助手中:https://github.com/cvakiitho/TimeShift-js/blob/master/timeshift.js
                  2. 在測試中加載 TimeShift:var TimeShift = require('./helpers/timeshift.js');
                  3. 執(zhí)行 TimeShift,并更改時區(qū):

                  1. Add TimeShift.js into your helpers: https://github.com/cvakiitho/TimeShift-js/blob/master/timeshift.js
                  2. Load TimeShift in your tests: var TimeShift = require('./helpers/timeshift.js');
                  3. Execute TimeShift, and alter timezone:

                  dvr = browser.driver;
                  dvr.executeScript(TimeShift).then(function(){
                          dvr.executeScript('' +
                              'angular.isDate = function(x){return x instanceof Date};' +
                              'Date = TimeShift.Date;' +
                              'TimeShift.setTimezoneOffset(60);' +
                      });
                  

                  注意:每次頁面刷新都會破壞這一點.

                  Note: Every page refresh destroys this.

                  這篇關于在量角器測試中設置瀏覽器時區(qū)的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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屋-程序員軟件開發(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='UuAGb'><tr id='UuAGb'><dt id='UuAGb'><q id='UuAGb'><span id='UuAGb'><b id='UuAGb'><form id='UuAGb'><ins id='UuAGb'></ins><ul id='UuAGb'></ul><sub id='UuAGb'></sub></form><legend id='UuAGb'></legend><bdo id='UuAGb'><pre id='UuAGb'><center id='UuAGb'></center></pre></bdo></b><th id='UuAGb'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='UuAGb'><tfoot id='UuAGb'></tfoot><dl id='UuAGb'><fieldset id='UuAGb'></fieldset></dl></div>

                    <tbody id='UuAGb'></tbody>

                    <tfoot id='UuAGb'></tfoot>

                    1. <small id='UuAGb'></small><noframes id='UuAGb'>

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

                          • 主站蜘蛛池模板: 81精品国产乱码久久久久久 | 91久久 | 午夜网站视频 | 亚洲综合在线视频 | 久久久久国产精品午夜一区 | 亚洲国产18| 天天久久 | 国产成人精品久久二区二区 | 欧美日韩a| 午夜视频在线免费观看 | 午夜不卡一区二区 | 亚洲欧美一区二区三区情侣bbw | 久久综合成人精品亚洲另类欧美 | 国产中文字幕在线观看 | 欧美精品一区免费 | 国产九九精品视频 | 久久精品国产99国产精品 | 日韩视频一区二区三区 | 99热热热| 欧美激情一区二区三级高清视频 | 草草视频在线观看 | 国产人成在线观看 | 久久精品欧美一区二区三区不卡 | 宅女噜噜66国产精品观看免费 | 丝袜毛片| 国产农村妇女毛片精品久久麻豆 | 美女一级a毛片免费观看97 | 麻豆视频在线看 | 亚洲视频国产视频 | 久久91| 欧美一区二区三区在线观看 | 欧美性猛交 | 色永久 | 国产精品久久久久无码av | 伊人艹| 超碰超碰 | 精品久久久久久国产 | 亚洲高清一区二区三区 | 精品国产乱码久久久久久闺蜜 | 自拍偷拍小视频 | 夜夜久久|