Environments
Understanding environments and how they enable testing across different deployments.
What is an Environment?
An environment represents a specific deployment or instance of your application where tests can be executed. It contains all the configuration information needed for Synthesized QA to access, authenticate with, and test your application.
Why Environments Matter
Most applications have multiple deployments serving different purposes:
- Development: Active development with latest code changes
- Staging: Pre-production environment for final validation
- QA/Test: Dedicated testing environment with controlled data
- Production: Live application serving real users
Environments in Synthesized QA allow you to run the same test suite against any of these deployments by simply selecting which environment to target.
Environment Components
Each environment consists of configurable components that define how tests interact with your application. Synthesized QA supports nine component types:
1. Main UI URL
- Purpose: Primary web address of your application
- Used for: UI tests that interact with your web interface
- Example:
https://app.example.com
2. Login URL
- Purpose: Dedicated login page if separate from main application
- Used for: Authentication before test execution
- Example:
https://auth.example.com/login
3. Login Credentials
- Purpose: Username and password for authentication
- Used for: Logging into the application during tests
- Best Practice: Use dedicated test accounts, not personal credentials
4. API Endpoint
- Purpose: Base URL for REST API or GraphQL endpoint
- Used for: API tests and backend validation
- Example:
https://api.example.com/v1
5. API Key
- Purpose: Authentication key for API requests
- Used for: Authorizing API calls in tests
- Security: Stored securely and never exposed in logs
6. Database Connection
- Purpose: Direct database access for data validation
- Used for: Verifying data integrity, setting up test data
- Includes: Host, port, database name, credentials
7. OAuth Configuration
- Purpose: OAuth 2.0 authentication setup
- Used for: Applications using OAuth for authentication
- Includes: Client ID, client secret, token endpoints
8. HTTP Headers
- Purpose: Custom headers for API or UI requests
- Used for: Additional authentication, feature flags, tracking
- Example:
X-API-Version: 2.0
9. UI Login Script
- Purpose: Custom Groovy/Selenide script for complex login flows
- Used for: Multi-factor auth, SSO, or non-standard login processes
- Advanced: Requires scripting knowledge
Essential vs Optional Components
For UI Testing (Minimum Required)
- Main UI URL
- Login Credentials (if authentication required)
For API Testing (Minimum Required)
- API Endpoint
- API Key or Login Credentials (for authentication)
Optional But Valuable
- Database Connection - for data validation
- HTTP Headers - for advanced scenarios
- OAuth Configuration - if using OAuth
- UI Login Script - for complex authentication
Environment Lifecycle
Creation
- Navigate to Environments page
- Click "Add Environment"
- Name the environment
- Add required components
- Save configuration
Configuration
- Components can be added, modified, or removed anytime
- Each component has validation to ensure proper configuration
- Invalid components are flagged for correction
Usage
- Select environment when running discovery
- Select environment when running tests
- Same tests run against different environments
Maintenance
- Update URLs when deployments change
- Rotate credentials periodically
- Add components as testing needs evolve
Multiple Environments Strategy
Development Environment
- Purpose: Test during active development
- Frequency: Run tests frequently (on every change)
- Focus: New features and bug fixes
- Data: Frequently reset, synthetic data
Staging Environment
- Purpose: Pre-release validation
- Frequency: Run full suite before releases
- Focus: Regression testing, integration validation
- Data: Production-like data
Production Environment
- Purpose: Monitoring and smoke testing
- Frequency: Periodic health checks
- Focus: Critical path validation
- Caution: Read-only tests, don't modify production data
Environment Configuration Best Practices
Security
- Use dedicated test accounts with limited permissions
- Don't use personal credentials
- Rotate API keys and passwords regularly
- Store sensitive data securely (handled automatically by Synthesized QA)
Naming
- Use clear, descriptive names (Development, Staging, Production)
- Include version or branch info if needed (Dev-v2, Staging-feature-login)
- Be consistent across projects
Validation
- Verify URLs are accessible before running tests
- Test credentials manually first
- Check that all required components are configured
- Review validation warnings and fix issues
Organization
- Create environments that match your deployment pipeline
- Document what each environment is for
- Keep environment configurations up to date
Environment Status and Validation
Each environment component has a validation status:
- Valid: Configuration is correct and accessible
- Invalid: Configuration has errors that need fixing
- Not Validated: Configuration hasn't been tested yet
Hover over component icons to see validation details and any error messages.
Common Environment Issues
Connection Failures
- Cause: URL not accessible, firewall blocking access
- Solution: Verify URL is correct and accessible from Synthesized QA
Authentication Failures
- Cause: Incorrect credentials, account locked, expired password
- Solution: Verify credentials work manually, reset if needed
SSL/Certificate Errors
- Cause: Invalid or self-signed SSL certificates
- Solution: Use proper SSL certificates or configure certificate handling
Network Timeouts
- Cause: Slow environment, network latency
- Solution: Adjust timeout settings, check environment performance
Environments and Test Runs
When you run tests:
- You select which environment to target
- Tests use that environment's configuration
- Results are tagged with the environment used
- You can compare results across environments
This allows you to validate that the same functionality works consistently across all your deployments.
Next Steps
To get started with environments, see the Set Up an Environment guide in the Getting Started section. For detailed information on each component type, refer to the individual component documentation.
Was this helpful?