{"id":28549416,"url":"https://github.com/behat/minkextension-example","last_synced_at":"2025-08-06T08:16:33.149Z","repository":{"id":3216597,"uuid":"4251325","full_name":"Behat/MinkExtension-example","owner":"Behat","description":"Example of Behat 2.4 + Mink 1.4 + MinkExtension usage","archived":true,"fork":false,"pushed_at":"2017-02-25T21:43:18.000Z","size":115,"stargazers_count":40,"open_issues_count":0,"forks_count":21,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-07-05T19:33:30.604Z","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/Behat.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":"2012-05-07T16:10:13.000Z","updated_at":"2025-04-26T06:16:50.000Z","dependencies_parsed_at":"2022-09-18T12:42:31.217Z","dependency_job_id":null,"html_url":"https://github.com/Behat/MinkExtension-example","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Behat/MinkExtension-example","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Behat%2FMinkExtension-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Behat%2FMinkExtension-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Behat%2FMinkExtension-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Behat%2FMinkExtension-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Behat","download_url":"https://codeload.github.com/Behat/MinkExtension-example/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Behat%2FMinkExtension-example/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269042322,"owners_count":24349672,"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-08-06T02:00:09.910Z","response_time":99,"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":"2025-06-10T02:10:07.228Z","updated_at":"2025-08-06T08:16:33.099Z","avatar_url":"https://github.com/Behat.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# A Behat 2.4 + Mink + 1.4 Demo\n\n## Mink\n\nMink is a browser emulators abstraction layer.\n\nIt defines a basic API through which you can talk with specific browser emulator libraries.\n\nMink drivers define a bridge between Mink and those libraries.\n\n**This repository will allow you to easily try Mink and Behat to test… wikipedia.org!**\n\n## Usage \n\nClone this repo:\n\n``` bash\ngit clone https://github.com/Behat/MinkExtension-example\n```\n\nNow install Behat, Mink, MinkExtension and their dependencies with [composer](http://getcomposer.org/):\n\n``` bash\ncurl http://getcomposer.org/installer | php\nphp composer.phar install\n```\n\nNow to launch Behat, just run:\n\n``` bash\nbin/behat\n```\n\nLaunch Behat: the two first scenarios should use Goutte.\nThe third one checks that the JS autocomplete field works on wikipedia: it uses Selenium WebDriver!\nbut lets ignore it for a quick start with `--tags` filter:\n\n``` bash\nvendor/bin/behat --tags ~@javascript\n```\n\nYou should see an output like:\n\n``` gherkin\nFeature: Search\n  In order to see a word definition\n  As a website user\n  I need to be able to search for a word\n\n  Scenario: Searching for a page that does exist\n    Given I am on /wiki/Main_Page\n    When I fill in \"search\" with \"Behavior Driven Development\"\n    And I press \"searchButton\"\n    Then I should see \"agile software development\"\n\n  Scenario: Searching for a page that does NOT exist\n    Given I am on /wiki/Main_Page\n    When I fill in \"search\" with \"Glory Driven Development\"\n    And I press \"searchButton\"\n    Then I should see \"Search results\"\n\n2 scenarios (2 passed)\n8 steps (8 passed)\n```\n\n### Different types of contexts\n\nThere's 4 ways to run this suite:\n\n1. Using `TraitedFeatureContext`, which leverages php5.4 traits\n   for clean reusability. If you have php5.4 installed, just call:\n\n   ``` bash\n   bin/behat -p=traits\n   ```\n\n2. Using `SimpleFeatureContext`, which uses inheritance mechanism to\n   get predefined step definitions. If you prefer 5.3 and inheritance, just call:\n\n   ``` bash\n   bin/behat -p=inheritance\n   ```\n\n3. Using `SubcontextedFeatureContext`, which uses subcontexts mechanism to\n   get predefined step definitions. If you prefer 5.3 and subcontexts, just call:\n\n   ``` bash\n   bin/behat -p=subcontexts\n   ```\n\n4. Using no context. This way will use default context from extension, giving you\n   ability to avoid context creation altogether. Profile `no_context` uses non-existing\n   `bootstrap` path, so Behat will not be able to find any context class and will use\n   defaul `Behat\\MinkExtension\\Context\\MinkContext`:\n\n   ``` bash\n   bin/behat -p=no_context\n   ```\n\nYou must choose between those 4 ways right now just for their demonstration. In reality,\nBehat supports them simultaneously and you can mix them together.\n\n### Selenium WebDriver\n\nIf you want to test `@javascript` part of feature, you'll need to install Selenium.\nSelenium gives you ability to run `@javascript` tagged scenarios in real browser.\n\n1. Download latest Selenium2 jar from the [Selenium website](http://seleniumhq.org/download/)\n2. Run selenium jar with:\n\n    ``` bash\n    java -jar selenium.jar \u003e /dev/null \u0026\n    ```\n\nNow if you run:\n\n``` bash\nbin/behat\n```\n\nyou should see an output like this:\n\n``` gherkin\nFeature: Search\n  In order to see a word definition\n  As a website user\n  I need to be able to search for a word\n\n  Scenario: Searching for a page that does exist\n    Given I am on /wiki/Main_Page\n    When I fill in \"search\" with \"Behavior Driven Development\"\n    And I press \"searchButton\"\n    Then I should see \"agile software development\"\n\n  Scenario: Searching for a page that does NOT exist\n    Given I am on /wiki/Main_Page\n    When I fill in \"search\" with \"Glory Driven Development\"\n    And I press \"searchButton\"\n    Then I should see \"Search results\"\n\n  @javascript\n  Scenario: Searching for a page with autocompletion\n    Given I am on /wiki/Main_Page\n    When I fill in \"search\" with \"Behavior Driv\"\n    And I wait for the suggestion box to appear\n    Then I should see \"Behavior Driven Development\"\n\n3 scenarios (3 passed)\n12 steps (12 passed)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbehat%2Fminkextension-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbehat%2Fminkextension-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbehat%2Fminkextension-example/lists"}