apickli - stopped working

I have been using Apickli to unit test my APIs and i find it simple and effective. But suddenly it stopped working on my windows machine. I tried couple of things,

1. reinstalled cucumber and apickli dependenices

2. reinstalled NodeJS

3. ensured the ENV path for nodeJS and npm are set properly

I am able to run simple node js programs successfully, but apickli tests fail with following error message.

  Scenario: Response code checks        # features\httpbin.feature:52
    Before
      TypeError: callback is not a function
          at World.<anonymous> (C:\example-project\example-project\test\features\step_definitions\httpbin.js:10:3)

Any help is appreciated!

0 16 1,263
16 REPLIES 16

Hi @Vikaas

Apickli tests are still running successfully. We have been using it in various projects with success. The line that you are talking about (httpbin.js) is cucumber.js Before hook - apickli functions haven't executed yet. I believe this is something local to your installation and not an apickli issue. Also we haven't updated apickli since Jun 11th so if you are saying that it worked before, it should technically still work.

Cheers

Ozan

Hi @Ozan

Thanks for your quick response. Yes, this seems like a local installation issue. I have reinstalled nodeJS, cucumber and apickli from scratch, but this problem still prevails. I am not sure if there are any missing references, is there anyway i can troubleshoot this?

Not applicable

Hi @Vikaas , as @Ozan Seymen mentioned, the last release of apickli npm module was 4 months ago.

Looks like your recently updated local setup of Node.js might be an issue.

Have you tried to run cucumber.js on its own? Write 1 or 2 simple tests and give them a try. Their GitHub page has examples. If these are not clear, here is a good tutorial for starting with Cucumber.js and Gherkin.

This should put you on the right path.

Hi @Saul Zukauskas

I was able to successfully run the cucumber test cases. I also tried executing the apickli test cases using grunt and gulp... surprisingly all of them work. But not able to directly run the apickli test cases. For sure my local setup is messed up, a full re-installation of Node-JS is of no help either.

Do you have cucumberjs module installed globally?

npm install -g cucumber
Grunt for example runs it from local mode_modules directory so this might be why your test cases run ok with Grunt but not directly with cucumberjs.

@Saul Zukauskas - Yes, cucumber is installed globally and apickli node_modules are local to folder

hey, this might be a good reason to replace your old Windows machine with Mac 🙂

Yes... I was hoping that a hard reset would help, but it contributed more to my frustration!!

@Vikaas given that you run most recent Node.js version on Windows box, can you try the following:

In the example-project/test/features/step_definitions/httpbin.js replace

this.Before(function(callback) { 
  this.apickli = new apickli.Apickli('http', 'httpbin.org');
  callback();
});

with this

this.Before(function(scenario,callback) { 
  this.apickli = new apickli.Apickli('http', 'httpbin.org');
  callback();
});

Hi @Saul Zukauskas,

This seems to fix the tests for success scenarios, however for failures i see,

callback.fail is not a function

Not applicable

Hi,

When I run - npm install" or "npm install jsonpath-plus" inside the /tests folder which has node_modules (where all Jars save after npm command), I am getting below error - about not finding cucumber.js

After adding cucmber.js manually by copy from the local dump and paste inside the node_modules, it is asking for another .js file and this is continue for lots of files.

The point is - when copy paste from the local dump all the jars folder into node_modules, it is working but when usingnpm install" or "npm install jsonpath-plus", it is not working.

I am doing this to test my BDD using Apickli against my Apigee API.

My Node version is - v6.9.1

package.json
----------------
{
 "name": "amock-tests",
 "version": "1.0.0",
 "devDependencies": {
  "cucumber":"^0.5.3",
  "apigee-access":"1.3.0"
 }
}<br>

when running "npm install" , download the jars in node _modules but at the end give below message

added 178 packages from 138 contributors and audited 472 packages in 41.708s

found 1 high severity vulnerability

run `npm audit fix` to fix them, or `npm audit` for details

when run - npm audit fix command as mentioned above - got below -

up to date in 2.732s

fixed 0 of 1 vulnerability in 472 scanned packages

1 vulnerability required manual review and could not be updated

One more file - package-lock.json is created.

In Short:

•When copy all folders from local laptop to - project folder/tests/node_modules --> It is working

•When download folderds using npm install and other-->, it is given message - 1 high severity vulnerability and not working

npm version is : 6.1.0

@Rajeev Chaturvedi

Appreciate if you can open a new post

However try using the latest npm versions (apickli is on 2.1.0 and cucumber is on 4.x).

hi

Don't ask totally new, unrelated question in answers to questions that are 3 years old.

POST A NEW QUESTION.

7039-ask-a-question.png