phantomjs - Tests PASS outside Vagrant, FAIL inside Vagrant -


I am running CasperJS scripts on a Mac and under the periodic box. The test succeeds outside the wagrant but not inside it. Why?

For reference, I have put the results of the exam at the bottom of this post.

Version (in and out of the warranty)
  • Casper: 1.1.0-beta3
  • Phantom: 1.9.7
  • OSX: 10.9.4
  • Elite: 1.3.5

    If you need something else to debug, please let me know, I will add: -)

    test command

    This is what I am using in the console to run the test.

      Casey test price_filter.js   

    test script

    it should be www3.smatch.com Since then it is publicly accessible to work for you too. In fact, the script goes to the 'Lady Exceors' section, which finds a product in the Dome and gets its price. Then it checks that the value of at least one product is high and there is no high priced product after checking the price filter.

      var x = require ('casper'). SelectXPath; Casper.test.begin ('Maximum Price Filters', Function Suite (Test) {casper.start (' http://www3.smatch.com/ '); casper.then (function () {this.mouseEvent (' mouseover Then click ('' * * * [text () = "accessors"]);) casp. Then (function () {Var} Element = this.evaluate (function () {var element = __utils __. FindAll ('Category-content .products [data-result] .price'); return elements.map (function (L) {return el.textContent trim ();});}) Var = is inaccurate; (var i = 0; i & lt; elements; height; i ++) {if (elements [i] .match (/ ^ [0- 9] { 2}, [0- 9] [0-9] /)) {clarification = true;} and if (! Element [i]. Milan (/ ^ [0-9] +, [0-9] [0] - [9] /)) {New error ('Invalid value');}} If throwing new error ('no expensive product') (! Wide); test.assert (elements.length & gt; 0) by filter First, we ("price-filter-form", "input [name =" max "] ':' 7 '});}); Casper.thenClick (' # price-filter-submit '); C Asper .then (function () {var element = this.evaluate (function () {var element = __utils __. FindAll ('Category- content .products [data-result] .price'); Return element Map (function (L) {return el.textContent.trim ();}); }); For (var i = 0; i & lt; elements.length; i ++) {if (! Element [i]. Match (/ ^ [0-7], [0- 9] [0- 9] / )) New error (elements [i]); } Test.assert (elements.length> 0, 'After filter, we have cheap products'); }); Casper.run (function () {test.done ();}); });   

    Result of test

    Furious out Test file: price_filter.js # Maximum value filter Before PASS filter, we have expensive products after PASS filter, we have cheaper products, passed 2 tests were executed in 1.202, 2 passed, 0 failed, 0 suspicious, 0 were left.

    Inside Unreal

      Test file: Important / price_filter.js # Before the Maximum Price Filter PASS Filter, we have The expensive products are failed error: 89,90 * â? ¬ # Type: uncaughtError # file: critical / price_filter.js: 62 # Error: 89,90 * one? ¬ # Error: 89,90 # # * â? ¬ # Important / Price_filter.js at: 62 # Check Stop at #StastStep (/usr/lib/node_modules/casperjs/modules/casper.js:1553) # at Stop / (/usr/lib/node_modules/casperjs/modules/casper.js : 399) # Stack: failed execution of 21.873 failed 2 exams, passed 1, failed 1, 0 doubtful, details for 1 left failed test: serious / in price_filter.js: 62 maximum value filter uncaughtError: error: 89,90 * a ?? This is really weird, but it is accessible by adding an empty step behind the click. Looks like:  
      casper.thenClick (can 'deposit with #price -filter'); Casper.then (function () {});   

    or

      casper.thenClick ('# price-filter-submit'); Casper.wait (1); // 1 msec   

    I can not provide any insight why this may be. Maybe it's a caspar bug, it's a casper bug.

Comments

Popular posts from this blog

ios - Adding an SKSpriteNode to SKScene from a child SKSpriteNode -

Matlab transpose a table vector -

c# - Textbox not clickable but editable -