Skip to content

This Docker container is for running automated Web UI tests for MikoPBX using BrowserStack in CI/CD pipelines.

Notifications You must be signed in to change notification settings

mikopbx/BrowserStackDocker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 

Repository files navigation

BrowserStack Docker Container for MikoPBX Web UI Testing

This Docker container is specifically configured for running automated Web UI tests for MikoPBX using BrowserStack in CI/CD pipelines.

Features

  • PHP 8.3 CLI
  • Phalcon 5
  • BrowserStack Local Testing Binary
  • Composer
  • Required PHP extensions for PHPUnit and WebDriver

Prerequisites

  • Docker installed on your system
  • BrowserStack account with access key
  • Access to nexus.miko.ru registry
  • MikoPBX repository

Environment Variables

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}

Container Usage

Local Development

  1. Build the container:
docker build -t mikopbx-browserstack-develop .
  1. 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

TeamCity CI/CD Pipeline

The container is used in the following pipeline steps:

  1. 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
  1. 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

Test Structure

Core/
├── tests/
│   └── AdminCabinet/
│       └── your_test_files.php
├── vendor/
├── composer.json
└── phpunit.xml

Troubleshooting

  1. Check PHP extensions:
php -m
  1. Verify BrowserStack Local connection:
./BrowserStackLocal --key YOUR_ACCESS_KEY --force-local
  1. Common errors:
    • php_error.log - Contains PHP Fatal errors
    • messages log - Contains system errors and exceptions
    • Check for patterns: 'php-errors', 'seconds with error:', 'Error:', 'ErrorException:'

Container Specifications

  • Base Image: Ubuntu 22.04
  • PHP Extensions:
    • dom
    • mbstring
    • xml
    • xmlwriter
    • curl
    • phalcon5
  • Additional Tools:
    • wget
    • unzip
    • iputils-ping
    • curl
    • composer

License

This project is part of MikoPBX and follows its licensing terms.

Support

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

About

This Docker container is for running automated Web UI tests for MikoPBX using BrowserStack in CI/CD pipelines.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published