{"id":15288911,"url":"https://github.com/peridot-php/webdriver-manager","last_synced_at":"2025-04-13T05:34:41.344Z","repository":{"id":27840182,"uuid":"31330260","full_name":"peridot-php/webdriver-manager","owner":"peridot-php","description":"Standalone library and command line tool for managing Selenium WebDriver","archived":false,"fork":false,"pushed_at":"2018-09-05T14:56:40.000Z","size":844,"stargazers_count":35,"open_issues_count":3,"forks_count":7,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-10-01T15:54:35.035Z","etag":null,"topics":[],"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/peridot-php.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-02-25T18:53:35.000Z","updated_at":"2023-09-20T07:51:57.000Z","dependencies_parsed_at":"2022-08-21T13:31:18.368Z","dependency_job_id":null,"html_url":"https://github.com/peridot-php/webdriver-manager","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peridot-php%2Fwebdriver-manager","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peridot-php%2Fwebdriver-manager/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peridot-php%2Fwebdriver-manager/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peridot-php%2Fwebdriver-manager/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/peridot-php","download_url":"https://codeload.github.com/peridot-php/webdriver-manager/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":219846842,"owners_count":16556424,"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":[],"created_at":"2024-09-30T15:54:39.033Z","updated_at":"2024-10-14T19:41:07.863Z","avatar_url":"https://github.com/peridot-php.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# WebDriver Manager\n\n[![Build Status](https://travis-ci.org/peridot-php/webdriver-manager.png)](https://travis-ci.org/peridot-php/webdriver-manager)\n[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/peridot-php/webdriver-manager/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/peridot-php/webdriver-manager/?branch=master)\n\nThe perfect companion for projects with functional tests. Heavily inspired by the `webdriver-manager` that ships with [protractor](https://github.com/angular/protractor). WebDriver Manager allows you to keep Selenium Server binaries up to date. It also provides a packaged solution for easily starting Selenium Server.\n\nIn addition to an easy to use command line application, WebDriver Manager provides a library for managing Selenium binaries in your own apps and tools.\n\n## Installation\n\nWebDriver Manager is meant to be a drop in installation for any project using Selenium WebDriver for functional tests.\n\n```\n$ composer require --dev peridot-php/webdriver-manager\n```\n\nOnce installed, you can operate Selenium Server from the comfort of your project:\n\n```\n$ vendor/bin/manager start\n```\n\n## Usage\n\n![WebDriver Manager Usage](https://raw.github.com/peridot-php/webdriver-manager/master/img/usage.png \"WebDriver Manager Usage\")\n\n### clean\n\nRemove all installed binaries.\n\n![WebDriver clean command](https://raw.github.com/peridot-php/webdriver-manager/master/img/clean.png \"WebDriver clean command\")\n\n### status\n\nList all available binaries and their installed status. Status shows if the binary is installed, out of date, or missing.\n\n ![WebDriver status command](https://raw.github.com/peridot-php/webdriver-manager/master/img/status.png \"WebDriver status command\")\n\n### update\n\nThe update command downloads current binaries and deletes old ones.\n\n![WebDriver update command](https://raw.github.com/peridot-php/webdriver-manager/master/img/update.png \"WebDriver update command\")\n\n### start\n\nStarts Selnium Server with all drivers managed by WebDriver Manager. The start command will run an update at start to make sure drivers are available and up to date.\n\n![WebDriver start command](https://raw.github.com/peridot-php/webdriver-manager/master/img/start.png \"WebDriver start command\")\n\n## Library Usage\n\nWebDriver manager exposes a really simple interface that makes it easy to leverage in your own applications and tools:\n\n```php\nuse Peridot\\WebDriverManager\\Manager;\n\n$manager = new Manager();\n\n$manager-\u003eupdate(); //update all binaries\n$manager-\u003eupdate('selenium'); //only update selenium\n\n$manager-\u003eclean(); //remove installed binaries\n\n$manager-\u003estartInForeground(); //start selenium in the foreground on port 4444\n$manager-\u003estartInForeground(9999); //start selenium in the foreground on port 9999\n$manager-\u003estartInBackground(); //start selenium in the background on port 4444\n$manager-\u003estartInBackground(9999); //start in the background on port 9999 \n\n$path = $manager-\u003egetInstallPath(); //where binaries are installed\n$manager-\u003esetInstallPath(__DIR__); //set the path to install binaries\n\n$manager-\u003eaddBinary(new MyCustomDriver()); //add a binary to manage\n$manager-\u003eremoveBinary('chromdedriver'); //remove a managed binary\n$binaries = $manager-\u003egetBinaries(); //get a collection of managed binaries\n```\n\n### A note on starting Selenium in the background\n\nWebDriver Manager does not block when starting a background process. This makes it difficult to see if Selenium encountered any errors (perhaps a corrupt binary?). The `SeleniumProcess` class provides a method for checking the status of the process. If you want to check that Selenium Server started in the background ok, you might try something like this:\n\n```php\n$process = $manager-\u003estartInBackground();\nusleep(250000); //give Selenium a quarter of a second to validate input\nif (! $process-\u003eisRunning()) {\n\t//Selenium encountered an error\n\tprint $process-\u003egetError();\n\t$process-\u003eclose();\n    return;\n}\n\n//do rad Selenium things\n```\n\nFor more information, see the [API docs](http://peridot-php.github.io/webdriver-manager/docs/);\n\n## Examples\n\nThe API has been used to create a [custom Behat listener](https://github.com/brianium/behavior-driven-todos/blob/master/src/Test/WebDriverListener.php) capable of starting the server before Mink tests are run. This tool is included as part of a demo project known as [behavior driven todos](https://github.com/brianium/behavior-driven-todos).\n\n## Running Tests\n\nWebDriver Manager's tests were written using the [Peridot](http://peridot-php.github.io/) test framework.\n\nUnit tests can be run like so:\n\n```\n$ vendor/bin/peridot\n```\n\nAnd integration tests can be run like this:\n\n```\n$ vendor/bin/peridot --grep *.it.php\n```\n\n## Contributing\nPlease feel free to open issues or pull requests.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fperidot-php%2Fwebdriver-manager","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fperidot-php%2Fwebdriver-manager","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fperidot-php%2Fwebdriver-manager/lists"}