This Docker container is specifically configured for running automated Web UI tests for MikoPBX using BrowserStack in CI/CD pipelines.
- PHP 8.3 CLI
- Phalcon 5
- BrowserStack Local Testing Binary
- Composer
- Required PHP extensions for PHPUnit and WebDriver
- Docker installed on your system
- BrowserStack account with access key
- Access to nexus.miko.ru registry
- MikoPBX repository
Required environment variables for testing:
BROWSERSTACK_USERNAME=your_username
BROWSERSTACK_ACCESS_KEY=your_access_key
BROWSERSTACK_LOCAL=true
BROWSERSTACK_LOCAL_IDENTIFIER=${BUILD_NUMBER}
BROWSERSTACK_DAEMON_STARTED=true
SERVER_PBX=http://your.pbx.ip
BUILD_NUMBER=${BUILD_NUMBER}
- Build the container:
docker build -t mikopbx-browserstack-develop .
- Run the container:
docker run -it --rm \
-v $(pwd):/app \
-e BROWSERSTACK_USERNAME=your_username \
-e BROWSERSTACK_ACCESS_KEY=your_access_key \
-e BROWSERSTACK_LOCAL=true \
mikopbx-browserstack-develop bash
The container is used in the following pipeline steps:
- Building and pushing the container:
# Build container
docker build -t nexus.miko.ru:6789/mikopbx-browserstack-${BRANCH}:latest .
# Push to registry
docker push nexus.miko.ru:6789/mikopbx-browserstack-${BRANCH}:latest
- Running tests:
# Install dependencies
composer install --ignore-platform-reqs
# Start BrowserStack Local
/BrowserStackLocal --key $BROWSERSTACK_ACCESS_KEY \
--force-local \
--local-identifier $BROWSERSTACK_LOCAL_IDENTIFIER \
--daemon start
# Run PHPUnit tests
cd tests/AdminCabinet
php ../../vendor/bin/phpunit --bootstrap ../../vendor/autoload.php --teamcity
# Stop BrowserStack Local
/BrowserStackLocal --local-identifier $BROWSERSTACK_LOCAL_IDENTIFIER --daemon stop
Core/
├── tests/
│ └── AdminCabinet/
│ └── your_test_files.php
├── vendor/
├── composer.json
└── phpunit.xml
- Check PHP extensions:
php -m
- Verify BrowserStack Local connection:
./BrowserStackLocal --key YOUR_ACCESS_KEY --force-local
- Common errors:
php_error.log
- Contains PHP Fatal errorsmessages
log - Contains system errors and exceptions- Check for patterns: 'php-errors', 'seconds with error:', 'Error:', 'ErrorException:'
- Base Image: Ubuntu 22.04
- PHP Extensions:
- dom
- mbstring
- xml
- xmlwriter
- curl
- phalcon5
- Additional Tools:
- wget
- unzip
- iputils-ping
- curl
- composer
This project is part of MikoPBX and follows its licensing terms.
For issues related to:
- Container configuration: Create an issue in the MikoPBX repository
- BrowserStack: Contact BrowserStack support using your credentials
- MikoPBX: Refer to MikoPBX documentation or contact support team