How franksantillan/adt-take-home works
Project type and purpose
• This is not a traditional full-stack app but an open-source test automation tool built on Node.js, Cucumber.js, and TypeScript.
• Its purpose is to read Gherkin feature files, run BDD scenarios, collect results, and generate HTML reports—either locally or inside a Docker container, with CI integration via GitHub Actions.
File structure
• Top-level scripts & config:
• cucumber.js, cucumber.json (Cucumber config)
• tsconfig.json, env.d.ts, types.d.ts (TypeScript config/types)
• Dockerfile, .dockerignore (containerization)
• .github/workflows/automated-tests.yml (CI pipeline definition)
• Source code under src/:
• features/ holds Gherkin .feature files and step_definitions/ (.ts)
• utils/ provides support modules: constants, test utils, reportUtils, plus a custom multiple-cucumber HTML reporter in multiple-cucumber/reporter.ts
• Scripts in package.json orchestrate:
• Test runs (npx cucumber-js with tags, format to JSON)
• Report generation (multiple-cucumber-html-reporter)
• Docker build & run to produce persistent test-results
• GitHub Actions badge indicates automated CI tests.
README for additional insights
• It clearly outlines the BDD scenarios (cucumber mathematics) and the end-to-end flow: from “Given/When/Then” definitions to HTML reports.
• It lists dependencies (Playwright, dayjs) that could extend functionality (e.g., browser-based testing or date handling).
a. Main components:
1. Cucumber.js Engine
2. Feature Files (.feature)
3. Step Definitions (src/features/step_definitions/*.ts)
4. Utility Modules (src/utils/* & multiple-cucumber reporter)
5. Report Generator (multiple-cucumber-html-reporter invoked via reporter.ts)
6. Node.js/TypeScript Runtime (ts-node)
7. Docker Container
8. CI Pipeline (GitHub Actions)
9. Test Results Storage (JSON files + HTML output)
b. Relationships & data flows:
• CI Pipeline → triggers Docker build & test run
• Docker Container ↔ Node.js runtime (with TypeScript via ts-node)
• Node.js runtime → Cucumber.js reads Feature Files → invokes Step Definitions
• Step Definitions call Utility Modules for shared logic, constants, date handling
• Cucumber.js outputs JSON test results → multiple-cucumber-html-reporter reads JSON → writes HTML report
• Reports mount back to host volume under test-results/ for persistence
c. Architectural patterns / principles:
• Modularization: separate concerns between feature definitions, step logic, and utility/report modules
• Pluggable reporting: custom reporter module decoupled from test definitions
• Containerization: environment consistency via Dockerfile
• CI-as-code: GitHub workflow triggers reproducible test runs
d. Key technologies & libraries:
• Node.js, TypeScript, ts-node
• Cucumber.js (BDD runner)
• multiple-cucumber-html-reporter (HTML report generation)
• Playwright (optional browser tests), dayjs (date utils)
• Docker, GitHub Actions
Final advice
• Be as detailed as possible: include each folder or module that plays a role.
• essential elements without overcrowding: group similar utils under a “Utility Modules” cluster, group scripts under “npm scripts.”
• Keep labels consistent with file names (e.g., multiple-cucumber/reporter.ts).