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

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

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

        <tfoot id='bxYVf'></tfoot>

        如何用量角器測試 html 鏈接?

        How to test html links with protractor?(如何用量角器測試 html 鏈接?)
      1. <i id='VQo7Q'><tr id='VQo7Q'><dt id='VQo7Q'><q id='VQo7Q'><span id='VQo7Q'><b id='VQo7Q'><form id='VQo7Q'><ins id='VQo7Q'></ins><ul id='VQo7Q'></ul><sub id='VQo7Q'></sub></form><legend id='VQo7Q'></legend><bdo id='VQo7Q'><pre id='VQo7Q'><center id='VQo7Q'></center></pre></bdo></b><th id='VQo7Q'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='VQo7Q'><tfoot id='VQo7Q'></tfoot><dl id='VQo7Q'><fieldset id='VQo7Q'></fieldset></dl></div>

            <legend id='VQo7Q'><style id='VQo7Q'><dir id='VQo7Q'><q id='VQo7Q'></q></dir></style></legend>

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

            <tfoot id='VQo7Q'></tfoot>
              <tbody id='VQo7Q'></tbody>
              <bdo id='VQo7Q'></bdo><ul id='VQo7Q'></ul>

                  本文介紹了如何用量角器測試 html 鏈接?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我是量角器的新手,想測試鏈接是否有效.我了解嘗試獲取元素 ID,但我應該期望鏈接等于什么?

                  I am new to protractor and would like to test if a link is working. I understand trying to get the element id but what should i expect that the link equals?

                  還有人有關于示例量角器測試的任何好的文檔嗎?我已經通過這個 http://angular.github.io/protractor/#/tutorial 這很有幫助,但我需要更多我可以做的可能測試的例子.

                  Also has anyone got any good documentation on example protractor tests? I have been through this http://angular.github.io/protractor/#/tutorial which was helpful but i need more example of possible tests I could do.

                  到目前為止我有這個:

                  it('should redirect to the correct page', function(){
                          element(by.id('signmein').click();
                          expect(browser.driver.getCurrentUrl()).toEqual("http://localhost:8080/web/tfgm_customer/my-account");
                      });
                  

                  推薦答案

                  想測試鏈接是否正常

                  would like to test if a link is working

                  這有點寬泛 - 它可能意味著鏈接具有適當的 href 屬性,或者單擊鏈接后應該打開一個新頁面.

                  This is a bit broad - it could mean the link to have an appropriate hrefattribute, or that after clicking a link there should be a new page opened.

                  要檢查 href 屬性,請使用 getAttribute():

                  To check the href attribute, use getAttribute():

                  expect(element(by.id('myLink')).getAttribute('href')).toEqual('http://myUrl.com');
                  

                  <小時>

                  要點擊鏈接,請使用 click(),要檢查當前 URL,請使用 getCurrentUrl():

                  element(by.id('myLink').click();
                  expect(browser.getCurrentUrl()).toEqual("http://myUrl.com");
                  

                  注意,如果點擊后打開的是非角頁面,則需要玩轉ignoreSynchronization標志,見:

                  Note that if there is a non-angular page opened after the click, you need to play around with ignoreSynchronization flag, see:

                  • 點擊后打開的非角度頁面

                  如果鏈接在新標簽頁中打開,您需要切換到該窗口,檢查 URL,然后切換回主窗口:

                  If the link is opened in a new tab, you need to switch to that window, check the URL and then switch back to the main window:

                  element(by.id('myLink')).click().then(function () {
                      browser.getAllWindowHandles().then(function (handles) {
                          browser.switchTo().window(handles[handles.length - 1]).then(function () {
                              expect(browser.getCurrentUrl()).toEqual("http://myUrl.com");
                          });
                  
                          // switch back to the main window
                          browser.switchTo().window(handles[0]);
                      });
                  });
                  

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

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

                  相關文檔推薦

                  JavaScript innerHTML is not working for IE?(JavaScript innerHTML 不適用于 IE?)
                  document.write() overwriting the document?(document.write() 覆蓋文檔?)
                  AngularJS Error: Cross origin requests are only supported for protocol schemes: http, data, chrome-extension, https(AngularJS 錯誤:跨源請求僅支持協議方案:http、data、chrome-extension、https) - IT屋-程序員軟件開發技術分
                  IE10 and Cross-origin resource sharing (CORS) issues with Image / Canvas(IE10 和 Image/Canvas 的跨域資源共享 (CORS) 問題)
                  Importing script with type=module from local folder causes a CORS issue(從本地文件夾導入 type=module 的腳本會導致 CORS 問題)
                  HTTP preflight (OPTIONS) request fails in IE only(HTTP 預檢 (OPTIONS) 請求僅在 IE 中失敗)
                  <i id='mJmaV'><tr id='mJmaV'><dt id='mJmaV'><q id='mJmaV'><span id='mJmaV'><b id='mJmaV'><form id='mJmaV'><ins id='mJmaV'></ins><ul id='mJmaV'></ul><sub id='mJmaV'></sub></form><legend id='mJmaV'></legend><bdo id='mJmaV'><pre id='mJmaV'><center id='mJmaV'></center></pre></bdo></b><th id='mJmaV'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='mJmaV'><tfoot id='mJmaV'></tfoot><dl id='mJmaV'><fieldset id='mJmaV'></fieldset></dl></div>
                    <tbody id='mJmaV'></tbody>

                      <bdo id='mJmaV'></bdo><ul id='mJmaV'></ul>
                      <tfoot id='mJmaV'></tfoot>

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

                    • <legend id='mJmaV'><style id='mJmaV'><dir id='mJmaV'><q id='mJmaV'></q></dir></style></legend>

                            主站蜘蛛池模板: av免费网址 | 欧美日本韩国一区二区 | 99精品欧美一区二区蜜桃免费 | 国产人免费人成免费视频 | 亚洲狠狠| 久草视频观看 | 日韩av一区二区在线观看 | 亚洲欧洲国产视频 | 成人在线免费观看视频 | 日韩中文一区二区三区 | 国产日韩亚洲欧美 | 国产成人午夜高潮毛片 | 日本激情视频在线播放 | 嫩草懂你的影院入口 | 久久综合影院 | 亚洲视频在线看 | 在线亚洲一区二区 | 日韩在线精品视频 | 我我色综合 | 欧美高清dvd| 国产黄色小视频在线观看 | 国产精品二区三区在线观看 | 国产精品视频免费看 | 亚洲欧美日韩精品久久亚洲区 | 欧美一区免费 | av激情在线 | 台湾a级理论片在线观看 | 欧美在线视频不卡 | 91精品国产91久久久久久吃药 | 亚洲成人中文字幕 | 亚洲国产精品福利 | 日本aaaa| 成人做爰www免费看 午夜精品久久久久久久久久久久 | 成在线人视频免费视频 | 日韩av在线一区二区 | 国产高清在线精品一区二区三区 | 欧美精品成人 | 亚洲一区日韩 | 国产三级 | 成人不卡视频 | 中文字幕一区二区三区乱码图片 |