{"id":46950,"library":"apickli","title":"apickli","description":"apickli is a collection of utility functions and a Gherkin-based BDD framework for REST API integration testing built on top of Cucumber.js. The latest stable version is 3.0.3, which introduced support for HTTP/2 and updated dependencies. It simplifies API testing by providing predefined step definitions for common HTTP operations, response validation, and state management. Compared to other tools like Frisby or Supertest, apickli integrates tightly with Cucumber's Gherkin syntax, enabling non-technical stakeholders to write and understand tests. It supports JSON and XML responses, query parameters, headers, and authentication. Released less frequently, with a focus on stability.","status":"active","version":"3.0.3","language":"javascript","source_language":"en","source_url":"https://github.com/apickli/apickli","tags":["javascript","cucumber.js","integration","rest","api"],"install":[{"cmd":"npm install apickli","lang":"bash","label":"npm"},{"cmd":"yarn add apickli","lang":"bash","label":"yarn"},{"cmd":"pnpm add apickli","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"apickli is a Cucumber.js framework, requiring cucumber runtime for step definitions.","package":"cucumber","optional":false}],"imports":[{"note":"apickli is ESM-only since v3. Default export is recommended.","wrong":"const apickli = require('apickli');","symbol":"apickli","correct":"import { apickli } from 'apickli';"},{"note":"This is actually from Cucumber, but commonly misattributed.","wrong":"const defineSupportCode = require('cucumber').defineSupportCode;","symbol":"defineSupportCode","correct":"import { defineSupportCode } from 'cucumber';"},{"note":"Named export is the constructor class. Default export is the legacy function.","wrong":"import Apickli from 'apickli';","symbol":"Apickli","correct":"import { Apickli } from 'apickli';"}],"quickstart":{"code":"// features/step_definitions/api_steps.js\nconst { apickli } = require('apickli');\nconst { defineSupportCode } = require('cucumber');\n\ndefineSupportCode(function({ When, Then }) {\n    When(/^I send a GET request to \"([^\"]*)\"$/, function(path, callback) {\n        this.apickli = new apickli.Apickli('http://example.com');\n        this.apickli.get(path, callback);\n    });\n\n    Then(/^the response status should be (\\d+)$/, function(status, callback) {\n        this.apickli.assertResponseCode(status, callback);\n    });\n});","lang":"javascript","description":"This shows how to set up a Cucumber step definition file using apickli to send GET requests and assert response status codes."},"warnings":[{"fix":"Upgrade Node to >=12. Use import syntax instead of require.","message":"apickli v3 dropped support for Node.js < 12 and migrated to ESM-only exports.","severity":"breaking","affected_versions":">=3.0.0"},{"fix":"Replace default import with named imports: import { apickli, Apickli } from 'apickli';","message":"The default export (apickli as function) is deprecated in v3 and will be removed in v4. Use named exports.","severity":"deprecated","affected_versions":">=3.0.0"},{"fix":"Always assign apickli to 'this.apickli' inside step definition functions.","message":"Step definitions must use 'this.apickli' to access the apickli instance. Using a local variable will cause undefined errors.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Ensure custom World object sets this.apickli during initialization.","message":"apickli expects Cucumber's World class to have a 'apickli' property. Creating a custom World without this property will break steps.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Always pass the callback to apickli assertion methods or use a wrapper that throws.","message":"Assertion failures in step definitions do not throw errors; instead they call the callback with error. Neglecting to handle the callback will mask failures.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"search_vec":"'3.0.3':31 'api':18,42,107 'apick':1,2,66 'authent':94 'base':13 'bdd':14 'built':21 'collect':5 'common':50 'compar':58 'cucumb':70 'cucumber.js':25,104 'definit':48 'depend':39 'enabl':74 'focus':100 'framework':15 'frequent':97 'frisbi':63 'function':8 'gherkin':12,72 'gherkin-bas':11 'header':92 'http':51 'http/2':36 'integr':19,67,105 'introduc':33 'javascript':103 'json':86 'latest':27 'less':96 'like':62 'manag':57 'non':76 'non-techn':75 'oper':52 'paramet':91 'predefin':46 'provid':45 'queri':90 'releas':95 'respons':53,89 'rest':17,106 'simplifi':41 'stabil':102 'stabl':28 'stakehold':78 'state':56 'step':47 'supertest':65 'support':34,85 'syntax':73 'technic':77 'test':20,43,83 'tight':68 'tool':61 'top':23 'understand':82 'updat':38 'util':7 'valid':54 'version':29 'write':80 'xml':88","created_at":"2026-06-07T16:48:58.228665+00:00","updated_at":"2026-06-07T16:48:58.228665+00:00","problems":[{"fix":"Use import { Apickli } from 'apickli'; const apickli = new Apickli(baseURL);","cause":"Importing apickli as a default function instead of named export in v3.","error":"TypeError: apickli is not a constructor"},{"fix":"Run npm install cucumber --save-dev","cause":"cucumber is a peer dependency and not automatically installed.","error":"Error: Cannot find module 'cucumber'"},{"fix":"Import defineSupportCode from 'cucumber' rather than from 'apickli'.","cause":"defineSupportCode is not exported by apickli; it comes from cucumber.","error":"ReferenceError: defineSupportCode is not defined"},{"fix":"Ensure steps are only called within Cucumber scenarios and that the World has apickli initialized.","cause":"Using this.apickli in a non-Cucumber context or missing setup.","error":"TypeError: Cannot read property 'apickli' of undefined"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/apickli/apickli#readme","github":"https://github.com/apickli/apickli","docs":null,"changelog":null,"pypi":null,"npm":"apickli","openapi_spec":null,"status_page":null,"smithery":null,"categories":["testing"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-07","next_check":"2026-09-05","install_tag":null}}