{"id":21891183,"url":"https://github.com/kamalkhan/web-browser","last_synced_at":"2026-04-12T20:55:35.395Z","repository":{"id":62493913,"uuid":"376100162","full_name":"kamalkhan/web-browser","owner":"kamalkhan","description":"Programmatically navigate/test the web using php. A convenience wrapper around laravel/dusk.","archived":false,"fork":false,"pushed_at":"2021-06-23T12:09:07.000Z","size":82,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-02T22:34:46.654Z","etag":null,"topics":["browser","dusk","laravel","testing","web"],"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/kamalkhan.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-06-11T17:40:05.000Z","updated_at":"2021-06-23T12:09:09.000Z","dependencies_parsed_at":"2022-11-02T11:17:36.285Z","dependency_job_id":null,"html_url":"https://github.com/kamalkhan/web-browser","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kamalkhan%2Fweb-browser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kamalkhan%2Fweb-browser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kamalkhan%2Fweb-browser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kamalkhan%2Fweb-browser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kamalkhan","download_url":"https://codeload.github.com/kamalkhan/web-browser/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244898458,"owners_count":20528341,"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":["browser","dusk","laravel","testing","web"],"created_at":"2024-11-28T12:21:15.545Z","updated_at":"2026-04-12T20:55:30.359Z","avatar_url":"https://github.com/kamalkhan.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Web Browser [![Build Status][icon-status]][link-status] [![Total Downloads][icon-downloads]][link-downloads] [![MIT License][icon-license]](LICENSE.md)\n\nProgrammatically navigate/test the web.\n\n- [Requirements](#requirements)\n- [Install](#install)\n  - [Install chrome driver](#install-chrome-driver)\n  - [Install phantomjs driver](#install-phantomjs-driver)\n- [Usage](#usage)\n    - [Chrome](#chrome)\n    - [Phantomjs](#phantomjs)\n- [API](#api)\n    - [Example](#example)\n    - [Testing](#testing)\n        - [PHPUnit](#phpunit)\n- [Changelog](#changelog)\n- [Testing](#testing)\n- [Contributing](#contributing)\n- [Security](#security)\n- [Credits](#credits)\n- [License](#license)\n\n## Requirements\n\n- PHP \u003e= 7.2\n\n## Install\n\nYou may install this package using [composer][link-composer].\n\n```shell\n$ composer require bhittani/web-browser\n```\n\n### Install chrome driver\n\n```shell\n$ vendor/bin/install-chrome-driver\n```\n\n### Install phantomjs driver\n\n```shell\n$ vendor/bin/install-phantomjs-driver\n```\n\n## Usage\n\nThis package conveniently wraps [laravel/dusk](https://github.com/laravel/dusk).\n\n### Chrome\n\nFirst ensure you have installed the [chrome driver](#install-chrome-driver).\n\n```php\n\u003c?php\n\nuse Bhittani\\WebBrowser\\Chrome;\n\n$browser = new Chrome;\n```\n\n### Phantomjs\n\nFirst ensure you have installed the [phantomjs driver](#install-phantomjs-driver).\n\n```php\n\u003c?php\n\nuse Bhittani\\WebBrowser\\Phantomjs;\n\n$browser = new Phantomjs;\n```\n\n## API\n\nAll browser instances extend `Laravel\\Dusk\\Browser`, hence, the same API applies.\n\n### Example\n\n```php\n\u003c?php\n\n$browser-\u003evisit('https://example.com')-\u003eassertSee('Example');\n```\n\n### Testing\n\nWe can also make assertions and capture failures within a testing environment.\n\n```php\n\u003c?php\n\nuse Bhittani\\WebBrowser\\Browser;\nuse Bhittani\\WebBrowser\\Phantomjs;\nuse Bhittani\\WebBrowser\\Testing;\n\nTesting::bootstrap(); // Required for purging failed assertions.\n\nBrowser::test(function ($browser1, $browser2/*, ... */) {\n    $browser1-\u003evisit('https://example.com')-\u003eassertSee('Example');\n    $browser2-\u003evisit('https://example.net')-\u003eassertSee('Example');\n});\n\nPhantomjs::test(/*...*/);\n\nTesting::tearDown(); // Required for closing all browsers.\n```\n\n\u003e The above test callback will capture any failed assertions by taking a screenshot, save the console log and the source of a web page that caused the failure.\n\n#### PHPUnit\n\nA `TestCase` class and a `TestTrait` trait under the `Bhittani\\WebBrowser` namespace is included for making it easy to write your browser tests using `PHPUnit`.\n\n## Changelog\n\nPlease see [CHANGELOG](CHANGELOG.md) for more information on what has changed.\n\n## Testing\n\n```shell\n$ git clone https://github.com/kamalkhan/web-browser\n\n$ cd web-browser\n\n$ composer install\n\n$ composer install-drivers\n\n$ composer test\n```\n\n## Contributing\n\nPlease see [CONTRIBUTING](CONTRIBUTING.md) and [CONDUCT](CONDUCT.md) for details.\n\n## Security\n\nIf you discover any security related issues, please email `shout@bhittani.com` instead of using the issue tracker.\n\n## Credits\n\n- [Kamal Khan](http://bhittani.com)\n- [All Contributors](https://github.com/kamalkhan/web-browser/contributors)\n\n## License\n\nThe MIT License (MIT). Please see the [License File](LICENSE.md) for more information.\n\n\u003c!--Status--\u003e\n\n[icon-status]: https://img.shields.io/github/workflow/status/kamalkhan/web-browser/main?style=flat-square\n\n[link-status]: https://github.com/kamalkhan/web-browser\n\n\u003c!--Downloads--\u003e\n\n[icon-downloads]: https://img.shields.io/packagist/dt/bhittani/web-browser.svg?style=flat-square\n\n[link-downloads]: https://packagist.org/packages/bhittani/web-browser\n\n\u003c!--License--\u003e\n\n[icon-license]: https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square\n\n\u003c!--composer--\u003e\n\n[link-composer]: https://getcomposer.org\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkamalkhan%2Fweb-browser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkamalkhan%2Fweb-browser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkamalkhan%2Fweb-browser/lists"}