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

如何使用 Testacular + AngularJS 測試外部服務的應用

How do I test an externally served app using Testacular + AngularJS(如何使用 Testacular + AngularJS 測試外部服務的應用程序)
本文介紹了如何使用 Testacular + AngularJS 測試外部服務的應用程序的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

限時送ChatGPT賬號..

我有一個在 http://localhost:6543 上運行的應用程序 - 這是一個 Pyramid 應用程序.

I have an app running on http://localhost:6543 - it's a Pyramid app.

  • 此應用在/處為 AngularJS 應用提供服務
  • 此應用使用 socket.io 本身

問題是:是否可以使用這些工具測試該應用程序?

我的 scenario.js 文件中有這個:

I have this in my scenario.js file:

beforeEach(function() {
   browser().navigateTo('http://localhost:6543/');
});

但當我啟動 testacular(使用 runstart)時,我收到以下錯誤消息:

but the moment I launch testacular (with run or start), I get this error message:

Chrome 23.0 registration: should delete all cookies when user clicks on "remove all" button FAILED
browser navigate to 'http://localhost:6543/'
/home/abourget/myapp/jstests/scenarios/registration_scenario.js:9:5: Sandbox Error: Application document not accessible.

所以我知道瀏覽器不允許訪問 iframe 的文檔,因為這會違反跨域.

so I understand the browser doesn't give access to the iframe's document, because it'd be some Cross-Origin violation.

我嘗試了什么:

  • 使用 Testacular 網絡服務器(使用 proxies 選項)代理到我的應用程序,但 / 會與 Testacular 自己的框架服務沖突.此外,這兩個應用程序最終都會嘗試使用 /socket.io,這也會發生沖突.
  • 做相反的事情(調整我的應用程序以代理到 Testacular 的服務器),但是,我們會遇到與 /socket.io 相同的問題.
  • Proxying to my app using the Testacular web server (with the proxies option), but / would conflict with Testacular's own serving of its framework. Also, both apps would eventually try to use /socket.io and that would conflict also.
  • Doing the reverse (tweaking my app to proxy to Testacular's server), but then, we'd get the same issues with /socket.io.

感謝您提供這些出色的工具,順便說一句!

Thanks for these great tools, btw!

推薦答案

而不是有

beforeEach(function() {
    browser().navigateTo('http://localhost:6543/');
});

把這個改成

beforeEach(function() {
    browser().navigateTo('/');
});

然后在你的 testacular-e2e.conf.js 文件中添加:

and then in your testacular-e2e.conf.js file add:

proxies = {
    '/': 'http://localhost:6543/'
};

您可能還有其他問題,但我可以重現沙盒錯誤:無法訪問應用程序文檔".僅包含 Pyramid Hello World App 和此配置問題的消息.

You might still have other issues, but I can reproduce the "Sandbox Error: Application document not accessible." message with just the Pyramid Hello World App and this configuration problem.

這篇關于如何使用 Testacular + AngularJS 測試外部服務的應用程序的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

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

相關文檔推薦

How can I get my jasmine tests fixtures to load before the javascript considers the document to be quot;readyquot;?(在 javascript 認為文檔“準備好之前,如何讓我的 jasmine 測試裝置加載?) - IT屋-程序員軟件開發技術
What do jasmine runs and waitsFor actually do?(jasmine 運行和等待實際上是做什么的?)
How to provide mock files to change event of lt;input type=#39;file#39;gt; for unit testing(如何提供模擬文件來更改 lt;input type=filegt; 的事件用于單元測試)
How to unit test a chained method using Jasmine(如何使用 Jasmine 對鏈式方法進行單元測試)
How do I inject $rootScope into an AngularJS unit test?(如何將 $rootScope 注入 AngularJS 單元測試?)
Jasmine - How to spy on a function call within a function?(Jasmine - 如何監視函數中的函數調用?)
主站蜘蛛池模板: 欧美男人的天堂 | 我我色综合 | 精品久久久久国产免费第一页 | 国产精品黄视频 | 欧美理论片在线 | 日本精品在线播放 | 男女污污动态图 | 日韩免费1区二区电影 | 亚洲三区在线观看 | 欧美中文一区 | 99精品久久99久久久久 | 中文字幕一区二区三区在线观看 | 成人免费视频网 | 久久精品欧美一区二区三区麻豆 | 日本一区二区在线视频 | 久久精品97 | 99在线免费观看 | 狠狠色网| 一级毛片网 | 黑人久久久| 欧美一级视频免费看 | 国产激情视频网址 | 狠狠做深爱婷婷综合一区 | www国产成人免费观看视频,深夜成人网 | 成人不卡 | 成人精品久久久 | 国产精品久久久久久久久动漫 | 国产精品观看 | 国产精品国产精品国产专区不卡 | 成人av网站在线观看 | 国产剧情一区 | 国产精品欧美一区二区三区不卡 | 精品久久久一区二区 | www.激情.com | 亚洲另类春色偷拍在线观看 | 国产精品美女久久久久久久网站 | 精品亚洲第一 | 国产va| 亚洲欧美成人 | 欧美一区二区三区大片 | 久久久免费电影 |