Implementation:DevExpress Testcafe Gulpfile
| Knowledge Sources | |
|---|---|
| Domains | Build_System, Development_Tooling |
| Last Updated | 2026-02-12 12:00 GMT |
Overview
Concrete build orchestration file that defines the complete Gulp-based build, test, and release pipeline for the TestCafe project.
Description
The Gulpfile.js registers Gulp tasks and steps for: cleaning build artifacts, linting with ESLint, compiling TypeScript server scripts, bundling client scripts with Rollup, generating TypeScript definition files from Mustache templates, compiling LESS styles, running server/client/functional tests with Mocha across various browser configurations (local, headless, SauceLabs, mobile), and building/testing/publishing Docker images.
Usage
Use this file when contributing to the TestCafe project itself. Run tasks via gulp <taskname> to build, lint, test, or release TestCafe.
Code Reference
Source Location
- Repository: DevExpress_Testcafe
- File: Gulpfile.js
- Lines: 1-534
Signature
// Key Gulp tasks (registered via gulp.task / gulpStep)
// Build tasks
gulp.task('clean'); // Removes ./lib directory
gulp.task('lint'); // ESLint on src/**/*.js
gulp.task('build'); // Full build pipeline
// Compilation tasks
gulp.step('compile-client-scripts-bundle'); // Rollup client bundles
gulp.step('compile-ts'); // TypeScript server compilation
gulp.step('generate-ts-defs'); // .d.ts from Mustache templates
gulp.step('styles'); // LESS → CSS
// Test tasks
gulp.task('test-server'); // Server-side unit tests
gulp.task('test-client-local'); // Local browser QUnit tests
gulp.task('test-client-remote'); // SauceLabs browser tests
gulp.task('test-functional-local'); // Local functional tests
gulp.task('test-functional-remote');// Remote functional tests
// Docker tasks
gulp.task('docker-build');
gulp.task('docker-test-functional');
gulp.task('docker-publish');
Import
# Not imported — executed via CLI
npx gulp build
npx gulp test-server
npx gulp lint
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| CLI arguments | flags | No | --browser-alias, --skip-build, --qr-code |
| Source files | src/**/* | Yes | TypeScript/JavaScript/LESS source files |
| Config | package.json, tsconfig.json | Yes | Project metadata and compiler settings |
Outputs
| Name | Type | Description |
|---|---|---|
| lib/ | Directory | Compiled JavaScript output |
| ts-defs/ | Directory | Generated TypeScript definition files |
| Test results | Console output | Mocha test results for server/client/functional tests |
| Docker image | Container | TestCafe Docker image for CI |
Usage Examples
# Build the project
npx gulp build
# Run server tests
npx gulp test-server
# Run functional tests with a specific browser
npx gulp test-functional-local --browser-alias chrome:headless
# Lint the codebase
npx gulp lint
# Build and test Docker image
npx gulp docker-build
npx gulp docker-test-functional