Blank out API_USERNAME and API_PASSWORD in .env and .env.staging. Keys and base URLs are kept; values are supplied locally. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
NeoPaaS E2E API Tests
End-to-end API test suite for the NeoPaaS platform. Tests all 14 core endpoints in a complete transaction flow (login → purchase → lookups → menu → reset → refund).
Prerequisites
- Node.js 18+ installed
- A NeoPaaS account (merchant credentials) for the environment you want to test
Setup
From this folder, install dependencies and the Playwright browser:
npm install
npx playwright install chromium
Environments
The suite ships with config files for each environment. Open the one you want and update the credentials/terminal as needed:
| File | Environment | API URL |
|---|---|---|
.env |
Default | https://www.babinnovations.com |
.env.dev |
Development | https://devpro.babinnovations.com |
.env.staging |
Staging | https://devpro.babinnovations.com |
.env.prod |
Production | https://www.babinnovations.com |
Each file holds the API URL, login credentials, terminal ID, and test amount:
API_BASE_URL=https://www.babinnovations.com
API_USERNAME=your-email@example.com
API_PASSWORD=your-password
TERMINAL_ID=1560127620231203
TEST_AMOUNT=400
Tip: copy
.env.exampleto create your own env file if you need a custom target.
Running the tests
Pick the environment you want to run against:
npm test # uses .env (default)
npm run test:dev # uses .env.dev
npm run test:staging # uses .env.staging
npm run test:prod # uses .env.prod
View the HTML report after a run:
npm run report
When the test starts, it prints which env file was loaded and the API URL so you always know where it's pointing:
🌍 Loaded environment config: .env.dev (API: https://devpro.babinnovations.com)
Endpoints covered
- Login
- Purchase
- Get Transaction by Latest
- Get Transaction by Reference
- Get Transaction by ID
- Get Transaction by UUID
- Get Transactions by Date Range
- Get Transaction Timeline by ID
- Get Transactions Timeline by Date Range
- Enable Menu
- Disable Menu
- Reconcile by Mada ID
- Terminal Reset
- Refund
Project structure
.
├── src/
│ ├── api/client.ts # API client (all endpoint methods)
│ ├── config/env.ts # Loads the selected .env file
│ ├── fixtures/api.fixture.ts # Playwright fixture providing apiClient
│ └── tests/api/
│ └── all-endpoints.spec.ts # The full 14-endpoint flow
├── .env / .env.dev / .env.staging / .env.prod
├── playwright.config.ts
└── package.json
Troubleshooting
- Wrong environment? Check the
🌍 Loaded environment config:line printed at the start of the run. - Auth fails? Make sure the username/password in the chosen
.envfile are valid for that environment. - Browser missing? Run
npx playwright install chromium.
Description
Languages
TypeScript
100%