简体   繁体   English

有没有办法在chutzpah中执行phantomJS语句?

[英]is there a way to execute phantomJS statements in chutzpah?

I'm running some Qunit tests to test a framework. 我正在运行一些Qunit测试来测试框架。 I'm not able to fetch the cookies from phantomJS as my test hangs there. 我的测试挂在那里,我无法从phantomJS中获取cookie。 It's not able to read cookies. 它无法读取Cookie。

I tried to fetch the fetch phantom cookies with phantom.cookies function, yet chutzpah doesn't execute those statements ? 我试图使用phantom.cookies函数来获取获取的phantom cookie,但是chutzpah不会执行这些语句吗? is there way for me to fetch phantom cookies with chutzpah ? 我可以用chutzpah来获取幻影饼干吗?

document.cookies should work as long as you are not violating the same-origin policy. 只要您不违反同源政策,document.cookies就应该起作用。 This gets tricky when you are running with local files sometimes since the origin of file system files is odd. 当您使用本地文件运行时,这有时会变得棘手,因为文件系统文件的来源是奇怪的。 I pass into Phantom the argument to ignore allow cross domain loading but I wonder if that doesn't apply to cookies. 我将忽略忽略允许跨域加载的参数传递给Phantom,但我想知道这是否不适用于cookie。

Couple things 夫妻事

  1. Can you give me a sample zip which repros your problem? 您能给我一个样本拉链来解决您的问题吗?
  2. You might want to file a bug on PhantomJS which says document.cookies should return from other domains if you set 您可能想在PhantomJS上提交一个错误,该错误说document.cookies应该从其他域返回

page.settings.webSecurityEnabled = false;

Thanks! 谢谢!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM