{"id":18400466,"url":"https://github.com/docksal/behat","last_synced_at":"2025-10-14T06:36:53.388Z","repository":{"id":55891309,"uuid":"69614236","full_name":"docksal/behat","owner":"docksal","description":"A self-contained Docker image to run Behat with no external dependencies","archived":false,"fork":false,"pushed_at":"2020-12-09T05:48:54.000Z","size":24,"stargazers_count":36,"open_issues_count":4,"forks_count":22,"subscribers_count":4,"default_branch":"develop","last_synced_at":"2025-10-02T18:36:39.603Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/docksal.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-09-29T22:54:00.000Z","updated_at":"2025-07-29T13:27:16.000Z","dependencies_parsed_at":"2022-08-15T08:50:12.724Z","dependency_job_id":null,"html_url":"https://github.com/docksal/behat","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/docksal/behat","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/docksal%2Fbehat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/docksal%2Fbehat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/docksal%2Fbehat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/docksal%2Fbehat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/docksal","download_url":"https://codeload.github.com/docksal/behat/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/docksal%2Fbehat/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279018115,"owners_count":26086281,"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","status":"online","status_checked_at":"2025-10-14T02:00:06.444Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-11-06T02:33:38.679Z","updated_at":"2025-10-14T06:36:53.359Z","avatar_url":"https://github.com/docksal.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Behat Docker Image\n\nA self-contained Docker image to run Behat with no external dependencies.\n\nThis image is part of the [Docksal](http://docksal.io) project.\n\nFeatures:\n\n- PHP7, Composer 2\n- Behat 3.8.x\n- DrupalExtension 4.1.x\n- \n\n## Usage\n\nUse this image as if you were using a binary.  \nWorking directory is expected to be mounted at `/src` in the container.\n\n```\n$ docker run --rm -v $(pwd):/src docksal/behat --version\nbehat 3.8.1\n```\n\nYou can also add a shell alias (in `.bashrc`, `.zshrc`, etc.) for convenience.\n\n```\nalias behat='docker run --rm -v $(pwd):/src docksal/behat --colors \"$@\"'\n```\n\nRestart your shell or open a new one, then\n\n```\n$ behat --version\nbehat 3.8.1\n```\n\n\n## Sample setup\n\nSample setup and tests can be found in the [example](example) folder.\n \nFeatures:\n\n- Sample tests\n- Headless Selenium Chrome/Firefox support\n- HTML report\n\n### Using sample setup\n\n```\ngit clone https://github.com/docksal/behat.git docksal-behat\ncd docksal-behat/example\nbehat features/blackbox.feature\n```\n\nNote: if you did not add the shell alias, replace `behat` with `docker run --rm -v $(pwd):/src docksal/behat --colors`.\n\n\n### Behat with Selenium\n\nTo run Behat tests that require a real browser (e.g. for JavaScript support) a headless Selenium Chrome/Firefox can be used.\n\nThere is a Docker Compose configuration in the example folder, that will get you up and running with a Selenium Chrome.\n\n```\ncd example\ndocker-compose up -d\n./run-behat features/blackbox-javascript.feature\n```\n\nIn this case, you get two containers - one running a built-in PHP server for access to HTML reports and one running Selenium. \nBehat runs within the first container and talks to the Selenium container to run tests with a real browser (Chrome/Firefox).\n\n### Switching between Chrome and Firefox\n\n1. Uncomment a respective line in `docker-compose.yml`:\n \n    ```\n    # Pick/uncomment one\n    image: selenium/standalone-chrome-debug:3.141.59\n    #image: selenium/standalone-firefox-debug:3.141.59\n    ```\n\n2. Update container configuration \n\n    ```\n    docker-compose up -d\n    ```\n\n3. Update `behat.yml` as necessary\n    Chrome\n    ```\n    browser_name: chrome\n    selenium2:\n      wd_host: http://browser:4444/wd/hub\n      capabilities: { \"browser\": \"chrome\", \"version\": \"*\" }\n    ```\n\n    Firefox\n    ```\n    browser_name: firefox\n    selenium2:\n      wd_host: http://browser:4444/wd/hub\n      capabilities: { \"browser\": \"firefox\", \"version\": \"*\" }\n    ```\n    \n4. Run tests\n\n\n### HTML report\n\nHTML report will be generated into the `html_report` folder.  \nIt can be accessed by navigating to `http://\u003cyour-docker-host-ip\u003e:8000/html_report` in your browser.  \nReplace `\u003cyour-docker-host-ip\u003e` as necessary (e.g. `localhost`).\n\n### Bex Screenshot\n\nThe `Bex` extension will generate a screenshot when you have a failed step.\n\nYou can configure the folder that the screenshots are saved into through the `behat.yml` file. Check the example and look for `screenshot_directory` under  `Bex\\Behat\\ScreenshotExtension`.\n\n\n## Debugging\n\nThe following command will start a bash session in the container.\n\n```\ndocker run --rm -v $(pwd):/src -it --entrypoint=bash docksal/behat\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdocksal%2Fbehat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdocksal%2Fbehat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdocksal%2Fbehat/lists"}