Questions tagged [mocha-phantomjs]

Mocha is a feature-rich JavaScript test framework running on node and the browser.

The mocha-phantomjs project provides a mocha-phantomjs.coffee script file and extensions to drive PhantomJS while testing your HTML pages with Mocha from the console. The preferred usage is to install mocha-phantomjs via node's packaged modules and use the mocha-phantomjs binary wrapper.

57 questions
1
vote
1 answer

Selenium ends randomly with uncaught error

I'm using mocha, webdriverio, phantomjs Trying to find a way why Selenium is failing in random cases (50% its ok, 50% breaks in different tests with the same code). The error is Uncaught RuntimeError (UnknownError:13) An unknown server-side error…
Stan E
  • 3,396
  • 20
  • 31
1
vote
0 answers

How to test Front-end of the node application using mocha and phantom.js

I made a single page application using backbone(client-side), node(back-end). All the templating part was happening at client-side. I am using node for fetching,updating and setting data into database. Until now, I used to test application manually,…
vasan
  • 2,203
  • 3
  • 18
  • 22
1
vote
1 answer

phantomjs+ mocha + node + opening a web page

I'm trying to do something very simple. Or so I thought. All I want to do is use phantomjs to open a webpage and assert its title. I'm using mocha-phantomjs to invoke my test runner that looks like:
Johnno Nolan
  • 29,228
  • 19
  • 111
  • 160
0
votes
1 answer

Phantomjs reloading same page for every 5 seconds

I want my phantomjs script to keep performing reloading/refreshing on given argument input domain https://google.com for every 5 seconds. How do i achieve that? phantomjs test.js https://google.com test.js var page =…
Arbazz Hussain
  • 1,622
  • 2
  • 15
  • 41
0
votes
0 answers

PhantomJS 2.1.1 (Windows 7 0.0.0) - undefined is not a constructor (evaluating ‘re.exec(obj)’) - Chai Test Case For React

Test case React For Component: I am trying to write a test case which calls a function in .jsx file passing object as argument from spec.js file to test a function return value of react component. I have the pasted the code and error message, I am…
0
votes
1 answer

Issues running BrowserStackLocal for website behind firewall

I'm trying to run browserstack behind the firewall. I tried to run this command on terminal: RK$ ./BrowserStackLocal --key --force-local BrowserStackLocal v7.0 You can now access your local server(s) in our remote browser. Press Ctrl-C to…
TechnoCorner
  • 4,879
  • 10
  • 43
  • 81
0
votes
1 answer

Supporting JS runtimes with PhantomJS

PhantomJS newb here, trying to use PhantomJS with Karma so that I can run browser tests on Jenkins. I get this obvious error with PhantomJS PhantomJS 2.1.1 (Mac OS X 0.0.0) ERROR SyntaxError: Expected an identifier but found 'handlePageRequest'…
Alexander Mills
  • 90,741
  • 139
  • 482
  • 817
0
votes
1 answer

How to call specific test cases from one file to another file

I'm new to Mocha. I want to call Test case 2 from a.js file to b.js like import the test case because of same test cases repeatable in the b.js file. Example File a.js : describe('Sample a',function(){ it('Test case1',function(done){ …
VVV
  • 68
  • 1
  • 14
0
votes
1 answer

How to test a javascript method which returns a Promise object using mocha-phantomjs

I have a couple of unit tests written in mocha which I'm able to run on the browser. I need to automate these tests on a server machine where I will be writing a CLI commands. The problem is when I try to run the tests using PhantomJS I get an error…
0
votes
1 answer

Running Knex Migrations Between Mocha Tests

I was using Mocha to test my Nodejs app with a test database. In order to reset the DB before each test I had the following code, which worked perfectly: process.env.NODE_ENV = 'test'; var knex = require('../db/knex'); describe("Add Item",…
0
votes
1 answer

mocha-phantomjs-core - slimerjs hangs without any error

Using mocha-phantomjs-core with slimerjs I manage to run my tests successfully from CMD: slimerjs mocha-phantomjs-core.js tests.html tap Slimerjs window opens, I see the a browser window and all seems good, but the CMD doesn't finish (seems to…
vsync
  • 118,978
  • 58
  • 307
  • 400
0
votes
1 answer

Yeoman testing times out anywhere but locally

I have some testing with the following structure: describe('yeoman:subyeoman', function () { before(function (done) { helpers.run(path) .inTmpDir(function (dir) { ** some file copying ** }) …
sailens
  • 1,594
  • 1
  • 17
  • 34
0
votes
1 answer

How can I run single tests?

in my Gruntfile.js I have the following: grunt.initConfig({ remove: { default_options: { trace: false, fileList: [ 'tests/browser/libs.js', 'tests/browser/tests.js' ] …
ekkis
  • 9,804
  • 13
  • 55
  • 105
0
votes
1 answer

Trouble with chai spy in mocha

Here is GlobalMenu.react.js: var React = require('react'); var AppBar = require('material-ui/lib/app-bar'); var IconMenu = require('material-ui/lib/menus/icon-menu'); var MenuItem = require('material-ui/lib/menus/menu-item'); var IconButton =…
brickfungus
  • 398
  • 3
  • 9
0
votes
1 answer

Require fails on a PhantomJs test

I have a simple library, -- src/lib.js -- function libtest() { return 2; } that I want to test, which I gather will need PhantomJs. I have a test file: -- test/lib.test.js -- var fs = require('fs'); var assert =…
ekkis
  • 9,804
  • 13
  • 55
  • 105