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

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

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

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

      1. Protractor e2e 測試登錄重定向

        Protractor e2e Tests Login Redirection(Protractor e2e 測試登錄重定向)

        <tfoot id='jX2EI'></tfoot>

              <tbody id='jX2EI'></tbody>
              <bdo id='jX2EI'></bdo><ul id='jX2EI'></ul>

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

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

                  問題描述

                  目前有一個輸入用戶名/密碼并點擊登錄"的部分端到端測試.

                  Currently have a partial end-to-end test that enters a username/password and clicks 'sign in'.

                  它成功地做到了,但在感謝您登錄"頁面結束,而不是像我通過瀏覽器登錄時那樣被重定向到帳戶門戶"或儀表板".

                  It does that successfully, but concludes at a "thanks you're logged in" page, instead of being redirected to the 'account portal' or 'dashboard', the way it would if I logged in through the browser.

                  這個項目的新手,但我們正在使用 OAuth.

                  New to this project but we are using OAuth.

                  主要問題:這聽起來像是需要 http 模擬嗎?

                  更多細節:

                  spec.js

                  describe('login page', function() {
                      browser.driver.get('http://url.path/login');
                      it('should render login page', function() {
                  
                        // Checking the current url
                        var currentUrl = browser.driver.getCurrentUrl();
                        expect(currentUrl).toMatch('/login');
                      });
                      it('should sign in', function() {
                  
                        // Find page elements
                        var userNameField = browser.driver.findElement(By.id('username'));
                        var userPassField = browser.driver.findElement(By.id('password'));
                        var userLoginBtn  = browser.driver.findElement(By.id('loginbtn'));
                  
                        // Fill input fields
                        userNameField.sendKeys('test@user.com');
                        userPassField.sendKeys('1234');
                  
                        // Ensure fields contain what we've entered
                        expect(userNameField.getAttribute('value')).toEqual('test@user.com');
                        expect(userPassField.getAttribute('value')).toEqual('1234');
                  
                        // Click to sign in - waiting for Angular as it is manually bootstrapped.
                        userLoginBtn.click().then(function() {
                          browser.waitForAngular();
                          expect(browser.driver.getCurrentUrl()).toMatch('/success');
                        }, 10000);
                      });
                  });
                  

                  如果我快速單擊測試窗口,我可以看到它成功到達成功"頁面 - 但它不會重定向到儀表板(當您通過瀏覽器手動登錄時它會重定向).如何繼續此測試以保持登錄狀態并像用戶一樣訪問儀表板?

                  If I quickly click on the testing window, I can see it successfully reaches the 'success' page - but it does not redirect to the dashboard (it redirects when you manually sign in, through the browser). How can I continue this test to remain signed in and access the dashboard like a user would?

                  //項目新手,角度和量角器.

                  // New to the project, angular and and protractor.

                  編輯 - 稍微總結一下:

                  • 我希望量角器在 /login 頁面上開始測試
                  • 量角器應該找到并填寫用戶名和密碼字段,然后點擊登錄
                  • 量角器成功登錄,看到一個/thankyou頁面,然后立即重定向到用戶的/dashboard頁面
                  • 也許我錯過了一個步驟,我們需要在量角器測試中手動重定向嗎?
                  • I would like protractor to begin tests on the /login page
                  • Protractor should find and fill out the username and password fields, then click Login
                  • Protractor successfully log in, to see a /thankyou page, then immediately redirect to the user's /dashboard page
                  • Maybe I'm missing a step, do we need to manually redirect in Protractor tests?

                  (當用戶通過瀏覽器手動登錄時,他們看不到 /thankyou 頁面 - 這是一個快速重定向到 /dashboard .量角器無法到達儀表板頁面.

                  (When a user manually logs in through the browser, they don't see the /thankyou page - it's a quick redirect to /dashboard . Protractor does not reach the dashboard page.

                  推薦答案

                  您的帖子缺少信息,但我會嘗試做一個假設:

                  Your post lacks information but I'll try to make an assumption:

                  我懷疑您的感謝您已登錄"頁面會在超時后重定向 javascript.

                  I suspect that your "thanks you're logged in" page makes javascript redirect after a timeout.

                  所以當你點擊登錄"后,瀏覽器會加載謝謝你登錄"頁面,并且由于 .then() 的第二個參數什么都不做,browser.waitForAngular() 失敗,因為該頁面上沒有角度.

                  So after you click "Login", the browser loads "thanks you're logged in" page, and since the second parameter to .then() does nothing, browser.waitForAngular() fails because there is no angular on that page.

                  您應該嘗試使用類似 browser.driver.wait() 之類的東西并設置合理的超時時間來檢測 url 更改(此處描述:https://github.com/angular/protractor/issues/610) 并在瀏覽器之后觸發 browser.waitForAngular()進入 /success 頁面.

                  You should try to use something like browser.driver.wait() with a reasonable timeout to detect url change (described here: https://github.com/angular/protractor/issues/610) and trigger browser.waitForAngular() after the browser get to /success page.

                  這篇關于Protractor e2e 測試登錄重定向的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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() 的限制?)
                        <tbody id='GZpzP'></tbody>

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

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

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

                            主站蜘蛛池模板: 久久aⅴ乱码一区二区三区 91综合网 | 国产精选一区 | 亚洲国产情侣自拍 | 免费观看黄色一级片 | 成人一区二区视频 | 国产欧美日韩精品在线观看 | 中文字幕第十一页 | 中文在线a在线 | 久久综合av | 国产精品一区久久久 | 久久午夜电影 | 国产精品视频一区二区三区四蜜臂 | 精品九九 | 一区二区三区高清 | 国产亚洲精品精品国产亚洲综合 | 欧美极品少妇xxxxⅹ免费视频 | 午夜精品久久久久久久 | 亚洲精品一区二区三区丝袜 | 亚洲精品美女视频 | 亚洲欧美中文日韩在线v日本 | 日韩欧美一区二区三区免费观看 | 九九国产 | 四虎影视| 99久久久99久久国产片鸭王 | 欧美国产视频 | 青青草免费在线视频 | 久久69精品久久久久久久电影好 | 一区二区三区免费 | 日本中文在线 | 午夜影院黄 | 中文字幕在线观看精品 | 久久综合九九 | www.99精品 | 亚洲性人人天天夜夜摸 | 日本精品视频一区二区三区四区 | 成人激情视频免费在线观看 | 色综合网站 | 色噜噜亚洲男人的天堂 | 久久精品国产一区二区电影 | 午夜私人影院在线观看 | 久在线|