The Cuppet Core framework uses the config module for configuration management, supporting multiple environments and configuration overrides. Below are all available configuration properties that can be used in your JSON configuration files:
- Purpose: Path to the JSON file where test data will be stored during test execution
- Default:
"jsonFiles/example.json" - Used by: Data storage operations, variable management
- Example:
"jsonFiles/test-data.json"
- Purpose: Directory path where screenshots will be saved when tests fail
- Default:
"screenshots/" - Used by: Test failure handling, screenshot capture
- Example:
"screenshots/failed-tests/"
- Purpose: Base directory path for file uploads in tests
- Default:
"files/"(if not configured) - Used by: File upload step definitions, attachment handling
- Example:
"test-files/uploads/"
- Purpose: Language setting for multilingual test support
- Default:
"en" - Used by: Multilingual string resolution in step definitions
- Example:
"fr","de","es"
- Purpose: Puppeteer browser configuration options
- Purpose: Command-line arguments passed to the browser
- Used by: Browser initialization
- Example:
{
"args": [
"--no-sandbox",
"--disable-setuid-sandbox",
"--proxy-server='direct://'",
"--proxy-bypass-list=*",
"--headless=new"
]
}- Purpose: Viewport configurations for different screen sizes
- Used by: Browser setup
- Properties:
default: Default viewport size (used in browser initialization)MacBook: MacBook screen dimensionslaptop: Laptop screen dimensionstablet: Tablet screen dimensionsmobile: Mobile screen dimensions
Example:
{
"viewport": {
"default": { "width": 1920, "height": 1080 },
"MacBook": { "width": 1440, "height": 900 },
"laptop": { "width": 1280, "height": 720 },
"tablet": { "width": 768, "height": 1024 },
"mobile": { "width": 320, "height": 667 }
}
}- Purpose: Main application credentials and base URL
- Purpose: Base URL for the application under test
- Used by: URL preparation, navigation steps, API base URL fallback
- Example:
"https://demoqa.com/"
- Purpose: Username for automated login
- Used by: Login step definitions
- Example:
"testuser@example.com"
- Purpose: Password for automated login
- Used by: Login step definitions
- Example:
"SecurePassword123"
- Purpose: HTTP Basic Authentication credentials
- Purpose: Username for HTTP Basic Auth
- Used by: Browser authentication, API fallback authentication
- Example:
"basicuser"
- Purpose: Password for HTTP Basic Auth
- Used by: Browser authentication, API fallback authentication
- Example:
"basicpass"
- Purpose: Configuration for API testing capabilities
- Purpose: Base URL for API endpoints
- Used by: API step definitions, request URL preparation
- Example:
"https://api.example.com/v1/"
- Purpose: API key for X-Api-Key header authentication
- Used by: API request authentication
- Example:
"your-api-key-here"
- Purpose: Authorization header value for API requests
- Used by: API request authentication
- Example:
"Bearer your-token-here"
- Purpose: Username for API Basic Authentication
- Used by: API request authentication (takes precedence over basicAuth)
- Example:
"apiuser"
- Purpose: Password for API Basic Authentication
- Used by: API request authentication (takes precedence over basicAuth)
- Example:
"apipassword"
- Purpose: Appium capabilities for mobile testing
- Used by: Mobile step definitions, Appium session management
- Example:
{
"platformName": "Android",
"appium:automationName": "UiAutomator2",
"appium:deviceName": "Android",
"appium:disableIdLocatorAutocompletion": true,
"appium:appPackage": "com.android.settings",
"appium:appActivity": ".Settings"
}- Purpose: Mapping of region names to CSS selectors for page regions
- Used by: Region-specific step definitions, element interaction within regions
- Example:
{
"ExampleRegion": ".valid-css-selector",
"Cards": ".category-cards",
"Header": ".site-header",
"Footer": ".site-footer"
}- Purpose: CSS selector for cookie consent button to auto-click
- Used by: Automatic cookie consent handling during page visits
- Example:
".cookie-consent-accept"
- Purpose: Configuration for Pa11y accessibility testing
- Used by: Accessibility step definitions, Pa11y test execution
- Properties:
hideElements: CSS selector for elements to hide during testingstandard: Accessibility standard to test againstrunners: Array of accessibility testing runners
Example:
{
"hideElements": ".elementSelector",
"standard": "WCAG2AA",
"runners": ["axe", "htmlcs"]
}- Purpose: Text value to conditionally skip certain test steps
- Used by: Conditional step definitions (if visible steps)
- Example:
"Skip this step in staging"
- Purpose: Custom regex pattern for trimming variable values
- Used by: Variable processing in data storage
- Default:
/[?&@$#:,;]/ - Example:
"[?&@$#:,;|]"
The framework also supports dynamic configuration properties that can be accessed using the step definitions:
- Any custom property can be added and accessed via
config.get('propertyName') - Configuration values can be used in step definitions with phrases like "from config"
- Email variables and other dynamic values can be stored and retrieved
The Cuppet Core framework provides comprehensive step definitions organized into modules for different testing capabilities:
- Purpose: Core navigation and authentication steps
- Key Features:
- Page navigation (
I visit "/path") - Login functionality (
I log in) - Custom login with credentials (
I log in as "username" "password") - Saved path navigation
- Page navigation (
- Purpose: Core UI interaction and validation steps
- Key Features:
- Element visibility checks (
I should see "text") - Click interactions (
I click on the element "selector") - Text-based interactions (
I click on the text "text") - Region-specific operations (
I should see "text" in "region" region) - Form validation (
I should see "value" in "field") - Element existence validation
- Element visibility checks (
- Purpose: Configuration-driven element interactions
- Key Features:
- Configuration-based text clicking (
I click on the text "configKey" from config) - Configuration value validation (
I check if "configKey" from config contains "value") - Dynamic configuration access in steps
- Configuration-based text clicking (
- Purpose: JSON data-driven element interactions
- Key Features:
- JSON variable display (
I should see "variable" from json in element "selector") - JSON variable input (
I fill in "field" with "variable" variable from JSON) - JSON data validation in regions
- JSON stringify operations
- JSON variable display (
- Purpose: Conditional operations based on element visibility
- Key Features:
- Conditional text verification (
I should see "text" if visible) - Conditional clicking (
I click on the element "selector" if visible) - Conditional form filling (
I fill in "field" with "value" if visible) - Skip functionality based on configuration
- Conditional text verification (
- Purpose: RESTful API testing capabilities
- Key Features:
- HTTP method testing (
I send a "GET" request to "/endpoint") - Response validation (
the response code should be "200") - JSON response validation (
the property "name" should be an "string") - Request body preparation (
I have request body) - Variable storage from responses (
I store "property" to "variable" variable) - XML validation (
I validate that the page is a valid XML)
- HTTP method testing (
- Purpose: Utility functions and data management
- Key Features:
- Path saving (
I save the path of the current page) - Configuration to JSON storage (
I store "configKey" from config to "variable" in JSON) - Entity ID extraction (
I store the entity id with variable name "variable") - Element value storage (
I store the value from the element "selector" in "variable") - Variable manipulation and validation
- Path saving (
- Purpose: Mobile application testing with Appium
- Key Features:
- App navigation (
I go to "package" app package and "activity" activity) - Mobile element interaction (
I click on the element "selector" on mobile) - Mobile scrolling (
I scroll to the element "selector" on mobile)
- App navigation (
- Purpose: Web accessibility testing with Pa11y
- Key Features:
- Current page accessibility validation (
I validate the saved page accessibility) - Specific page accessibility testing (
I validate the accessibility of the "/path" page) - Automated HTML report generation
- Current page accessibility validation (
- Purpose: Performance testing with Google Lighthouse
- Key Features:
- Current page performance testing (
I generate lighthouse report for the saved page) - Specific page performance testing (
I generate lighthouse report for "/path" page) - Automated performance report generation
- Current page performance testing (
- Purpose: Iframe-specific testing operations
- Key Features:
- Iframe content validation (
I should see "text" in iframe "selector") - Iframe element interaction (
I click on element "selector" in iframe "frameSelector") - Iframe text interaction (
I click on the text "text" in iframe "frameSelector") - Iframe form operations (
I type "text" in "field" field in iframe "frameSelector")
- Iframe content validation (
The framework supports multiple configuration environments using the NODE_CONFIG_ENV environment variable. You can create environment-specific configuration files like:
config/default.json- Default configurationconfig/development.json- Development environment overridesconfig/staging.json- Staging environment overridesconfig/production.json- Production environment overrides
Environment-specific files will merge with and override the default configuration.
{
"jsonFilePath": "jsonFiles/test-data.json",
"screenshotsPath": "screenshots/",
"credentials": {
"baseUrl": "https://example.com/",
"username": "testuser",
"password": "testpass"
},
"browserOptions": {
"args": ["--no-sandbox", "--headless=new"],
"viewport": {
"default": { "width": 1920, "height": 1080 }
}
},
"regionMap": {
"MainContent": ".main-content",
"Navigation": ".navbar"
},
"blockingCookie": ".cookie-accept"
}{
"jsonFilePath": "jsonFiles/api-data.json",
"credentials": {
"baseUrl": "https://frontend.example.com/"
},
"api": {
"baseApiUrl": "https://api.example.com/v1/",
"x-api-key": "your-api-key-here"
},
"basicAuth": {
"authUser": "user",
"authPass": "pass"
}
}{
"jsonFilePath": "jsonFiles/mobile-data.json",
"screenshotsPath": "screenshots/mobile/",
"appiumCapabilities": {
"platformName": "Android",
"appium:automationName": "UiAutomator2",
"appium:deviceName": "Android",
"appium:app": "/path/to/your/app.apk"
}
}{
"jsonFilePath": "jsonFiles/test-data.json",
"credentials": {
"baseUrl": "https://example.com/"
},
"browserOptions": {
"args": ["--no-sandbox"],
"viewport": {
"default": { "width": 1920, "height": 1080 }
}
},
"pa11yConfig": {
"hideElements": ".ads, .tracking",
"standard": "WCAG2AA",
"runners": ["axe", "htmlcs"]
}
}{
"jsonFilePath": "jsonFiles/complete-test-data.json",
"screenshotsPath": "screenshots/",
"filePath": "files/",
"language": "en",
"credentials": {
"baseUrl": "https://example.com/",
"username": "testuser",
"password": "testpass"
},
"browserOptions": {
"args": ["--no-sandbox", "--disable-setuid-sandbox", "--headless=new"],
"viewport": {
"default": { "width": 1920, "height": 1080 },
"mobile": { "width": 375, "height": 667 }
}
},
"api": {
"baseApiUrl": "https://api.example.com/v1/",
"x-api-key": "your-api-key-here"
},
"appiumCapabilities": {
"platformName": "Android",
"appium:automationName": "UiAutomator2",
"appium:deviceName": "Android"
},
"regionMap": {
"Header": ".site-header",
"MainContent": ".main-content",
"Footer": ".site-footer"
},
"basicAuth": {
"authUser": "user",
"authPass": "pass"
},
"blockingCookie": ".cookie-accept",
"pa11yConfig": {
"hideElements": ".ads",
"standard": "WCAG2AA",
"runners": ["axe"]
},
"skipSteps": "Skip in CI",
"trimRegex": "[?&@$#:,;]"
}This configuration system provides maximum flexibility for different testing environments and scenarios while maintaining clean separation of test logic and configuration data. The comprehensive step definitions enable testing across web, mobile, API, accessibility and performance scenarios all within a single framework.