k0lmena Automation Framework documentation
Everything you need to install, configure and use the framework: front, API, mobile, performance, reports and auto-healing.
What it is and what's included
k0lmena is a QA automation framework that brings four kinds of tests into one repository with one syntax (Gherkin/BDD + TypeScript):
| Type | Engine | Description |
|---|---|---|
| Front / E2E | Playwright + Cucumber | UI tests on Chromium, Firefox and WebKit. |
| API | Axios + Cucumber | HTTP endpoint tests with response validation. |
| Mobile | WebdriverIO + Appium | Mobile app tests (local Appium or BrowserStack). |
| Performance | Artillery + k6 | Load, stress, soak and spike tests (HTTP and browser). |
It also includes locator auto-healing, HTML reports for each test type, helper tools (locator generator, broken-link tester, recorder and debug mode) and automatic screenshots, traces and logs on failure.
Technologies
- TypeScript
- Playwright (E2E, tracing and codegen)
- Cucumber (
@cucumber/cucumber, BDD/Gherkin) - Axios (API)
- WebdriverIO + Appium (mobile)
- Artillery and k6 (performance)
- Cheerio (HTML parsing in tools)
Project structure
src/
├── front-test/ # E2E (UI): Playwright + Cucumber
│ ├── features/ # Gherkin scenarios (.feature)
│ ├── steps/ # Step definitions
│ ├── locators/ # Element selectors
│ ├── config/ # Config (BASEURL from .env)
│ ├── hooks/ # Browser setup, screenshots, traces
│ ├── utils/ # interactions, validations, keys, types
│ └── auto-healing/ # Locator history
├── api-test/ # features/ + tests/ (axios)
├── mobile-test/ # apps/ features/ steps/ locators/ support/
├── performance-test/ # artillery/ + k6/
├── reports/ # front/ api/ mobile/ performance/
└── tools/ # crawler/ link-tester/ generator/ debug/Key root files: package.json, cucumber.js (profiles), playwright.config.ts, tsconfig.json, .example.env.
Prerequisites
- Node.js (LTS recommended): nodejs.org
- Visual Studio Code (optional)
- For mobile: Appium and an emulator or device (or a BrowserStack account).
- For k6 performance tests: the binary is installed with the bootstrap script.
Installation
git clone https://github.com/underc0delabs/k0lmena.git
cd k0lmena
npm install # dependencies
npx playwright install # Playwright browsers
cp .example.env .env # environment fileThen edit .env with your values.
Configuration (environment variables)
General / Front
| Variable | Default | Description |
|---|---|---|
BASEURL | — | URL of the site under test (front, crawler, link-tester, codegen). |
BROWSER | empty | chromium, firefox or webkit. Empty runs all three. |
PARALLEL | empty | Parallel Cucumber execution (front and API). |
HEADLESS | true | Run without a window. |
SLOWMO | 0 | Delay between actions in milliseconds. |
VIEWPORT_WIDTH | 1366 | Viewport width. |
VIEWPORT_HEIGHT | 768 | Viewport height. |
LOCALE | es-AR | Browser locale. |
TIMEZONE | America/Argentina/Mendoza | Browser time zone. |
TRACE | off | Playwright traces: off, on or on-failure. |
REPORT_DIR | src/reports/front | Screenshots and traces folder. |
API
| Variable | Default | Description |
|---|---|---|
API_BASEURL | https://petstore.swagger.io | Base URL of the API under test. Loaded from .env.api. |
Auto-healing
| Variable | Default | Description |
|---|---|---|
K0LMENA_AUTO_HEALING | off | Mode: off, learn, heal or on. |
K0LMENA_AUTO_HEALING_FLUSH | debounced | Write strategy: debounced, immediate or onEnd. |
K0LMENA_AUTO_HEALING_WRITE_PRETTY | 0 | 1 = pretty JSON. |
K0LMENA_AUTO_HEALING_LOG | 0 | 1 = verbose logs. |
K0LMENA_AUTO_HEALING_CONSOLE | 1 | Prints a line when a locator is healed. |
K0LMENA_AUTO_HEALING_HISTORY_PATH | .k0lmena/auto-healing/front-history.json | History file path. |
K0LMENA_AUTO_HEALING_MAX_CANDIDATES | 12 | Max candidates per locator. |
K0LMENA_AUTO_HEALING_SNAPSHOT_TIMEOUT_MS | 250 | DOM snapshot timeout while learning. |
K0LMENA_AUTO_HEALING_CANDIDATE_TIMEOUT_MS | 1500 | Timeout to validate each candidate. |
Front / E2E (UI)
npm run test # @Smoke scenarios, 1 retry
npm run allTests # all testsCucumber profiles live in cucumber.js. Control browser and mode through variables:
BROWSER=chromium HEADLESS=false SLOWMO=300 npm run test
TRACE=on-failure npm run testParallel execution
PARALLEL | Behavior |
|---|---|
empty / 0 / 1 / false / off / no | Sequential (default). |
on / true / yes | Auto: one worker per CPU. |
N (> 1) | N parallel workers. |
PARALLEL=4 npm run test
PARALLEL=on npm run apiTest- Each worker is an independent process; auto-healing writes one history file per worker to avoid collisions.
- The
debugprofile always runs sequentially. - Parallelism is per scenario: for maximum speed, pin a single browser per run.
API
npm run apiTest # scenarios tagged @APISet API_BASEURL in .env.api. Steps live in src/api-test/tests/.
Mobile
npm run mobile # WebdriverIO + AppiumConfig lives in src/mobile-test/support/wdio.conf.ts. By default it runs against local Appium (localhost:4723) and includes a commented block for BrowserStack using BROWSERSTACK_USER and BROWSERSTACK_KEY.
Performance
Artillery
npm run load # load test, writes report.jsonk6
npm run bootstrap:k6 # installs the binary the first time
npm run k6:build # compiles the TypeScript scenarios
npm run k6::smoke
npm run k6:stress
npm run k6:soak
npm run k6:spike
npm run k6:run:browserk6 scenarios live in src/performance-test/k6/http/ and are compiled with esbuild into dist/.
Reports
| Area | Command | Description |
|---|---|---|
| Front | npm run report | Full HTML report. |
| Front | npm run report-default | Default Cucumber report. |
| API | npm run api-report | API suite report. |
| Mobile | npm run mobile-report | Mobile suite report. |
| Performance | npm run load-report | Artillery HTML report. |
| Performance (cloud) | npm run load-report-cloud | Uploads the report to Artillery Cloud. |
package.json.When a front test fails, the framework attaches a screenshot, browser console logs and, if TRACE is on, the Playwright trace.
Locator auto-healing
k0lmena can recover locators that stop working when the app changes. It works in two phases:
- Learn: every time an action succeeds, it stores alternative locators for the element (data-testid, id, name, aria-label, role, text, classes) in a history file.
- Heal: if the original locator fails, it tries the stored candidates (ranked by past success and page) until one works, and reports it.
| Mode | Behavior |
|---|---|
off | Disabled (default). |
learn | Only learns candidates. |
heal | Only heals using existing history. |
on | Learns and heals (recommended). |
K0LMENA_AUTO_HEALING=on npm run testWhen a locator is healed you'll see HEALED: <original> -> <candidate> in the console, and the event is attached to the report.
Tools
All of them use BASEURL from .env unless stated otherwise.
Crawler (locator generator)
npm run crawler
npx ts-node src/tools/crawler/locators-generator.ts https://mi-sitio.comOutput: src/tools/crawler/output/locators-output.ts
Link tester
npm run link-tester # base page
npm run link-tester:full # full siteRecord (Playwright codegen)
npm run record
npm run record:generatorDebug
npm run debugContinuous integration (CI)
The .github/workflows/Tests.yaml workflow runs on GitHub Actions (manual trigger) inside the official Playwright container and runs, in order: dependency and browser install, front tests + report, API tests + report, performance (Artillery) + report, and publishes the reports as artifacts.
How to add a new test
- Feature: create or edit a
.featureinsrc/front-test/features/. - Locators: add selectors in
src/front-test/locators/. - Steps: implement them in
src/front-test/steps/using the helpers inutils/interactions.ts(getByPlaceholderAndFillIt,getElementByRoleAndClickIt,selectByLabel,click,fill). - Run with
npm run test(or tag the scenario with@Smoke).
The interaction helpers already include auto-healing, so your steps benefit with no extra code.
npm scripts reference
| Script | What it does |
|---|---|
test | Front: @Smoke scenarios (front profile, 1 retry). |
allTests | Runs all tests. |
report / report-default | Full front report / default Cucumber report. |
apiTest / api-report | Runs / reports the API suite. |
mobile / mobile-report | Runs / reports the mobile suite. |
load / load-report / load-report-cloud | Performance with Artillery. |
bootstrap:k6 / k6:build | Installs k6 / builds the scenarios. |
k6::smoke · k6:stress · k6:soak · k6:spike · k6:run:browser | k6 scenarios. |
crawler | Locator generator (POM). |
link-tester / link-tester:full | Broken link and image tester. |
record / record:generator | Test recorder. |
debug | Front in debug mode. |
Video
Watch the video tutorial on YouTube · QARMY channel
License and credits
k0lmena Automation Framework is open source under the ISC license. It is a QARMY and Underc0de community project.
Want it in your company?
We install it, automate your critical flows and train your team.
Talk to us on WhatsApp