{"id":30833025,"url":"https://github.com/henriquekoaski/codeceptjs-api-tests","last_synced_at":"2025-09-06T16:09:13.983Z","repository":{"id":305998291,"uuid":"1024610554","full_name":"henriquekoaski/codeceptjs-api-tests","owner":"henriquekoaski","description":"End-to-end (E2E) API testing project using JavaScript with CodeceptJS, BDD with Cucumber, and Joi for response validation. Functional tests for the JSONPlaceholder, a free fake and reliable API for testing and prototyping.","archived":false,"fork":false,"pushed_at":"2025-07-23T03:41:22.000Z","size":118,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-23T05:27:18.920Z","etag":null,"topics":["api-rest","bdd","codeceptjs","cucumber","functional-testing","gherkin-language","javascript","joi-validation"],"latest_commit_sha":null,"homepage":"https://jsonplaceholder.typicode.com","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/henriquekoaski.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-07-23T01:40:38.000Z","updated_at":"2025-07-23T03:41:26.000Z","dependencies_parsed_at":"2025-07-23T05:27:45.789Z","dependency_job_id":"8b1bbf4f-6a5e-4c90-b8de-666d4bde6f5f","html_url":"https://github.com/henriquekoaski/codeceptjs-api-tests","commit_stats":null,"previous_names":["henriquekoaski/codeceptjs-api-tests"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/henriquekoaski/codeceptjs-api-tests","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/henriquekoaski%2Fcodeceptjs-api-tests","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/henriquekoaski%2Fcodeceptjs-api-tests/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/henriquekoaski%2Fcodeceptjs-api-tests/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/henriquekoaski%2Fcodeceptjs-api-tests/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/henriquekoaski","download_url":"https://codeload.github.com/henriquekoaski/codeceptjs-api-tests/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/henriquekoaski%2Fcodeceptjs-api-tests/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273927358,"owners_count":25192513,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-06T02:00:13.247Z","response_time":2576,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api-rest","bdd","codeceptjs","cucumber","functional-testing","gherkin-language","javascript","joi-validation"],"created_at":"2025-09-06T16:02:33.713Z","updated_at":"2025-09-06T16:09:13.953Z","avatar_url":"https://github.com/henriquekoaski.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CodeceptJS-API-Tests\r\n\r\nThis repository contains automated end-to-end (E2E) API tests for the JSONPlaceholder service, a popular fake online REST API for testing and prototyping.\r\n\r\n🌐 Access the documentation through this link 👉 [JSONPlaceholder](https://jsonplaceholder.typicode.com/)\r\n\r\n\u003cimg width=\"1019\" height=\"550\" alt=\"image\" src=\"https://github.com/user-attachments/assets/36f82acd-de23-4c11-bf09-dff13a32c3c2\" /\u003e\r\n\r\n\r\n\r\n\u0026nbsp;\r\n\r\n## 🧭 Overview\r\n\r\nIn this project, I implement automated functional end-to-end (E2E) API tests using **CodeceptJS** with **JavaScript**, following BDD practices with the **Gherkin** language using the **Cucumber** tool. The goal is to ensure the quality and reliability of the JSONPlaceholder API endpoints.\r\n\r\n\u0026nbsp;\r\n\r\n## 🛠️ Technologies and Tools Used\r\n\r\n- JavaScript\r\n- CodeceptJS\r\n- Node.js\r\n- npm\r\n- Cucumber  \r\n- Gherkin  \r\n- BDD (Behavior-Driven Development)  \r\n- Joi (Schema validation)\r\n\r\n\u003cdiv\u003e\r\n \u003ca href=\"https://nodejs.org/en/\"\u003e\r\n  \u003cimg align=\"center\" alt=\"NodeJS\" height=\"50\" width=\"60\" src=\"https://cdn.jsdelivr.net/gh/devicons/devicon/icons/nodejs/nodejs-plain-wordmark.svg\" /\u003e\r\n \u003c/a\u003e\r\n \u003ca href=\"https://www.npmjs.com/\"\u003e\r\n  \u003cimg align=\"center\" alt=\"NPM\" height=\"50\" width=\"60\" src=\"https://cdn.jsdelivr.net/gh/devicons/devicon/icons/npm/npm-original-wordmark.svg\" /\u003e\r\n \u003c/a\u003e\r\n \u003ca href=\"https://www.javascript.com/\"\u003e\r\n  \u003cimg align=\"center\" alt=\"Javascript\" height=\"50\" width=\"60\" src=\"https://cdn.jsdelivr.net/gh/devicons/devicon/icons/javascript/javascript-plain.svg\" /\u003e\r\n \u003c/a\u003e\r\n \u003ca href=\"https://codecept.io/\"\u003e\r\n  \u003cimg align=\"center\" alt=\"CodeceptJS\" height=\"50\" width=\"60\" src=\"https://www.svgrepo.com/show/330181/codeceptjs.svg\" /\u003e\r\n \u003c/a\u003e\r\n \u003ca href=\"https://cucumber.io/\" target=\"_blank\"\u003e\r\n  \u003cimg align=\"center\" alt=\"Cucumber\" height=\"50\" width=\"60\" src=\"https://cdn.jsdelivr.net/gh/devicons/devicon/icons/cucumber/cucumber-plain-wordmark.svg\" /\u003e\r\n \u003c/a\u003e\r\n \u003ca href=\"https://joi.dev/\" target=\"_blank\"\u003e\r\n  \u003cimg align=\"center\" alt=\"Joi\" height=\"50\" width=\"60\" src=\"https://i.imgur.com/InejDjb.png\" /\u003e\r\n \u003c/a\u003e\r\n\u003c/div\u003e\r\n\r\n\u0026nbsp;\r\n\r\n## ⚙️ Project Structure\r\n\r\nThis project is designed for **scalability** and **maintainability** for both current and future test scenarios.\r\n\r\n- **`features/`**: Contains Gherkin feature files describing the test scenarios in BDD style.\r\n\u003cimg width=\"1308\" height=\"629\" alt=\"image\" src=\"https://github.com/user-attachments/assets/e5f4fbe0-5300-46bc-904b-5b0367651030\" /\u003e\r\n\r\n\u0026nbsp;\r\n\r\n- **`step_definitions/`**: Contains JavaScript step definitions for each feature, organized by domain (e.g., `posts.steps.js`, `users.steps.js`, and `common.steps.js` for shared steps).\r\n\u003cimg width=\"1390\" height=\"753\" alt=\"image\" src=\"https://github.com/user-attachments/assets/33833e50-1488-40de-8028-fc131f296859\" /\u003e\r\n\r\n\u0026nbsp;\r\n\r\n- **`data/schema/`**: Contains Joi schemas for validating API responses.\r\n\u003cimg width=\"1225\" height=\"596\" alt=\"image\" src=\"https://github.com/user-attachments/assets/03a9f8d9-c3ff-4c3e-8da5-164b77016b93\" /\u003e\r\n\r\n\r\n\u0026nbsp;\r\n\r\n## 🧪 Automated Test Scenarios\r\n\r\nThis project covers a variety of positive and negative API scenarios, including:\r\n\r\n- **GET all posts**\r\n- **GET post by ID**\r\n- **GET posts by userId**\r\n- **GET all users**\r\n- **CREATE a new user**\r\n- **UPDATE a user**\r\n- **DELETE a user**\r\n- **GET a user that does not exist** (negative scenario, using Scenario Outline for multiple invalid IDs)\r\n\r\nAll scenarios are written in Gherkin and validated with Joi schemas for contract testing.\r\n\r\n\u0026nbsp;\r\n\r\n## 🔬 Running Tests Locally\r\n\r\n### Prerequisites\r\n\r\n- [Node.js](https://nodejs.org/en/) (v14+ recommended)\r\n- [npm](https://www.npmjs.com/)\r\n- [Git](https://git-scm.com/)\r\n\r\n### Setup\r\n\r\n1. **Clone this repository:**\r\n   ```bash\r\n   git clone https://github.com/your-username/codeceptjs-api-tests.git\r\n   cd codeceptjs-api-tests\r\n   ```\r\n\r\n2. **Install dependencies:**\r\n   ```bash\r\n   npm install\r\n   ```\r\n\r\n3. **Run the tests:**\r\n   ```bash\r\n   npm test\r\n   ```\r\n\r\nTest results will be displayed in the terminal and logs will be available in the `output/` folder.\r\n\r\n\u0026nbsp;\r\n\r\n## 📝 Example Test Output\r\n\r\n```\r\nPosts --\r\n  √ GET all posts\r\n  √ GET posts by id {\"id\":\"1\"}\r\n  ...\r\nUsers --\r\n  √ GET all users\r\n  √ CREATE a new user\r\n  ...\r\n  √ GET a user that does not exist {\"userId\":\"9999\"}\r\n  √ GET a user that does not exist {\"userId\":\"0\"}\r\n  ...\r\nOK  | 23 passed   // 8s\r\n```\r\n\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhenriquekoaski%2Fcodeceptjs-api-tests","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhenriquekoaski%2Fcodeceptjs-api-tests","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhenriquekoaski%2Fcodeceptjs-api-tests/lists"}