How do I make Karma's auto

I'm running into what I think is a race condition between Vim saving files and Karma re-running my Jasmine unit tests. Here's a sequence of four test runs which demonstrates the symptom (I truncated the extremely long paths in the error log): $ karma start karma.conf.js --auto-watch [... snip a lot of coding and test running ...] PhantomJS 1.6 (Linux) LOG: 'Running tests at 2013-08-14T0

我如何制作Karma的汽车

我遇到了我认为是Vim保存文件和Karma重新运行我的Jasmine单元测试之间的竞争条件。 下面是四个测试运行的序列,演示了症状(我截断了错误日志中极长的路径): $ karma start karma.conf.js --auto-watch [... snip a lot of coding and test running ...] PhantomJS 1.6 (Linux) LOG: 'Running tests at 2013-08-14T08:19:57.252Z' PhantomJS 1.6 (Linux): Executed 4 of 4 SUCCESS (0.307 secs / 0.013 secs) PhantomJS 1.6 (

require() fails in CasperJS

As per this answer, I tried opening a local json file. This is an insert form my script: var json = require('pars.json'); casper.echo("Starting"); The 'pars.json' file is in the same folder as the script. On my Win7 machine with CasperJS version 1.1.2 and PhantomJS version 2.1.1, this works. However, it always fails when I try to run it on a Win10 machine with the same versions of P

require()在CasperJS中失败

根据这个答案,我尝试打开一个本地json文件。 这是我的脚本的插入形式: var json = require('pars.json'); casper.echo("Starting"); 'pars.json'文件与脚本位于同一个文件夹中。 在我的Win7机器上安装了CasperJS 1.1.2版和PhantomJS 2.1.1版, 但是,当我尝试在具有相同版本的Phantom和Casper的Win10机器上运行它时,它总是失败。 如果我删除'require ...'行,脚本正常运行。 另外,我没有收到错误信

Asynchronous call during a synchronous CasperJS operation

After allot of trouble (first timer nodejs and casperjs/phantomjs) it started to work. I made this work with curl(php). This is what I try to accomplish: Log in Get all units parse their details (my problem) 2 unit details are provided by ajax calls casper.start(url, function() { this.evaluate(function() { document.querySelector("input[name='username']").value = "usern

在同步CasperJS操作期间进行异步调用

在分配了麻烦之后(第一个定时器nodejs和casperjs / phantomjs)它开始工作。 我用curl(php)做了这个工作。 这是我试图完成的: 登录 获取所有单位 解析他们的细节 (我的问题)2个单元细节由ajax调用提供 casper.start(url, function() { this.evaluate(function() { document.querySelector("input[name='username']").value = "username"; document.querySelector("input[name='passw

CasperJS/PhantomJS Cookie Handling

When I visit this site in a browser I get the google.com tracking cookies: http://www.xfinityonline.com/ However, I don't see these cookies when I visit the site in CasperJS (I do see other third-party cookies). Any idea why this is happening? I am using phantomjs 1.9.7 and casperjs 1.1.0-beta3. I am capturing resource.requested and resource.received to verify that the google.com resou

CasperJS / PhantomJS Cookie处理

当我在浏览器中访问此网站时,我收到了google.com跟踪cookie: http://www.xfinityonline.com/ 但是,当我访问CasperJS网站时(我看到其他第三方cookie),我没有看到这些cookie。 任何想法为什么发生这种情况? 我正在使用phantomjs 1.9.7和casperjs 1.1.0-beta3。 我正在捕获resource.requested和resource.received以验证是否正在加载google.com资源。 我正在倾销phantom.cookies以验证Cookie未设置。 我正在使用Fire

casperjs tests freezing causing jenkins build to time out

i run casperjs tests with jenkins in a staging environment. lately jenkins has been timing out (at 10 min) and it's almost always because of the casper tests. there are 4 tests in the suite and an average successful build takes about 1 min 30 sec. i can sometimes reproduce this when i run an individual test locally -- casper seems to just get stuck. one notable thing is it seems to alway

casperjs测试冷冻导致jenkins生成超时

我在分期环境中与詹金斯进行casperjs测试。 最近jenkins已经超时(在10分钟),并且几乎总是因为casper测试。 套件中有4个测试,平均成功构建大约需要1分30秒。 当我在本地运行单独的测试时,我有时可以重现这一点 - casper似乎只是卡住了。 一个值得注意的事情是它似乎总是在加载新页面的操作上(URL更改)。 这里是一个非常简单的登录测试日志: [info] [phantom] Starting... [info] [phantom] Running suite: 12 ste

Check/Log how much bandwidth PhantomJS/CasperJS used

Is it possible to check/log how much data has been transferred during each run of PhantomJs/CasperJS? Each instance of Phantom/Casper has a instance_id assigned to it (by the PHP function that spun up the instance). After the run has finished, the amount of data transferred and the instance_id will have to make its way to be inserted into a MySQL database, possibly via the PHP function that sp

检查/记录PhantomJS / CasperJS使用的带宽

在PhantomJs / CasperJS的每次运行过程中是否可以检查/记录有多少数据已被传输? Phantom / Casper的每个实例都有一个instance_id分配给它(通过启动实例的PHP函数)。 运行结束后,传输的数据量和instance_id将不得不通过生成实例的PHP函数插入到MySQL数据库中。 这样可以记录单个phantomjs运行的带宽利用率。 可以运行许多幻影/ casper实例,每个实例持续一两分钟。 尝试捕获数据时最简单和最准确的方法是尽可能使收集

<script> tag not executed in Handlebars template even with triple braces

I am using Ember js to render the main content in my web app. Ember uses Handlebars for templates. The main contest contains html tags and script tags. I have escaped the html tags in my handlebars variable using triple braces. This ensures that html tag in the content is parsed by the browser after the template is rendered. My doubt is that why is the script tag not executed by Javascript p

即使使用三个大括号,也不会在Handlebars模板中执行<script>标记

我正在使用Ember js来呈现我的网络应用程序中的主要内容。 Ember使用把手作为模板。 主要竞赛包含html标签和脚本标签。 我已经使用三个大括号转义了我的handlebars变量中的html标记。 这可以确保在呈现模板之后内容中的html标记被浏览器解析。 我的疑问是,为什么在模板呈现后JavaScript脚本标记不能被JavaScript解析器执行。 当我通过Chrome Inspector检查时,脚本标记存在于内容中,但未由Javascript分析。 这种行为是

compiled templates with Handlebars.js (jQuery Mobile environment)

I am struggling somewhat with pre-compilation of templates in Handlebars. My jQuery Mobile project is getting pretty big template-wise and I wish to pre-compile the templates I use. However I can't seem to find a good explanation (like a step by step tutorial) of how to do this with Handlebars. I still have my templates all inline using the script tags. I have handlebars installed using

使用Handlebars.js编译模板(jQuery Mobile环境)

我在Handlebars中预编译模板时遇到了一些困难。 我的jQuery Mobile项目在模板方面越来越大,我希望预编译我使用的模板。 然而,我似乎无法找到一个很好的解释(如一步一步的教程)如何使用Handlebars做到这一点。 我仍然使用脚本标记全部内嵌我的模板。 我有使用NPM安装的把手。 但是现在我有点不知所措了。 我正在做类似的事情 handlebars -s event.handlebars > event.compiled 并以某种方式包括event.compiled

add javascript into a html page with jquery

I want to add a javascript google ad but I can't insert the javascript into the div using jquery. I try to simulate my problem with this test, which is using some advice I found on stackoverflow , but it does not work. I want <script type='text/javascript'>document.write('hello world');</script> to be inserted in the div, and "hello world" be displayed

使用jquery将javascript添加到html页面中

我想添加一个JavaScript的谷歌广告,但我不能插入JavaScript使用jQuery的div。 我尝试用这个测试来模拟我的问题,它使用了我在stackoverflow上发现的一些建议,但它不起作用。 我想要在div中插入<script type='text/javascript'>document.write('hello world');</script> ,并在tag_1和tag_2之间显示“hello world”。 代码如下: <html> <head> <script type="text/ja

fetching image from external location in meteor

I am building a meteor app, that allows user to upload images. The images upload are stored in "/tmp/images/" directory in my local system. How can I display the images from the above directory. So far, I have seen displaying images only from "public" directory in meteor. But if I start adding images uploaded by the user in "public", then everytime the user uplo

从流星的外部位置获取图像

我正在构建一个流星应用程序,允许用户上传图像。 图片上传存储在我本地系统的“/ tmp / images /”目录中。 我如何显示上述目录中的图像。 到目前为止,我已经看到仅在流星的“公共”目录中显示图像。 但是,如果我开始添加用户在“公共”中上传的图像,则每次用户上传图像时,服务器都会刷新。 所以我基本上想要显示来自“/ tmp / images /”的图像。 任何想法? 没有其他方式从项目文件夹外的其他目录获取图像。 这就是Me