{"id":15028609,"url":"https://github.com/kirilkirkov/php-selenium-testing-framework","last_synced_at":"2026-02-22T22:35:01.122Z","repository":{"id":242234729,"uuid":"809002208","full_name":"kirilkirkov/PHP-Selenium-Testing-Framework","owner":"kirilkirkov","description":"Automated Web Testing Framework with PHP and WebDriver: Build robust automated tests for your web applications using PHP and WebDriver, with support for parallel testing and log generation. This framework provides a flexible and extensible solution for end-to-end testing, helping ensure the quality and reliability of your web projects.","archived":false,"fork":false,"pushed_at":"2024-06-08T15:59:37.000Z","size":128,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-19T21:48:06.737Z","etag":null,"topics":["parallel-testing","parallel-tests","php-test","php-testing","php-tests","php-unit","php-webdriver","php8","php83","phpunit-assertions","phpunit-tests","selenium","selenium-php","selenium-terminal","selenium-test","selenium-test-coverage","selenium-testng-framework","selenium-webdriver","testing","testing-framework"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kirilkirkov.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-06-01T12:02:40.000Z","updated_at":"2024-06-08T15:59:40.000Z","dependencies_parsed_at":"2024-06-01T16:11:55.424Z","dependency_job_id":"dd61bb35-a829-48c0-a134-75abf1efd409","html_url":"https://github.com/kirilkirkov/PHP-Selenium-Testing-Framework","commit_stats":null,"previous_names":["kirilkirkov/php-selenium-testing-framework"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kirilkirkov%2FPHP-Selenium-Testing-Framework","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kirilkirkov%2FPHP-Selenium-Testing-Framework/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kirilkirkov%2FPHP-Selenium-Testing-Framework/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kirilkirkov%2FPHP-Selenium-Testing-Framework/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kirilkirkov","download_url":"https://codeload.github.com/kirilkirkov/PHP-Selenium-Testing-Framework/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243338408,"owners_count":20275503,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["parallel-testing","parallel-tests","php-test","php-testing","php-tests","php-unit","php-webdriver","php8","php83","phpunit-assertions","phpunit-tests","selenium","selenium-php","selenium-terminal","selenium-test","selenium-test-coverage","selenium-testng-framework","selenium-webdriver","testing","testing-framework"],"created_at":"2024-09-24T20:08:44.382Z","updated_at":"2025-10-30T04:03:46.541Z","avatar_url":"https://github.com/kirilkirkov.png","language":"PHP","readme":"# PHP Selenium Testing Framework\n\nWelcome to the PHP Selenium Testing Framework project! This framework leverages Selenium and PHPUnit to automate browser testing for PHP applications. Below you'll find detailed information on how to set up, configure, and run the tests, as well as some tips to make the most of this powerful testing tool.\n\n## Table of Contents\n\n- [Introduction](#introduction)\n- [Features](#features)\n- [Requirements](#requirements)\n- [Installation](#installation)\n- [Configuration](#configuration)\n- [Usage](#usage)\n- [Writing Tests](#writing-tests)\n- [Running Tests](#running-tests)\n- [Project structure](#project-structure)\n- [Screenshots](#screenshots)\n- [Contributing](#contributing)\n- [License](#license)\n\n## Introduction\n\nThis framework provides a robust environment for automated browser testing using Selenium WebDriver. It supports both parallel and sequential testing, ensuring optimal performance and resource utilization. Additionally, the framework includes webhook integration for sending HTML or JSON test reports, and provides the capability to save HTML reports directly on the server.\n\n## Features\n\n- **Automated Browser Testing**: Run your browser-based tests automatically.\n- **Selenium WebDriver Integration**: Utilize the power of Selenium WebDriver for browser automation.\n- **PHPUnit Support**: Write and manage your tests using PHPUnit.\n- **Docker Compatibility**: Easily start Selenium using Docker.\n- **Automatic Test Discovery**: Automatically discover and run tests located in the `tests` directory.\n- **Graceful Shutdown**: Clean up Selenium sessions on script termination or interruption.\n- **Logs**: Support of terminal, xml or json logging\n- **Parallel Testing**: Run tests in parallel to optimize testing time and resources.\n- **Webhook Integration**: Send HTML or JSON reports via webhooks.\n- **HTML Reports**: Generate and save HTML reports on the server for detailed test analysis.\n\n## Requirements\n\n- PHP 7.4 or higher\n- Composer\n- Docker\n\n## Installation\n\n1. **Clone the repository:**\n```bash\ngit clone https://github.com/kirilkirkov/PHP-Selenium-Testing-Framework.git\n```\n2. **Install dependencies:**\n```bash\ncd php-selenium-testing-framework\ncomposer install\n```\n3. **Start Selenium with Docker:**\n```bash\ndocker run -d -e SE_NODE_MAX_SESSIONS=10 -p 4444:4444 -p 5900:5900 --shm-size=2g --restart=always selenium/standalone-firefox:latest\n```\n\n\u003cp\u003eSE_NODE_MAX_SESSIONS is important for maximum count of paralell tests.\u003c/p\u003e\n\n## Configuration\nEnsure you have the necessary configuration files:\n\n- **config.php**: Add your specific configurations.\n- **helpers.php**: Helper functions for your tests.\n\n## Usage\n\n1. **Run the test script:**\n```bash\nphp run-tests.php\n```\n\n2. **Interrupt the tests:**\nPress Ctrl+C to stop the tests gracefully. This will ensure that the Selenium session is properly terminated.\n\n## Writing Tests\nCreate your test classes in the tests directory. Test classes should follow the naming convention *Test.php and should be placed under the Tests namespace. Each separate test method should ends with suffix \"_test\".\n\nExample test class:\n```php\n\u003c?php\ndeclare(strict_types=1);\n\nnamespace Tests;\n\n// PHP-WebDriver\nuse Facebook\\WebDriver\\WebDriverBy;\nuse Facebook\\WebDriver\\WebDriverExpectedCondition;\n// PHPUnit\nuse PHPUnit\\Framework\\TestCase;\n\nclass SampleTest extends TestCase\n{\n    private $driver;\n\n    public function __construct(RemoteWebDriver $driver)\n    {\n        $this-\u003edriver = $driver;\n    }\n\n    public function beforeEachTest()\n    {\n        // Setup code before each test\n    }\n\n    public function afterEachTest()\n    {\n        // Cleanup code after each test\n    }\n\n    public function example_test()\n    {\n        // Your test code\n    }\n}\n```\n\n## Running Tests\nExecute the tests using the command provided in the [Usage](#usage) section. The framework will automatically discover and run all tests matching the pattern *Test.php in the tests directory.\n\n## Real-time Monitoring\nYou can watch the tests in real-time using a VNC viewer. The Selenium Docker image allows VNC connections with the following details:\n\n- **Host:** localhost\n- **Port:** 5900\n- **Password:** secret\n\nTo connect using a VNC viewer:\n\n- Download and install a VNC viewer (e.g., \u003ca href=\"https://www.realvnc.com/en/\"\u003eRealVNC\u003c/a\u003e, \u003ca href=\"https://tigervnc.org/\"\u003eTigerVNC\u003c/a\u003e).\n- Open the VNC viewer and connect to localhost:5900.\n- When prompted, enter the password secret.\n\nThis allows you to observe the browser interactions as the tests are being executed.\n\n## Project structure\n```bash\nPHP-Selenium-Testing-Framework-main/\n├── .gitignore               # Specifies files and directories that should be ignored by Git\n├── LICENSE                  # License file for the project\n├── README.md                # Project description and instructions\n├── composer.json            # Composer configuration file containing project dependencies and metadata\n├── config.php               # Configuration file for the project\n├── helpers.php              # Helper functions file\n├── run-tests.php            # Script to run the tests\n├── src/                     # Directory containing the main source code of the project\n│   ├── CmdMessages.php          # File with command messages\n│   ├── HtmlReport.php           # File for generating HTML reports\n│   ├── ParallelTesting.php      # File for parallel test execution\n│   ├── Response.php             # File for handling responses\n│   ├── ResultsContainer.php     # File for the results container\n│   ├── TestsParser.php          # File for parsing test files\n│   ├── TestsRunner.php          # File for running tests\n│   └── Webhook.php              # File for webhooks\n└── tests/                   # Directory containing test files\n    ├── FailTest.php             # Sample example file for a failing test\n    └── GithubRepoTest.php       # Sample example file for testing a GitHub repository\n```\n\n## Screenshots\n\u003cp\u003eHTML Report:\u003c/p\u003e\n\u003cimg src=\".github/screenshot-of-tests-html-report.png\" width=\"800\"\u003e\n\n## Contributing\nWe welcome contributions! Please follow these steps to contribute:\n\n- Fork the repository.\n- Create a new branch for your feature or bugfix.\n- Commit your changes.\n- Push your branch and create a Pull Request.\n\n## License\nThis project is licensed under the MIT License. See the \u003ca href=\"https://github.com/kirilkirkov/PHP-Selenium-Testing-Framework/blob/main/LICENSE\"\u003eLICENSE\u003c/a\u003e file for details.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkirilkirkov%2Fphp-selenium-testing-framework","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkirilkirkov%2Fphp-selenium-testing-framework","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkirilkirkov%2Fphp-selenium-testing-framework/lists"}