zombie.js

Prevent zombie.js from loading only external resources

三世轮回 提交于 2019-12-04 09:11:46
I am using zombie.js to load a page from a local express server during a test. Unfortunately, there is a script element which calls out to Google Analytics. I would like to block this external script (gracefully) without preventing other (local) scripts from loading, if possible. I know that { runScripts : false } is available with calls to browser.visit() . However, that refuses to load any and all scripts on the page, not just those living on other hosts. Is this possible? You should use the resources object. You can set certain requests to give specific responses if you don't want the

Mock/Test Mongodb Database Node.js

纵饮孤独 提交于 2019-12-03 10:45:25
问题 I am learning nodejs and I have a mongodb database with which i have to interact with. I am currently thinking of using mocha for a unit test framework and zombie.js for a acceptance test framework. I was wondering how could I do full scale acceptance tests which hit the mongodb database. Is there a framework/module that helps with replacing the database with a test database or does either mocha or zombie.js have functionality that can easily be used to replace the database. Also is there a

Why does the zombie.js browser return empty HTML when using Bootstrap?

折月煮酒 提交于 2019-12-03 06:55:25
I'm trying to test my Node.js/Express.js application using Mocha and Zombie. I can get simple tests to pass, but as soon as I add the script tags for Twitter Bootstrap to my views, the browser object returns empty HTML. Here is my test code: process.env.NODE_ENV = 'test'; var app = require('../app'); var assert = require('assert'); var Browser = require('zombie'); describe('home page', function() { before(function() { this.server = app.listen(3000); this.browser = new Browser({site: 'http://localhost:3000', debug : true}); }); it('should show welcome', function(done) { var browser = this

Mock/Test Mongodb Database Node.js

别等时光非礼了梦想. 提交于 2019-12-03 01:15:44
I am learning nodejs and I have a mongodb database with which i have to interact with. I am currently thinking of using mocha for a unit test framework and zombie.js for a acceptance test framework. I was wondering how could I do full scale acceptance tests which hit the mongodb database. Is there a framework/module that helps with replacing the database with a test database or does either mocha or zombie.js have functionality that can easily be used to replace the database. Also is there a framework that is similar to the idea of factories (instead of fixtures) in creating database objects. A

Can I make Behat/ZombieJS/Mink simulate a click on a “non-link” element, to fire JS listeners?

ε祈祈猫儿з 提交于 2019-12-01 05:42:43
I am using Behat for testing, with the ZombieJS driver, and everything is working very well so far, but there is one thing that bothers me, I can't seem to figure out how to get Behat to simulate a click on a non-link element. I guess this comes from Mink being a "cross-browser" driver, and it doesn't really make sense to click on non-link elements. For my use case though, I need it, because there are several elements on the page that have javascript event listeners attached to them, and I want to test these functionalities. I tried using Then I follow "div.sa" But it fails with the expected

Installing Zombie.js Error: ReferenceError: Set is not defined. What am I doing wrong?

牧云@^-^@ 提交于 2019-12-01 03:14:56
Background: I'm currently reading " Web Development with Node and Express " by Ethan Brown (great book by the way for those learning node and express) and I got stuck on Chapter 5 - Quality Insurance. Everything was running smooth. First I ran the following: npm install --save-dev mocha npm install -g mocha npm install --save-dev chai npm install --save-dev zombie Problem: Then I ran (as the book instructed): mocha -u tdd -R spec qa/tests-crosspage.js 2>/dev/null But this wasn't doing anything. So then I ran: mocha -u tdd -R spec qa/tests-crosspage.js And then this error appeared: /Users

Installing Zombie.js Error: ReferenceError: Set is not defined. What am I doing wrong?

时光总嘲笑我的痴心妄想 提交于 2019-11-30 23:27:25
问题 Background: I'm currently reading " Web Development with Node and Express " by Ethan Brown (great book by the way for those learning node and express) and I got stuck on Chapter 5 - Quality Insurance. Everything was running smooth. First I ran the following: npm install --save-dev mocha npm install -g mocha npm install --save-dev chai npm install --save-dev zombie Problem: Then I ran (as the book instructed): mocha -u tdd -R spec qa/tests-crosspage.js 2>/dev/null But this wasn't doing

Scrape a webpage and navigate by clicking buttons

余生长醉 提交于 2019-11-29 19:33:55
I want to perform following actions at the server side: 1) Scrape a webpage 2) Simulate a click on that page and then navigate to the new page. 3) Scrape the new page 4) Simulate some button clicks on the new page 5) Sending the data back to the client via json or something I am thinking of using it with Node.js. But am confused as to which module should i use a) Zombie b) Node.io c) Phantomjs d) JSDOM e) Anything else I have installed node,io but am not able to run it via command prompt. PS: I am working in windows 2008 server Zombie.js and Node.io run on JSDOM, hence your options are either

PHP Mink/Zombie - handling hanging processes after a fatal exception?

江枫思渺然 提交于 2019-11-29 18:02:26
I'm using the PHP script with Mink+Zombie driver (install as on nodejs cannot find module 'zombie' with PHP mink ) from here: PHP Mink/Zombie - page visit returns status code 0? ; re-posting for completeness: <?php $nodeModPath = "/home/USERNAME/.nvm/versions/node/v4.0.0/lib/node_modules"; # composer autoload: require_once __DIR__ . '/vendor/autoload.php'; $URL = "https://demo.centreon.com/centreon"; $USERNAME = "admin"; $PASSWORD = "centreon"; $LFID = "useralias"; $PFID = "password"; $BFID = "submitLogin"; $zsrv = new \Behat\Mink\Driver\NodeJS\Server\ZombieServer(); $zsrv->setNodeModulesPath(

Scrape a webpage and navigate by clicking buttons

▼魔方 西西 提交于 2019-11-28 15:09:15
问题 I want to perform following actions at the server side: 1) Scrape a webpage 2) Simulate a click on that page and then navigate to the new page. 3) Scrape the new page 4) Simulate some button clicks on the new page 5) Sending the data back to the client via json or something I am thinking of using it with Node.js. But am confused as to which module should i use a) Zombie b) Node.io c) Phantomjs d) JSDOM e) Anything else I have installed node,io but am not able to run it via command prompt. PS: